dockview-angular 4.11.0 → 4.13.0

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.
Files changed (37) hide show
  1. package/dist/cjs/lib/dockview/dockview-angular.component.js +2 -1
  2. package/dist/cjs/lib/dockview-angular.module.js +2 -4
  3. package/dist/cjs/lib/gridview/gridview-angular.component.js +2 -1
  4. package/dist/cjs/lib/paneview/paneview-angular.component.js +2 -1
  5. package/dist/cjs/lib/splitview/splitview-angular.component.js +2 -1
  6. package/dist/cjs/lib/utils/angular-renderer.js +11 -3
  7. package/dist/cjs/lib/utils/component-factory.js +1 -0
  8. package/dist/dockview-angular.amd.js +194 -65
  9. package/dist/dockview-angular.amd.js.map +1 -1
  10. package/dist/dockview-angular.amd.min.js +2 -2
  11. package/dist/dockview-angular.amd.min.js.map +1 -1
  12. package/dist/dockview-angular.amd.min.noStyle.js +2 -2
  13. package/dist/dockview-angular.amd.min.noStyle.js.map +1 -1
  14. package/dist/dockview-angular.amd.noStyle.js +194 -65
  15. package/dist/dockview-angular.amd.noStyle.js.map +1 -1
  16. package/dist/dockview-angular.cjs.js +194 -65
  17. package/dist/dockview-angular.cjs.js.map +1 -1
  18. package/dist/dockview-angular.esm.js +194 -66
  19. package/dist/dockview-angular.esm.js.map +1 -1
  20. package/dist/dockview-angular.esm.min.js +2 -2
  21. package/dist/dockview-angular.esm.min.js.map +1 -1
  22. package/dist/dockview-angular.js +194 -65
  23. package/dist/dockview-angular.js.map +1 -1
  24. package/dist/dockview-angular.min.js +2 -2
  25. package/dist/dockview-angular.min.js.map +1 -1
  26. package/dist/dockview-angular.min.noStyle.js +2 -2
  27. package/dist/dockview-angular.min.noStyle.js.map +1 -1
  28. package/dist/dockview-angular.noStyle.js +194 -65
  29. package/dist/dockview-angular.noStyle.js.map +1 -1
  30. package/dist/esm/lib/dockview/dockview-angular.component.js +2 -1
  31. package/dist/esm/lib/dockview-angular.module.js +2 -4
  32. package/dist/esm/lib/gridview/gridview-angular.component.js +2 -1
  33. package/dist/esm/lib/paneview/paneview-angular.component.js +2 -1
  34. package/dist/esm/lib/splitview/splitview-angular.component.js +2 -1
  35. package/dist/esm/lib/utils/angular-renderer.js +11 -3
  36. package/dist/esm/lib/utils/component-factory.js +1 -0
  37. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-angular
3
- * @version 4.11.0
3
+ * @version 4.13.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -1296,11 +1296,13 @@ class Splitview {
1296
1296
  document.removeEventListener('pointermove', onPointerMove);
1297
1297
  document.removeEventListener('pointerup', end);
1298
1298
  document.removeEventListener('pointercancel', end);
1299
+ document.removeEventListener('contextmenu', end);
1299
1300
  this._onDidSashEnd.fire(undefined);
1300
1301
  };
1301
1302
  document.addEventListener('pointermove', onPointerMove);
1302
1303
  document.addEventListener('pointerup', end);
1303
1304
  document.addEventListener('pointercancel', end);
1305
+ document.addEventListener('contextmenu', end);
1304
1306
  };
1305
1307
  sash.addEventListener('pointerdown', onPointerStart);
