dockview 1.4.1 → 1.4.2

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 1.4.1
3
+ * @version 1.4.2
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -2391,13 +2391,13 @@
2391
2391
  get onDidLayoutChange() {
2392
2392
  return this.component.onDidLayoutChange;
2393
2393
  }
2394
- get onDidAddGroup() {
2394
+ get onDidAddPanel() {
2395
2395
  return this.component.onDidAddGroup;
2396
2396
  }
2397
- get onDidRemoveGroup() {
2397
+ get onDidRemovePanel() {
2398
2398
  return this.component.onDidRemoveGroup;
2399
2399
  }
2400
- get onDidActiveGroupChange() {
2400
+ get onDidActivePanelChange() {
2401
2401
  return this.component.onDidActiveGroupChange;
2402
2402
  }
2403
2403
  get onDidLayoutFromJSON() {
@@ -2680,6 +2680,7 @@
2680
2680
  this._element.className = 'tab';
2681
2681
  this._element.tabIndex = 0;
2682
2682
  this._element.draggable = true;
2683
+ toggleClass(this.element, 'inactive-tab', true);
2683
2684
  this.addDisposables(new (class Handler extends DragHandler {
2684
2685
  constructor() {
2685
2686
  super(...arguments);
@@ -2756,7 +2757,6 @@
2756
2757
  this.group = group;
2757
2758
  this.tabs = [];
2758
2759
  this.selectedIndex = -1;
2759
- this.active = false;
2760
2760
  this._hidden = false;
2761
2761
  this._onDrop = new Emitter();
2762
2762
  this.onDrop = this._onDrop.event;
@@ -2860,8 +2860,8 @@
2860
2860
  indexOf(id) {
2861
2861
  return this.tabs.findIndex((tab) => tab.value.panelId === id);
2862
2862
  }
2863
- setActive(isGroupActive) {
2864
- this.active = isGroupActive;
2863
+ setActive(_isGroupActive) {
2864
+ // noop
2865
2865
  }
2866
2866
  addTab(tab, index = this.tabs.length) {
2867
2867
  if (index < 0 || index > this.tabs.length) {
@@ -2922,7 +2922,6 @@
2922
2922
  }));
2923
2923
  const value = { value: tabToAdd, disposable };
2924
2924
  this.addTab(value, index);
2925
- this.activePanel = panel;
2926
2925
  }
2927
2926
  closePanel(panel) {
2928
2927
  this.delete(panel.id);
@@ -3146,7 +3145,7 @@
3146
3145
  this.accessor.doSetGroupActive(this.parent);
3147
3146
  return;
3148
3147
  }
3149
- this.doAddPanel(panel, options.index);
3148
+ this.doAddPanel(panel, options.index, skipSetActive);
3150
3149
  if (!skipSetActive) {
3151
3150
  this.doSetActivePanel(panel);
3152
3151
  this.accessor.doSetGroupActive(this.parent, !!options.skipFocus);
@@ -3252,11 +3251,13 @@
3252
3251
  panel,
3253
3252
  });
3254
3253
  }
3255
- doAddPanel(panel, index = this.panels.length) {
3254
+ doAddPanel(panel, index = this.panels.length, skipSetActive = false) {
3256
3255
  const existingPanel = this._panels.indexOf(panel);
3257
3256
  const hasExistingPanel = existingPanel > -1;
3258
3257
  this.tabsContainer.openPanel(panel, index);
3259
- this.contentContainer.openPanel(panel);
3258
+ if (!skipSetActive) {
3259
+ this.contentContainer.openPanel(panel);
3260
+ }
3260
3261
  this.tabsContainer.show();
3261
3262
  this.contentContainer.show();
3262
3263
  if (hasExistingPanel) {
@@ -77,9 +77,9 @@ export declare class GridviewApi implements CommonApi<SerializedGridview> {
77
77
  get width(): number;
78
78
  get height(): number;
79
79
  get onDidLayoutChange(): Event<void>;
80
- get onDidAddGroup(): Event<IGridviewPanel>;
81
- get onDidRemoveGroup(): Event<IGridviewPanel>;
82
- get onDidActiveGroupChange(): Event<IGridviewPanel | undefined>;
80
+ get onDidAddPanel(): Event<IGridviewPanel>;
81
+ get onDidRemovePanel(): Event<IGridviewPanel>;
82
+ get onDidActivePanelChange(): Event<IGridviewPanel | undefined>;
83
83
  get onDidLayoutFromJSON(): Event<void>;
84
84
  get panels(): IGridviewPanel[];
85
85
  get orientation(): Orientation;
@@ -156,13 +156,13 @@ export class GridviewApi {
156
156
  get onDidLayoutChange() {
157
157
  return this.component.onDidLayoutChange;
158
158
  }
159
- get onDidAddGroup() {
159
+ get onDidAddPanel() {
160
160
  return this.component.onDidAddGroup;
161
161
  }
162
- get onDidRemoveGroup() {
162
+ get onDidRemovePanel() {
163
163
  return this.component.onDidRemoveGroup;
164
164
  }
165
- get onDidActiveGroupChange() {
165
+ get onDidActivePanelChange() {
166
166
  return this.component.onDidActiveGroupChange;
167
167
  }
168
168
  get onDidLayoutFromJSON() {
@@ -217,7 +217,7 @@ export class Groupview extends CompositeDisposable {
217
217
  this.accessor.doSetGroupActive(this.parent);
218
218
  return;
219
219
  }
220
- this.doAddPanel(panel, options.index);
220
+ this.doAddPanel(panel, options.index, skipSetActive);
221
221
  if (!skipSetActive) {
222
222
  this.doSetActivePanel(panel);
223
223
  this.accessor.doSetGroupActive(this.parent, !!options.skipFocus);
@@ -323,11 +323,13 @@ export class Groupview extends CompositeDisposable {
323
323
  panel,
324
324
  });
325
325
  }
326
- doAddPanel(panel, index = this.panels.length) {
326
+ doAddPanel(panel, index = this.panels.length, skipSetActive = false) {
327
327
  const existingPanel = this._panels.indexOf(panel);
328
328
  const hasExistingPanel = existingPanel > -1;
329
329
  this.tabsContainer.openPanel(panel, index);
330
- this.contentContainer.openPanel(panel);
330
+ if (!skipSetActive) {
331
+ this.contentContainer.openPanel(panel);
332
+ }
331
333
  this.tabsContainer.show();
332
334
  this.contentContainer.show();
333
335
  if (hasExistingPanel) {
@@ -24,6 +24,7 @@ export class Tab extends CompositeDisposable {
24
24
  this._element.className = 'tab';
25
25
  this._element.tabIndex = 0;
26
26
  this._element.draggable = true;
27
+ toggleClass(this.element, 'inactive-tab', true);
27
28
  this.addDisposables(new (class Handler extends DragHandler {
28
29
  constructor() {
29
30
  super(...arguments);
@@ -37,8 +37,6 @@ export declare class TabsContainer extends CompositeDisposable implements ITabsC
37
37
  private readonly voidDropTarget;
38
38
  private tabs;
39
39
  private selectedIndex;
40
- private active;
41
- private activePanel;
42
40
  private actions;
43
41
  private _height;
44
42
  private _hidden;
@@ -60,7 +58,7 @@ export declare class TabsContainer extends CompositeDisposable implements ITabsC
60
58
  constructor(accessor: IDockviewComponent, group: GroupPanel, options: {
61
59
  tabHeight?: number;
62
60
  });
63
- setActive(isGroupActive: boolean): void;
61
+ setActive(_isGroupActive: boolean): void;
64
62
  private addTab;
65
63
  delete(id: string): void;
66
64
  setActivePanel(panel: IDockviewPanel): void;
@@ -12,7 +12,6 @@ export class TabsContainer extends CompositeDisposable {
12
12
  this.group = group;
13
13
  this.tabs = [];
14
14
  this.selectedIndex = -1;
15
- this.active = false;
16
15
  this._hidden = false;
17
16
  this._onDrop = new Emitter();
18
17
  this.onDrop = this._onDrop.event;
@@ -116,8 +115,8 @@ export class TabsContainer extends CompositeDisposable {
116
115
  indexOf(id) {
117
116
  return this.tabs.findIndex((tab) => tab.value.panelId === id);
118
117
  }
119
- setActive(isGroupActive) {
120
- this.active = isGroupActive;
118
+ setActive(_isGroupActive) {
119
+ // noop
121
120
  }
122
121
  addTab(tab, index = this.tabs.length) {
123
122
  if (index < 0 || index > this.tabs.length) {
@@ -178,7 +177,6 @@ export class TabsContainer extends CompositeDisposable {
178
177
  }));
179
178
  const value = { value: tabToAdd, disposable };
180
179
  this.addTab(value, index);
181
- this.activePanel = panel;
182
180
  }
183
181
  closePanel(panel) {
184
182
  this.delete(panel.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dockview",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Zero dependency layout manager supporting tabs, grids and splitviews with ReactJS support",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",
@@ -74,5 +74,5 @@
74
74
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
75
75
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
76
76
  },
77
- "gitHead": "ba2976dd74eeb664dea846690c89ccf8961cdd75"
77
+ "gitHead": "5fba8814a8a510ca1bdc26d9744bf3cf4e29cf41"
78
78
  }