1306
1308
  const sashItem = {
@@ -3783,8 +3785,8 @@ class DockviewApi {
3783
3785
  /**
3784
3786
  * Create a component from a serialized object.
3785
3787
  */
3786
- fromJSON(data) {
3787
- this.component.fromJSON(data);
3788
+ fromJSON(data, options) {
3789
+ this.component.fromJSON(data, options);
3788
3790
  }
3789
3791
  /**
3790
3792
  * Create a serialized object of the current component.
@@ -5015,6 +5017,7 @@ class ContentContainer extends CompositeDisposable {
5015
5017
  }
5016
5018
  if (doRender) {
5017
5019
  const focusTracker = trackFocus(container);
5020
+ this.focusTracker = focusTracker;
5018
5021
  const disposable = new CompositeDisposable();
5019
5022
  disposable.addDisposables(focusTracker, focusTracker.onDidFocus(() => this._onDidFocus.fire()), focusTracker.onDidBlur(() => this._onDidBlur.fire()));
5020
5023
  this.disposable.value = disposable;
@@ -5042,6 +5045,16 @@ class ContentContainer extends CompositeDisposable {
5042
5045
  this.disposable.dispose();
5043
5046
  super.dispose();
5044
5047
  }
5048
+ /**
5049
+ * Refresh the focus tracker state to handle cases where focus state
5050
+ * gets out of sync due to programmatic panel activation
5051
+ */
5052
+ refreshFocusState() {
5053
+ var _a;
5054
+ if ((_a = this.focusTracker) === null || _a === void 0 ? void 0 : _a.refreshState) {
5055
+ this.focusTracker.refreshState();
5056
+ }
5057
+ }
5045
5058
  }
5046
5059
 
5047
5060
  function addGhostImage(dataTransfer, ghostElement, options) {
@@ -5151,7 +5164,7 @@ class Tab extends CompositeDisposable {
5151
5164
  }
5152
5165
  }
5153
5166
 
5154
- class WillShowOverlayLocationEvent {
5167
+ class DockviewWillShowOverlayLocationEvent {
5155
5168
  get kind() {
5156
5169
  return this.options.kind;
5157
5170
  }
@@ -5499,7 +5512,7 @@ class Tabs extends CompositeDisposable {
5499
5512
  index: this._tabs.findIndex((x) => x.value === tab),
5500
5513
  });
5501
5514
  }), tab.onWillShowOverlay((event) => {
5502
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
5515
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
5503
5516
  kind: 'tab',
5504
5517
  panel: this.group.activePanel,
5505
5518
  api: this.accessor.api,
@@ -5663,7 +5676,7 @@ class TabsContainer extends CompositeDisposable {
5663
5676
  index: this.tabs.size,
5664
5677
  });
5665
5678
  }), this.voidContainer.onWillShowOverlay((event) => {
5666
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
5679
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
5667
5680
  kind: 'header_space',
5668
5681
  panel: this.group.activePanel,
5669
5682
  api: this.accessor.api,
@@ -6057,7 +6070,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
6057
6070
  }), this.tabsContainer.onWillShowOverlay((event) => {
6058
6071
  this._onWillShowOverlay.fire(event);
6059
6072
  }), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
6060
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
6073
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
6061
6074
  kind: 'content',
6062
6075
  panel: this.activePanel,
6063
6076
  api: this._api,
@@ -6368,8 +6381,11 @@ class DockviewGroupPanelModel extends CompositeDisposable {
6368
6381
  this._activePanel = panel;
6369
6382
  if (panel) {
6370
6383
  this.tabsContainer.setActivePanel(panel);
6384
+ this.contentContainer.openPanel(panel);
6371
6385
  panel.layout(this._width, this._height);
6372
6386
  this.updateMru(panel);
6387
+ // Refresh focus state to handle programmatic activation without DOM focus change
6388
+ this.contentContainer.refreshFocusState();
6373
6389
  this._onDidActivePanelChange.fire({
6374
6390
  panel,
6375
6391
  });
@@ -6730,7 +6746,19 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
6730
6746
  this.onDidLocationChange = this._onDidLocationChange.event;
6731
6747
  this._onDidActivePanelChange = new Emitter();
6732
6748
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
6733
- this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange);
6749
+ this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
6750
+ // When becoming visible, apply any pending size change
6751
+ if (event.isVisible && this._pendingSize) {
6752
+ super.setSize(this._pendingSize);
6753
+ this._pendingSize = undefined;
6754
+ }
6755
+ }));
6756
+ }
6757
+ setSize(event) {
6758
+ // Always store the requested size
6759
+ this._pendingSize = Object.assign({}, event);
6760
+ // Apply the size change immediately
6761
+ super.setSize(event);
6734
6762
  }
6735
6763
  close() {
6736
6764
  if (!this._group) {
@@ -7199,6 +7227,18 @@ class DockviewPanel extends CompositeDisposable {
7199
7227
  params: this._params,
7200
7228
  });
7201
7229
  }
7230
+ updateFromStateModel(state) {
7231
+ var _a, _b, _c;
7232
+ this._maximumHeight = state.maximumHeight;
7233
+ this._minimumHeight = state.minimumHeight;
7234
+ this._maximumWidth = state.maximumWidth;
7235
+ this._minimumWidth = state.minimumWidth;
7236
+ this.update({ params: (_a = state.params) !== null && _a !== void 0 ? _a : {} });
7237
+ this.setTitle((_b = state.title) !== null && _b !== void 0 ? _b : this.id);
7238
+ this.setRenderer((_c = state.renderer) !== null && _c !== void 0 ? _c : this.accessor.renderer);
7239
+ // state.contentComponent;
7240
+ // state.tabComponent;
7241
+ }
7202
7242
  updateParentGroup(group, options) {
7203
7243
  this._group = group;
7204
7244
  this.api.group = this._group;
@@ -7670,13 +7710,16 @@ class Overlay extends CompositeDisposable {
7670
7710
  let right = undefined;
7671
7711
  let width = undefined;
7672
7712
  const moveTop = () => {
7673
- top = clamp(y, -Number.MAX_VALUE, startPosition.originalY +
7713
+ // When dragging top handle, constrain top position to prevent oversizing
7714
+ const maxTop = startPosition.originalY +
7674
7715
  startPosition.originalHeight >
7675
7716
  containerRect.height
7676
- ? this.getMinimumHeight(containerRect.height)
7717
+ ? Math.max(0, containerRect.height -
7718
+ Overlay.MINIMUM_HEIGHT)
7677
7719
  : Math.max(0, startPosition.originalY +
7678
7720
  startPosition.originalHeight -
7679
- Overlay.MINIMUM_HEIGHT));
7721
+ Overlay.MINIMUM_HEIGHT);
7722
+ top = clamp(y, 0, maxTop);
7680
7723
  height =
7681
7724
  startPosition.originalY +
7682
7725
  startPosition.originalHeight -
@@ -7687,22 +7730,27 @@ class Overlay extends CompositeDisposable {
7687
7730
  top =
7688
7731
  startPosition.originalY -
7689
7732
  startPosition.originalHeight;
7690
- height = clamp(y - top, top < 0 &&
7691
- typeof this.options
7692
- .minimumInViewportHeight === 'number'
7733
+ // When dragging bottom handle, constrain height to container height
7734
+ const minHeight = top < 0 &&
7735
+ typeof this.options.minimumInViewportHeight ===
7736
+ 'number'
7693
7737
  ? -top +
7694
7738
  this.options.minimumInViewportHeight
7695
- : Overlay.MINIMUM_HEIGHT, Number.MAX_VALUE);
7739
+ : Overlay.MINIMUM_HEIGHT;
7740
+ const maxHeight = containerRect.height - Math.max(0, top);
7741
+ height = clamp(y - top, minHeight, maxHeight);
7696
7742
  bottom = containerRect.height - top - height;
7697
7743
  };
7698
7744
  const moveLeft = () => {
7699
- left = clamp(x, -Number.MAX_VALUE, startPosition.originalX +
7745
+ const maxLeft = startPosition.originalX +
7700
7746
  startPosition.originalWidth >
7701
7747
  containerRect.width
7702
- ? this.getMinimumWidth(containerRect.width)
7748
+ ? Math.max(0, containerRect.width -
7749
+ Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
7703
7750
  : Math.max(0, startPosition.originalX +
7704
7751
  startPosition.originalWidth -
7705
- Overlay.MINIMUM_WIDTH));
7752
+ Overlay.MINIMUM_WIDTH);
7753
+ left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
7706
7754
  width =
7707
7755
  startPosition.originalX +
7708
7756
  startPosition.originalWidth -
@@ -7713,12 +7761,15 @@ class Overlay extends CompositeDisposable {
7713
7761
  left =
7714
7762
  startPosition.originalX -
7715
7763
  startPosition.originalWidth;
7716
- width = clamp(x - left, left < 0 &&
7717
- typeof this.options
7718
- .minimumInViewportWidth === 'number'
7764
+ // When dragging right handle, constrain width to container width
7765
+ const minWidth = left < 0 &&
7766
+ typeof this.options.minimumInViewportWidth ===
7767
+ 'number'
7719
7768
  ? -left +
7720
7769
  this.options.minimumInViewportWidth
7721
- : Overlay.MINIMUM_WIDTH, Number.MAX_VALUE);
7770
+ : Overlay.MINIMUM_WIDTH;
7771
+ const maxWidth = containerRect.width - Math.max(0, left);
7772
+ width = clamp(x - left, minWidth, maxWidth);
7722
7773
  right = containerRect.width - left - width;
7723
7774
  };
7724
7775
  switch (direction) {
@@ -8548,7 +8599,7 @@ class DockviewComponent extends BaseGrid {
8548
8599
  // option only available when no panels in primary grid
8549
8600
  return;
8550
8601
  }
8551
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
8602
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
8552
8603
  kind: 'edge',
8553
8604
  panel: undefined,
8554
8605
  api: this._api,
@@ -8962,7 +9013,7 @@ class DockviewComponent extends BaseGrid {
8962
9013
  : (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
8963
9014
  const el = group.element.querySelector('.dv-void-container');
8964
9015
  if (!el) {
8965
- throw new Error('failed to find drag handle');
9016
+ throw new Error('dockview: failed to find drag handle');
8966
9017
  }
8967
9018
  overlay.setupDrag(el, {
8968
9019
  inDragMode: typeof (options === null || options === void 0 ? void 0 : options.inDragMode) === 'boolean'
@@ -9034,7 +9085,7 @@ class DockviewComponent extends BaseGrid {
9034
9085
  case 'right':
9035
9086
  return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
9036
9087
  default:
9037
- throw new Error(`unsupported position ${position}`);
9088
+ throw new Error(`dockview: unsupported position ${position}`);
9038
9089
  }
9039
9090
  }
9040
9091
  updateOptions(options) {
@@ -9180,15 +9231,48 @@ class DockviewComponent extends BaseGrid {
9180
9231
  }
9181
9232
  return result;
9182
9233
  }
9183
- fromJSON(data) {
9234
+ fromJSON(data, options) {
9184
9235
  var _a, _b;
9236
+ const existingPanels = new Map();
9237
+ let tempGroup;
9238
+ if (options === null || options === void 0 ? void 0 : options.reuseExistingPanels) {
9239
+ /**
9240
+ * What are we doing here?
9241
+ *
9242
+ * 1. Create a temporary group to hold any panels that currently exist and that also exist in the new layout
9243
+ * 2. Remove that temporary group from the group mapping so that it doesn't get cleared when we clear the layout
9244
+ */
9245
+ tempGroup = this.createGroup();
9246
+ this._groups.delete(tempGroup.api.id);
9247
+ const newPanels = Object.keys(data.panels);
9248
+ for (const panel of this.panels) {
9249
+ if (newPanels.includes(panel.api.id)) {
9250
+ existingPanels.set(panel.api.id, panel);
9251
+ }
9252
+ }
9253
+ this.movingLock(() => {
9254
+ Array.from(existingPanels.values()).forEach((panel) => {
9255
+ this.moveGroupOrPanel({
9256
+ from: {
9257
+ groupId: panel.api.group.api.id,
9258
+ panelId: panel.api.id,
9259
+ },
9260
+ to: {
9261
+ group: tempGroup,
9262
+ position: 'center',
9263
+ },
9264
+ keepEmptyGroups: true,
9265
+ });
9266
+ });
9267
+ });
9268
+ }
9185
9269
  this.clear();
9186
9270
  if (typeof data !== 'object' || data === null) {
9187
- throw new Error('serialized layout must be a non-null object');
9271
+ throw new Error('dockview: serialized layout must be a non-null object');
9188
9272
  }
9189
9273
  const { grid, panels, activeGroup } = data;
9190
9274
  if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
9191
- throw new Error('root must be of type branch');
9275
+ throw new Error('dockview: root must be of type branch');
9192
9276
  }
9193
9277
  try {
9194
9278
  // take note of the existing dimensions
@@ -9197,7 +9281,7 @@ class DockviewComponent extends BaseGrid {
9197
9281
  const createGroupFromSerializedState = (data) => {
9198
9282
  const { id, locked, hideHeader, views, activeView } = data;
9199
9283
  if (typeof id !== 'string') {
9200
- throw new Error('group id must be of type string');
9284
+ throw new Error('dockview: group id must be of type string');
9201
9285
  }
9202
9286
  const group = this.createGroup({
9203
9287
  id,
@@ -9212,17 +9296,38 @@ class DockviewComponent extends BaseGrid {
9212
9296
  * In running this section first we avoid firing lots of 'add' events in the event of a failure
9213
9297
  * due to a corruption of input data.
9214
9298
  */
9215
- const panel = this._deserializer.fromJSON(panels[child], group);
9216
- createdPanels.push(panel);
9299
+ const existingPanel = existingPanels.get(child);
9300
+ if (tempGroup && existingPanel) {
9301
+ this.movingLock(() => {
9302
+ tempGroup.model.removePanel(existingPanel);
9303
+ });
9304
+ createdPanels.push(existingPanel);
9305
+ existingPanel.updateFromStateModel(panels[child]);
9306
+ }
9307
+ else {
9308
+ const panel = this._deserializer.fromJSON(panels[child], group);
9309
+ createdPanels.push(panel);
9310
+ }
9217
9311
  }
9218
9312
  for (let i = 0; i < views.length; i++) {
9219
9313
  const panel = createdPanels[i];
9220
9314
  const isActive = typeof activeView === 'string' &&
9221
9315
  activeView === panel.id;
9222
- group.model.openPanel(panel, {
9223
- skipSetActive: !isActive,
9224
- skipSetGroupActive: true,
9225
- });
9316
+ const hasExisting = existingPanels.has(panel.api.id);
9317
+ if (hasExisting) {
9318
+ this.movingLock(() => {
9319
+ group.model.openPanel(panel, {
9320
+ skipSetActive: !isActive,
9321
+ skipSetGroupActive: true,
9322
+ });
9323
+ });
9324
+ }
9325
+ else {
9326
+ group.model.openPanel(panel, {
9327
+ skipSetActive: !isActive,
9328
+ skipSetGroupActive: true,
9329
+ });
9330
+ }
9226
9331
  }
9227
9332
  if (!group.activePanel && group.panels.length > 0) {
9228
9333
  group.model.openPanel(group.panels[group.panels.length - 1], {
@@ -9261,7 +9366,9 @@ class DockviewComponent extends BaseGrid {
9261
9366
  setTimeout(() => {
9262
9367
  this.addPopoutGroup(group, {
9263
9368
  position: position !== null && position !== void 0 ? position : undefined,
9264
- overridePopoutGroup: gridReferenceGroup ? group : undefined,
9369
+ overridePopoutGroup: gridReferenceGroup
9370
+ ? group
9371
+ : undefined,
9265
9372
  referenceGroup: gridReferenceGroup
9266
9373
  ? this.getPanel(gridReferenceGroup)
9267
9374
  : undefined,
@@ -9347,11 +9454,11 @@ class DockviewComponent extends BaseGrid {
9347
9454
  addPanel(options) {
9348
9455
  var _a, _b;
9349
9456
  if (this.panels.find((_) => _.id === options.id)) {
9350
- throw new Error(`panel with id ${options.id} already exists`);
9457
+ throw new Error(`dockview: panel with id ${options.id} already exists`);
9351
9458
  }
9352
9459
  let referenceGroup;
9353
9460
  if (options.position && options.floating) {
9354
- throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
9461
+ throw new Error('dockview: you can only provide one of: position, floating as arguments to .addPanel(...)');
9355
9462
  }
9356
9463
  const initial = {
9357
9464
  width: options.initialWidth,
@@ -9365,7 +9472,7 @@ class DockviewComponent extends BaseGrid {
9365
9472
  : options.position.referencePanel;
9366
9473
  index = options.position.index;
9367
9474
  if (!referencePanel) {
9368
- throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
9475
+ throw new Error(`dockview: referencePanel '${options.position.referencePanel}' does not exist`);
9369
9476
  }
9370
9477
  referenceGroup = this.findGroup(referencePanel);
9371
9478
  }
@@ -9376,7 +9483,7 @@ class DockviewComponent extends BaseGrid {
9376
9483
  : options.position.referenceGroup;
9377
9484
  index = options.position.index;
9378
9485
  if (!referenceGroup) {
9379
- throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
9486
+ throw new Error(`dockview: referenceGroup '${options.position.referenceGroup}' does not exist`);
9380
9487
  }
9381
9488
  }
9382
9489
  else {
@@ -9488,7 +9595,7 @@ class DockviewComponent extends BaseGrid {
9488
9595
  }) {
9489
9596
  const group = panel.group;
9490
9597
  if (!group) {
9491
- throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
9598
+ throw new Error(`dockview: cannot remove panel ${panel.id}. it's missing a group.`);
9492
9599
  }
9493
9600
  group.model.removePanel(panel, {
9494
9601
  skipSetActiveGroup: options.skipSetActiveGroup,
@@ -9537,11 +9644,11 @@ class DockviewComponent extends BaseGrid {
9537
9644
  ? this.panels.find((panel) => panel.id === options.referencePanel)
9538
9645
  : options.referencePanel;
9539
9646
  if (!referencePanel) {
9540
- throw new Error(`reference panel ${options.referencePanel} does not exist`);
9647
+ throw new Error(`dockview: reference panel ${options.referencePanel} does not exist`);
9541
9648
  }
9542
9649
  referenceGroup = this.findGroup(referencePanel);
9543
9650
  if (!referenceGroup) {
9544
- throw new Error(`reference group for reference panel ${options.referencePanel} does not exist`);
9651
+ throw new Error(`dockview: reference group for reference panel ${options.referencePanel} does not exist`);
9545
9652
  }
9546
9653
  }
9547
9654
  else if (isGroupOptionsWithGroup(options)) {
@@ -9550,7 +9657,7 @@ class DockviewComponent extends BaseGrid {
9550
9657
  ? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
9551
9658
  : options.referenceGroup;
9552
9659
  if (!referenceGroup) {
9553
- throw new Error(`reference group ${options.referenceGroup} does not exist`);
9660
+ throw new Error(`dockview: reference group ${options.referenceGroup} does not exist`);
9554
9661
  }
9555
9662
  }
9556
9663
  else {
@@ -9618,7 +9725,7 @@ class DockviewComponent extends BaseGrid {
9618
9725
  }
9619
9726
  return floatingGroup.group;
9620
9727
  }
9621
- throw new Error('failed to find floating group');
9728
+ throw new Error('dockview: failed to find floating group');
9622
9729
  }
9623
9730
  if (group.api.location.type === 'popout') {
9624
9731
  const selectedGroup = this._popoutGroups.find((_) => _.popoutGroup === group);
@@ -9649,7 +9756,7 @@ class DockviewComponent extends BaseGrid {
9649
9756
  this.updateWatermark();
9650
9757
  return selectedGroup.popoutGroup;
9651
9758
  }
9652
- throw new Error('failed to find popout group');
9759
+ throw new Error('dockview: failed to find popout group');
9653
9760
  }
9654
9761
  const re = super.doRemoveGroup(group, options);
9655
9762
  if (!(options === null || options === void 0 ? void 0 : options.skipActive)) {
@@ -9680,7 +9787,7 @@ class DockviewComponent extends BaseGrid {
9680
9787
  ? (_a = this._groups.get(sourceGroupId)) === null || _a === void 0 ? void 0 : _a.value
9681
9788
  : undefined;
9682
9789
  if (!sourceGroup) {
9683
- throw new Error(`Failed to find group id ${sourceGroupId}`);
9790
+ throw new Error(`dockview: Failed to find group id ${sourceGroupId}`);
9684
9791
  }
9685
9792
  if (sourceItemId === undefined) {
9686
9793
  /**
@@ -9705,9 +9812,9 @@ class DockviewComponent extends BaseGrid {
9705
9812
  skipSetActiveGroup: true,
9706
9813
  }));
9707
9814
  if (!removedPanel) {
9708
- throw new Error(`No panel with id ${sourceItemId}`);
9815
+ throw new Error(`dockview: No panel with id ${sourceItemId}`);
9709
9816
  }
9710
- if (sourceGroup.model.size === 0) {
9817
+ if (!options.keepEmptyGroups && sourceGroup.model.size === 0) {
9711
9818
  // remove the group and do not set a new group as active
9712
9819
  this.doRemoveGroup(sourceGroup, { skipActive: true });
9713
9820
  }
@@ -9717,7 +9824,8 @@ class DockviewComponent extends BaseGrid {
9717
9824
  var _a;
9718
9825
  return destinationGroup.model.openPanel(removedPanel, {
9719
9826
  index: destinationIndex,
9720
- skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) && !isDestinationGroupEmpty,
9827
+ skipSetActive: ((_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false) &&
9828
+ !isDestinationGroupEmpty,
9721
9829
  skipSetGroupActive: true,
9722
9830
  });
9723
9831
  });
@@ -9728,6 +9836,13 @@ class DockviewComponent extends BaseGrid {
9728
9836
  panel: removedPanel,
9729
9837
  from: sourceGroup,
9730
9838
  });
9839
+ /**
9840
+ * Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
9841
+ * With defaultRenderer="always" this results in panel content not showing after move operations.
9842
+ */
9843
+ requestAnimationFrame(() => {
9844
+ this.overlayRenderContainer.updateAllPositions();
9845
+ });
9731
9846
  }
9732
9847
  else {
9733
9848
  /**
@@ -9772,7 +9887,9 @@ class DockviewComponent extends BaseGrid {
9772
9887
  }));
9773
9888
  this.doRemoveGroup(sourceGroup, { skipActive: true });
9774
9889
  const newGroup = this.createGroupAtLocation(targetLocation);
9775
- this.movingLock(() => newGroup.model.openPanel(removedPanel));
9890
+ this.movingLock(() => newGroup.model.openPanel(removedPanel, {
9891
+ skipSetActive: true,
9892
+ }));
9776
9893
  this.doSetGroupAndPanelActive(newGroup);
9777
9894
  this._onDidMovePanel.fire({
9778
9895
  panel: this.getGroupPanel(sourceItemId),
@@ -9805,7 +9922,7 @@ class DockviewComponent extends BaseGrid {
9805
9922
  skipSetActiveGroup: true,
9806
9923
  }));
9807
9924
  if (!removedPanel) {
9808
- throw new Error(`No panel with id ${sourceItemId}`);
9925
+ throw new Error(`dockview: No panel with id ${sourceItemId}`);
9809
9926
  }
9810
9927
  const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
9811
9928
  const group = this.createGroupAtLocation(dropLocation);
@@ -9860,7 +9977,7 @@ class DockviewComponent extends BaseGrid {
9860
9977
  case 'floating': {
9861
9978
  const selectedFloatingGroup = this._floatingGroups.find((x) => x.group === from);
9862
9979
  if (!selectedFloatingGroup) {
9863
- throw new Error('failed to find floating group');
9980
+ throw new Error('dockview: failed to find floating group');
9864
9981
  }
9865
9982
  selectedFloatingGroup.dispose();
9866
9983
  break;
@@ -9868,7 +9985,7 @@ class DockviewComponent extends BaseGrid {
9868
9985
  case 'popout': {
9869
9986
  const selectedPopoutGroup = this._popoutGroups.find((x) => x.popoutGroup === from);
9870
9987
  if (!selectedPopoutGroup) {
9871
- throw new Error('failed to find popout group');
9988
+ throw new Error('dockview: failed to find popout group');
9872
9989
  }
9873
9990
  // Remove from popout groups list to prevent automatic restoration
9874
9991
  const index = this._popoutGroups.indexOf(selectedPopoutGroup);
@@ -11317,12 +11434,19 @@ class AngularRenderer {
11317
11434
  return this._element;
11318
11435
  }
11319
11436
  init(parameters) {
11320
- this.render(parameters);
11437
+ // If already initialized, just update the parameters
11438
+ if (this.componentRef) {
11439
+ this.update(parameters);
11440
+ }
11441
+ else {
11442
+ this.render(parameters);
11443
+ }
11321
11444
  }
11322
11445
  update(params) {
11323
11446
  if (this.componentRef) {
11324
11447
  Object.keys(params).forEach(key => {
11325
- if (this.componentRef.instance.hasOwnProperty(key)) {
11448
+ // Use 'in' operator instead of hasOwnProperty to support getter/setter properties
11449
+ if (key in this.componentRef.instance) {
11326
11450
  this.componentRef.instance[key] = params[key];
11327
11451
  }
11328
11452
  });
@@ -11338,7 +11462,8 @@ class AngularRenderer {
11338
11462
  });
11339
11463
  // Set initial parameters
11340
11464
  Object.keys(parameters).forEach(key => {
11341
- if (this.componentRef.instance.hasOwnProperty(key)) {
11465
+ // Use 'in' operator instead of hasOwnProperty to support getter/setter properties
11466
+ if (key in this.componentRef.instance) {
11342
11467
  this.componentRef.instance[key] = parameters[key];
11343
11468
  }
11344
11469
  });
@@ -11509,6 +11634,7 @@ class AngularFrameworkComponentFactory {
11509
11634
  injector: this.injector,
11510
11635
  environmentInjector: this.environmentInjector
11511
11636
  });
11637
+ // Initialize with empty props - dockview-core will call init() again with actual IGroupHeaderProps
11512
11638
  renderer.init({});
11513
11639
  return renderer;
11514
11640
  }
@@ -12566,6 +12692,7 @@ __decorate([
12566
12692
  DockviewAngularComponent = __decorate([
12567
12693
  Component({
12568
12694
  selector: 'dv-dockview',
12695
+ standalone: true,
12569
12696
  template: '<div #dockviewContainer class="dockview-container"></div>',
12570
12697
  styles: [`
12571
12698
  :host {
@@ -12573,7 +12700,7 @@ DockviewAngularComponent = __decorate([
12573
12700
  width: 100%;
12574
12701
  height: 100%;
12575
12702
  }
12576
-
12703
+
12577
12704
  .dockview-container {
12578
12705
  width: 100%;
12579
12706
  height: 100%;
@@ -12689,6 +12816,7 @@ __decorate([
12689
12816
  GridviewAngularComponent = __decorate([
12690
12817
  Component({
12691
12818
  selector: 'dv-gridview',
12819
+ standalone: true,
12692
12820
  template: '<div #gridviewContainer class="gridview-container"></div>',
12693
12821
  styles: [`
12694
12822
  :host {
@@ -12696,7 +12824,7 @@ GridviewAngularComponent = __decorate([
12696
12824
  width: 100%;
12697
12825
  height: 100%;
12698
12826
  }
12699
-
12827
+
12700
12828
  .gridview-container {
12701
12829
  width: 100%;
12702
12830
  height: 100%;
@@ -12837,6 +12965,7 @@ __decorate([
12837
12965
  PaneviewAngularComponent = __decorate([
12838
12966
  Component({
12839
12967
  selector: 'dv-paneview',
12968
+ standalone: true,
12840
12969
  template: '<div #paneviewContainer class="paneview-container"></div>',
12841
12970
  styles: [`
12842
12971
  :host {
@@ -12844,7 +12973,7 @@ PaneviewAngularComponent = __decorate([
12844
12973
  width: 100%;
12845
12974
  height: 100%;
12846
12975
  }
12847
-
12976
+
12848
12977
  .paneview-container {
12849
12978
  width: 100%;
12850
12979
  height: 100%;
@@ -12960,6 +13089,7 @@ __decorate([
12960
13089
  SplitviewAngularComponent = __decorate([
12961
13090
  Component({
12962
13091
  selector: 'dv-splitview',
13092
+ standalone: true,
12963
13093
  template: '<div #splitviewContainer class="splitview-container"></div>',
12964
13094
  styles: [`
12965
13095
  :host {
@@ -12967,7 +13097,7 @@ SplitviewAngularComponent = __decorate([
12967
13097
  width: 100%;
12968
13098
  height: 100%;
12969
13099
  }
12970
-
13100
+
12971
13101
  .splitview-container {
12972
13102
  width: 100%;
12973
13103
  height: 100%;
@@ -12981,15 +13111,13 @@ let DockviewAngularModule = class DockviewAngularModule {
12981
13111
  };
12982
13112
  DockviewAngularModule = __decorate([
12983
13113
  NgModule({
12984
- declarations: [
13114
+ imports: [
13115
+ CommonModule,
12985
13116
  DockviewAngularComponent,
12986
13117
  GridviewAngularComponent,
12987
13118
  PaneviewAngularComponent,
12988
13119
  SplitviewAngularComponent
12989
13120
  ],
12990
- imports: [
12991
- CommonModule
12992
- ],
12993
13121
  exports: [
12994
13122
  DockviewAngularComponent,
12995
13123
  GridviewAngularComponent,
@@ -12999,5 +13127,5 @@ DockviewAngularModule = __decorate([
12999
13127
  })
13000
13128
  ], DockviewAngularModule);
13001
13129
 
13002
- export { AngularDisposable, AngularFrameworkComponentFactory, AngularLifecycleManager, AngularRenderer, BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewAngularComponent, DockviewAngularModule, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DraggablePaneviewPanel, Gridview, GridviewAngularComponent, GridviewApi, GridviewComponent, GridviewPanel, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewAngularComponent, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewUnhandledDragOverEvent, SashState, Sizing, Splitview, SplitviewAngularComponent, SplitviewApi, SplitviewComponent, SplitviewPanel, Tab, createAngularDisposable, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, orthogonal, positionToDirection, themeAbyss, themeAbyssSpaced, themeDark, themeDracula, themeLight, themeLightSpaced, themeReplit, themeVisualStudio, toTarget };
13130
+ export { AngularDisposable, AngularFrameworkComponentFactory, AngularLifecycleManager, AngularRenderer, BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewAngularComponent, DockviewAngularModule, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DockviewWillShowOverlayLocationEvent, DraggablePaneviewPanel, Gridview, GridviewAngularComponent, GridviewApi, GridviewComponent, GridviewPanel, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewAngularComponent, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewUnhandledDragOverEvent, SashState, Sizing, Splitview, SplitviewAngularComponent, SplitviewApi, SplitviewComponent, SplitviewPanel, Tab, createAngularDisposable, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, orthogonal, positionToDirection, themeAbyss, themeAbyssSpaced, themeDark, themeDracula, themeLight, themeLightSpaced, themeReplit, themeVisualStudio, toTarget };
13003
13131
  //# sourceMappingURL=dockview-angular.esm.js.map