dockview 2.1.4 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/cjs/dockview/dockview.d.ts +0 -1
  2. package/dist/cjs/dockview/dockview.js +3 -3
  3. package/dist/cjs/dockview/headerActionsRenderer.js +1 -1
  4. package/dist/cjs/dockview/reactContentPart.js +1 -1
  5. package/dist/cjs/dockview/reactHeaderPart.js +1 -1
  6. package/dist/cjs/dockview/reactWatermarkPart.js +1 -1
  7. package/dist/cjs/gridview/gridview.d.ts +2 -7
  8. package/dist/cjs/gridview/gridview.js +47 -20
  9. package/dist/cjs/paneview/paneview.d.ts +2 -6
  10. package/dist/cjs/paneview/paneview.js +54 -36
  11. package/dist/cjs/paneview/view.d.ts +2 -2
  12. package/dist/cjs/splitview/splitview.d.ts +2 -7
  13. package/dist/cjs/splitview/splitview.js +52 -20
  14. package/dist/dockview.amd.js +288 -240
  15. package/dist/dockview.amd.js.map +1 -1
  16. package/dist/dockview.amd.min.js +2 -2
  17. package/dist/dockview.amd.min.js.map +1 -1
  18. package/dist/dockview.amd.min.noStyle.js +2 -2
  19. package/dist/dockview.amd.min.noStyle.js.map +1 -1
  20. package/dist/dockview.amd.noStyle.js +288 -240
  21. package/dist/dockview.amd.noStyle.js.map +1 -1
  22. package/dist/dockview.cjs.js +288 -240
  23. package/dist/dockview.cjs.js.map +1 -1
  24. package/dist/dockview.esm.js +284 -240
  25. package/dist/dockview.esm.js.map +1 -1
  26. package/dist/dockview.esm.min.js +2 -2
  27. package/dist/dockview.esm.min.js.map +1 -1
  28. package/dist/dockview.js +288 -240
  29. package/dist/dockview.js.map +1 -1
  30. package/dist/dockview.min.js +2 -2
  31. package/dist/dockview.min.js.map +1 -1
  32. package/dist/dockview.min.noStyle.js +2 -2
  33. package/dist/dockview.min.noStyle.js.map +1 -1
  34. package/dist/dockview.noStyle.js +288 -240
  35. package/dist/dockview.noStyle.js.map +1 -1
  36. package/dist/esm/dockview/dockview.d.ts +0 -1
  37. package/dist/esm/dockview/dockview.js +4 -4
  38. package/dist/esm/dockview/headerActionsRenderer.js +1 -1
  39. package/dist/esm/dockview/reactContentPart.js +1 -1
  40. package/dist/esm/dockview/reactHeaderPart.js +1 -1
  41. package/dist/esm/dockview/reactWatermarkPart.js +1 -1
  42. package/dist/esm/gridview/gridview.d.ts +2 -7
  43. package/dist/esm/gridview/gridview.js +36 -20
  44. package/dist/esm/paneview/paneview.d.ts +2 -6
  45. package/dist/esm/paneview/paneview.js +53 -33
  46. package/dist/esm/paneview/view.d.ts +2 -2
  47. package/dist/esm/splitview/splitview.d.ts +2 -7
  48. package/dist/esm/splitview/splitview.js +41 -20
  49. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 2.1.4
3
+ * @version 3.0.1
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -103,6 +103,17 @@
103
103
  this._defaultPrevented = true;
104
104
  }
105
105
  }
106
+ class AcceptableEvent {
107
+ constructor() {
108
+ this._isAccepted = false;
109
+ }
110
+ get isAccepted() {
111
+ return this._isAccepted;
112
+ }
113
+ accept() {
114
+ this._isAccepted = true;
115
+ }
116
+ }
106
117
  class LeakageMonitor {
107
118
  constructor() {
108
119
  this.events = new Map();
@@ -1494,6 +1505,23 @@
1494
1505
  }
1495
1506
  }
1496
1507
 
1508
+ const PROPERTY_KEYS_SPLITVIEW = (() => {
1509
+ /**
1510
+ * by readong the keys from an empty value object TypeScript will error
1511
+ * when we add or remove new properties to `DockviewOptions`
1512
+ */
1513
+ const properties = {
1514
+ orientation: undefined,
1515
+ descriptor: undefined,
1516
+ proportionalLayout: undefined,
1517
+ styles: undefined,
1518
+ margin: undefined,
1519
+ disableAutoResizing: undefined,
1520
+ className: undefined,
1521
+ };
1522
+ return Object.keys(properties);
1523
+ })();
1524
+
1497
1525
  class Paneview extends CompositeDisposable {
1498
1526
  get onDidAddView() {
1499
1527
  return this.splitview.onDidAddView;
@@ -2623,6 +2651,21 @@
2623
2651
  }
2624
2652
  }
2625
2653
 
2654
+ const PROPERTY_KEYS_GRIDVIEW = (() => {
2655
+ /**
2656
+ * by readong the keys from an empty value object TypeScript will error
2657
+ * when we add or remove new properties to `DockviewOptions`
2658
+ */
2659
+ const properties = {
2660
+ disableAutoResizing: undefined,
2661
+ proportionalLayout: undefined,
2662
+ orientation: undefined,
2663
+ hideBorders: undefined,
2664
+ className: undefined,
2665
+ };
2666
+ return Object.keys(properties);
2667
+ })();
2668
+
2626
2669
  class Resizable extends CompositeDisposable {
2627
2670
  get element() {
2628
2671
  return this._element;
@@ -2732,7 +2775,7 @@
2732
2775
  }
2733
2776
  constructor(parentElement, options) {
2734
2777
  var _a;
2735
- super(document.createElement('div'), options.disableAutoResizing);
2778
+ super(parentElement, options.disableAutoResizing);
2736
2779
  this._id = nextLayoutId$1.next();
2737
2780
  this._groups = new Map();
2738
2781
  this._onDidRemove = new Emitter();
@@ -2751,7 +2794,6 @@
2751
2794
  this.element.style.width = '100%';
2752
2795
  this._classNames = new Classnames(this.element);
2753
2796
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
2754
- parentElement.appendChild(this.element);
2755
2797
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
2756
2798
  this.gridview.locked = !!options.locked;
2757
2799
  this.element.appendChild(this.gridview.element);
@@ -3100,15 +3142,10 @@
3100
3142
  * Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
3101
3143
  */
3102
3144
  get onDidDrop() {
3103
- const emitter = new Emitter();
3104
- const disposable = this.component.onDidDrop((e) => {
3105
- emitter.fire(Object.assign(Object.assign({}, e), { api: this }));
3106
- });
3107
- emitter.dispose = () => {
3108
- disposable.dispose();
3109
- emitter.dispose();
3110
- };
3111
- return emitter.event;
3145
+ return this.component.onDidDrop;
3146
+ }
3147
+ get onUnhandledDragOverEvent() {
3148
+ return this.component.onUnhandledDragOverEvent;
3112
3149
  }
3113
3150
  constructor(component) {
3114
3151
  this.component = component;
@@ -4035,6 +4072,28 @@
4035
4072
  return 'center';
4036
4073
  }
4037
4074
 
4075
+ const PROPERTY_KEYS_PANEVIEW = (() => {
4076
+ /**
4077
+ * by readong the keys from an empty value object TypeScript will error
4078
+ * when we add or remove new properties to `DockviewOptions`
4079
+ */
4080
+ const properties = {
4081
+ disableAutoResizing: undefined,
4082
+ disableDnd: undefined,
4083
+ className: undefined,
4084
+ };
4085
+ return Object.keys(properties);
4086
+ })();
4087
+ class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
4088
+ constructor(nativeEvent, position, getData, panel) {
4089
+ super();
4090
+ this.nativeEvent = nativeEvent;
4091
+ this.position = position;
4092
+ this.getData = getData;
4093
+ this.panel = panel;
4094
+ }
4095
+ }
4096
+
4038
4097
  class WillFocusEvent extends DockviewEvent {
4039
4098
  constructor() {
4040
4099
  super();
@@ -4458,6 +4517,9 @@
4458
4517
  this.accessor = accessor;
4459
4518
  this._onDidDrop = new Emitter();
4460
4519
  this.onDidDrop = this._onDidDrop.event;
4520
+ this._onUnhandledDragOverEvent = new Emitter();
4521
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
4522
+ this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
4461
4523
  if (!disableDnd) {
4462
4524
  this.initDragFeatures();
4463
4525
  }
@@ -4484,7 +4546,7 @@
4484
4546
  overlayModel: {
4485
4547
  activationSize: { type: 'percentage', value: 50 },
4486
4548
  },
4487
- canDisplayOverlay: (event) => {
4549
+ canDisplayOverlay: (event, position) => {
4488
4550
  const data = getPaneData();
4489
4551
  if (data) {
4490
4552
  if (data.paneId !== this.id &&
@@ -4492,14 +4554,9 @@
4492
4554
  return true;
4493
4555
  }
4494
4556
  }
4495
- if (this.accessor.options.showDndOverlay) {
4496
- return this.accessor.options.showDndOverlay({
4497
- nativeEvent: event,
4498
- getData: getPaneData,
4499
- panel: this,
4500
- });
4501
- }
4502
- return false;
4557
+ const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
4558
+ this._onUnhandledDragOverEvent.fire(firedEvent);
4559
+ return firedEvent.isAccepted;
4503
4560
  },
4504
4561
  });
4505
4562
  this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
@@ -4954,15 +5011,7 @@
4954
5011
  this._element.appendChild(this.leftActionsContainer);
4955
5012
  this._element.appendChild(this.voidContainer.element);
4956
5013
  this._element.appendChild(this.rightActionsContainer);
4957
- this.addDisposables(this.accessor.onDidAddPanel((e) => {
4958
- if (e.api.group === this.group) {
4959
- toggleClass(this._element, 'dv-single-tab', this.size === 1);
4960
- }
4961
- }), this.accessor.onDidRemovePanel((e) => {
4962
- if (e.api.group === this.group) {
4963
- toggleClass(this._element, 'dv-single-tab', this.size === 1);
4964
- }
4965
- }), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
5014
+ this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
4966
5015
  this._onGroupDragStart.fire({
4967
5016
  nativeEvent: event,
4968
5017
  group: this.group,
@@ -5007,20 +5056,6 @@
5007
5056
  setActive(_isGroupActive) {
5008
5057
  // noop
5009
5058
  }
5010
- addTab(tab, index = this.tabs.length) {
5011
- if (index < 0 || index > this.tabs.length) {
5012
- throw new Error('invalid location');
5013
- }
5014
- this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
5015
- this.tabs = [
5016
- ...this.tabs.slice(0, index),
5017
- tab,
5018
- ...this.tabs.slice(index),
5019
- ];
5020
- if (this.selectedIndex < 0) {
5021
- this.selectedIndex = index;
5022
- }
5023
- }
5024
5059
  delete(id) {
5025
5060
  const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
5026
5061
  const tabToRemove = this.tabs.splice(index, 1)[0];
@@ -5028,6 +5063,7 @@
5028
5063
  disposable.dispose();
5029
5064
  value.dispose();
5030
5065
  value.element.remove();
5066
+ this.updateClassnames();
5031
5067
  }
5032
5068
  setActivePanel(panel) {
5033
5069
  this.tabs.forEach((tab) => {
@@ -5096,25 +5132,37 @@
5096
5132
  }
5097
5133
  this.tabs = [];
5098
5134
  }
5135
+ addTab(tab, index = this.tabs.length) {
5136
+ if (index < 0 || index > this.tabs.length) {
5137
+ throw new Error('invalid location');
5138
+ }
5139
+ this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
5140
+ this.tabs = [
5141
+ ...this.tabs.slice(0, index),
5142
+ tab,
5143
+ ...this.tabs.slice(index),
5144
+ ];
5145
+ if (this.selectedIndex < 0) {
5146
+ this.selectedIndex = index;
5147
+ }
5148
+ this.updateClassnames();
5149
+ }
5150
+ updateClassnames() {
5151
+ toggleClass(this._element, 'dv-single-tab', this.size === 1);
5152
+ }
5099
5153
  }
5100
5154
 
5101
- class DockviewUnhandledDragOverEvent {
5102
- get isAccepted() {
5103
- return this._isAccepted;
5104
- }
5155
+ class DockviewUnhandledDragOverEvent extends AcceptableEvent {
5105
5156
  constructor(nativeEvent, target, position, getData, group) {
5157
+ super();
5106
5158
  this.nativeEvent = nativeEvent;
5107
5159
  this.target = target;
5108
5160
  this.position = position;
5109
5161
  this.getData = getData;
5110
5162
  this.group = group;
5111
- this._isAccepted = false;
5112
- }
5113
- accept() {
5114
- this._isAccepted = true;
5115
5163
  }
5116
5164
  }
5117
- const PROPERTY_KEYS = (() => {
5165
+ const PROPERTY_KEYS_DOCKVIEW = (() => {
5118
5166
  /**
5119
5167
  * by readong the keys from an empty value object TypeScript will error
5120
5168
  * when we add or remove new properties to `DockviewOptions`
@@ -8960,31 +9008,6 @@
8960
9008
  }
8961
9009
  }
8962
9010
 
8963
- function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
8964
- const Component = typeof componentName === 'string'
8965
- ? components[componentName]
8966
- : undefined;
8967
- const FrameworkComponent = typeof componentName === 'string'
8968
- ? frameworkComponents[componentName]
8969
- : undefined;
8970
- if (Component && FrameworkComponent) {
8971
- throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
8972
- }
8973
- if (FrameworkComponent) {
8974
- if (!createFrameworkComponent) {
8975
- throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
8976
- }
8977
- return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
8978
- }
8979
- if (!Component) {
8980
- if (fallback) {
8981
- return fallback();
8982
- }
8983
- throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
8984
- }
8985
- return new Component(id, componentName);
8986
- }
8987
-
8988
9011
  class GridviewComponent extends BaseGrid {
8989
9012
  get orientation() {
8990
9013
  return this.gridview.orientation;
@@ -9002,10 +9025,13 @@
9002
9025
  this._deserializer = value;
9003
9026
  }
9004
9027
  constructor(parentElement, options) {
9028
+ var _a;
9005
9029
  super(parentElement, {
9006
- proportionalLayout: options.proportionalLayout,
9030
+ proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9007
9031
  orientation: options.orientation,
9008
- styles: options.styles,
9032
+ styles: options.hideBorders
9033
+ ? { separatorBorder: 'transparent' }
9034
+ : undefined,
9009
9035
  disableAutoResizing: options.disableAutoResizing,
9010
9036
  className: options.className,
9011
9037
  });
@@ -9025,12 +9051,6 @@
9025
9051
  }), this.onDidActiveChange((event) => {
9026
9052
  this._onDidActiveGroupChange.fire(event);
9027
9053
  }));
9028
- if (!this.options.components) {
9029
- this.options.components = {};
9030
- }
9031
- if (!this.options.frameworkComponents) {
9032
- this.options.frameworkComponents = {};
9033
- }
9034
9054
  }
9035
9055
  updateOptions(options) {
9036
9056
  super.updateOptions(options);
@@ -9080,14 +9100,11 @@
9080
9100
  const height = this.height;
9081
9101
  this.gridview.deserialize(grid, {
9082
9102
  fromJSON: (node) => {
9083
- var _a, _b;
9084
9103
  const { data } = node;
9085
- const view = createComponent(data.id, data.component, (_a = this.options.components) !== null && _a !== void 0 ? _a : {}, (_b = this.options.frameworkComponents) !== null && _b !== void 0 ? _b : {}, this.options.frameworkComponentFactory
9086
- ? {
9087
- createComponent: this.options.frameworkComponentFactory
9088
- .createComponent,
9089
- }
9090
- : undefined);
9104
+ const view = this.options.createComponent({
9105
+ id: data.id,
9106
+ name: data.component,
9107
+ });
9091
9108
  queue.push(() => view.init({
9092
9109
  params: data.params,
9093
9110
  minimumWidth: data.minimumWidth,
@@ -9165,7 +9182,7 @@
9165
9182
  this.doAddGroup(removedPanel, relativeLocation, options.size);
9166
9183
  }
9167
9184
  addPanel(options) {
9168
- var _a, _b, _c, _d, _e, _f;
9185
+ var _a, _b, _c, _d;
9169
9186
  let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
9170
9187
  if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
9171
9188
  const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
@@ -9181,14 +9198,12 @@
9181
9198
  relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
9182
9199
  }
9183
9200
  }
9184
- const view = createComponent(options.id, options.component, (_d = this.options.components) !== null && _d !== void 0 ? _d : {}, (_e = this.options.frameworkComponents) !== null && _e !== void 0 ? _e : {}, this.options.frameworkComponentFactory
9185
- ? {
9186
- createComponent: this.options.frameworkComponentFactory
9187
- .createComponent,
9188
- }
9189
- : undefined);
9201
+ const view = this.options.createComponent({
9202
+ id: options.id,
9203
+ name: options.component,
9204
+ });
9190
9205
  view.init({
9191
- params: (_f = options.params) !== null && _f !== void 0 ? _f : {},
9206
+ params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9192
9207
  minimumWidth: options.minimumWidth,
9193
9208
  maximumWidth: options.maximumWidth,
9194
9209
  minimumHeight: options.minimumHeight,
@@ -9316,12 +9331,6 @@
9316
9331
  this._classNames = new Classnames(this.element);
9317
9332
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9318
9333
  this._options = options;
9319
- if (!options.components) {
9320
- options.components = {};
9321
- }
9322
- if (!options.frameworkComponents) {
9323
- options.frameworkComponents = {};
9324
- }
9325
9334
  this.splitview = new Splitview(this.element, options);
9326
9335
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9327
9336
  }
@@ -9384,18 +9393,17 @@
9384
9393
  return this.panels.find((view) => view.id === id);
9385
9394
  }
9386
9395
  addPanel(options) {
9387
- var _a, _b, _c;
9396
+ var _a;
9388
9397
  if (this._panels.has(options.id)) {
9389
9398
  throw new Error(`panel ${options.id} already exists`);
9390
9399
  }
9391
- const view = createComponent(options.id, options.component, (_a = this.options.components) !== null && _a !== void 0 ? _a : {}, (_b = this.options.frameworkComponents) !== null && _b !== void 0 ? _b : {}, this.options.frameworkWrapper
9392
- ? {
9393
- createComponent: this.options.frameworkWrapper.createComponent,
9394
- }
9395
- : undefined);
9400
+ const view = this.options.createComponent({
9401
+ id: options.id,
9402
+ name: options.component,
9403
+ });
9396
9404
  view.orientation = this.splitview.orientation;
9397
9405
  view.init({
9398
- params: (_c = options.params) !== null && _c !== void 0 ? _c : {},
9406
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9399
9407
  minimumSize: options.minimumSize,
9400
9408
  maximumSize: options.maximumSize,
9401
9409
  snap: options.snap,
@@ -9457,17 +9465,14 @@
9457
9465
  descriptor: {
9458
9466
  size,
9459
9467
  views: views.map((view) => {
9460
- var _a, _b;
9461
9468
  const data = view.data;
9462
9469
  if (this._panels.has(data.id)) {
9463
9470
  throw new Error(`panel ${data.id} already exists`);
9464
9471
  }
9465
- const panel = createComponent(data.id, data.component, (_a = this.options.components) !== null && _a !== void 0 ? _a : {}, (_b = this.options.frameworkComponents) !== null && _b !== void 0 ? _b : {}, this.options.frameworkWrapper
9466
- ? {
9467
- createComponent: this.options.frameworkWrapper
9468
- .createComponent,
9469
- }
9470
- : undefined);
9472
+ const panel = this.options.createComponent({
9473
+ id: data.id,
9474
+ name: data.component,
9475
+ });
9471
9476
  queue.push(() => {
9472
9477
  var _a;
9473
9478
  panel.init({
@@ -9650,16 +9655,12 @@
9650
9655
  this.onDidAddView = this._onDidAddView.event;
9651
9656
  this._onDidRemoveView = new Emitter();
9652
9657
  this.onDidRemoveView = this._onDidRemoveView.event;
9653
- this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9658
+ this._onUnhandledDragOverEvent = new Emitter();
9659
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9660
+ this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9654
9661
  this._classNames = new Classnames(this.element);
9655
9662
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9656
9663
  this._options = options;
9657
- if (!options.components) {
9658
- options.components = {};
9659
- }
9660
- if (!options.frameworkComponents) {
9661
- options.frameworkComponents = {};
9662
- }
9663
9664
  this.paneview = new Paneview(this.element, {
9664
9665
  // only allow paneview in the vertical orientation for now
9665
9666
  orientation: exports.Orientation.VERTICAL,
@@ -9684,22 +9685,19 @@
9684
9685
  this._options = Object.assign(Object.assign({}, this.options), options);
9685
9686
  }
9686
9687
  addPanel(options) {
9687
- var _a, _b, _c, _d;
9688
- const body = createComponent(options.id, options.component, (_a = this.options.components) !== null && _a !== void 0 ? _a : {}, (_b = this.options.frameworkComponents) !== null && _b !== void 0 ? _b : {}, this.options.frameworkWrapper
9689
- ? {
9690
- createComponent: this.options.frameworkWrapper.body.createComponent,
9691
- }
9692
- : undefined);
9688
+ var _a;
9689
+ const body = this.options.createComponent({
9690
+ id: options.id,
9691
+ name: options.component,
9692
+ });
9693
9693
  let header;
9694
- if (options.headerComponent) {
9695
- header = createComponent(options.id, options.headerComponent, (_c = this.options.headerComponents) !== null && _c !== void 0 ? _c : {}, this.options.headerframeworkComponents, this.options.frameworkWrapper
9696
- ? {
9697
- createComponent: this.options.frameworkWrapper.header
9698
- .createComponent,
9699
- }
9700
- : undefined);
9694
+ if (options.headerComponent && this.options.createHeaderComponent) {
9695
+ header = this.options.createHeaderComponent({
9696
+ id: options.id,
9697
+ name: options.headerComponent,
9698
+ });
9701
9699
  }
9702
- else {
9700
+ if (!header) {
9703
9701
  header = new DefaultHeader();
9704
9702
  }
9705
9703
  const view = new PaneFramework({
@@ -9717,7 +9715,7 @@
9717
9715
  const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
9718
9716
  const index = typeof options.index === 'number' ? options.index : undefined;
9719
9717
  view.init({
9720
- params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9718
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9721
9719
  minimumBodySize: options.minimumBodySize,
9722
9720
  maximumBodySize: options.maximumBodySize,
9723
9721
  isExpanded: options.isExpanded,
@@ -9782,24 +9780,20 @@
9782
9780
  descriptor: {
9783
9781
  size,
9784
9782
  views: views.map((view) => {
9785
- var _a, _b, _c, _d;
9786
9783
  const data = view.data;
9787
- const body = createComponent(data.id, data.component, (_a = this.options.components) !== null && _a !== void 0 ? _a : {}, (_b = this.options.frameworkComponents) !== null && _b !== void 0 ? _b : {}, this.options.frameworkWrapper
9788
- ? {
9789
- createComponent: this.options.frameworkWrapper.body
9790
- .createComponent,
9791
- }
9792
- : undefined);
9784
+ const body = this.options.createComponent({
9785
+ id: data.id,
9786
+ name: data.component,
9787
+ });
9793
9788
  let header;
9794
- if (data.headerComponent) {
9795
- header = createComponent(data.id, data.headerComponent, (_c = this.options.headerComponents) !== null && _c !== void 0 ? _c : {}, (_d = this.options.headerframeworkComponents) !== null && _d !== void 0 ? _d : {}, this.options.frameworkWrapper
9796
- ? {
9797
- createComponent: this.options.frameworkWrapper.header
9798
- .createComponent,
9799
- }
9800
- : undefined);
9789
+ if (data.headerComponent &&
9790
+ this.options.createHeaderComponent) {
9791
+ header = this.options.createHeaderComponent({
9792
+ id: data.id,
9793
+ name: data.headerComponent,
9794
+ });
9801
9795
  }
9802
- else {
9796
+ if (!header) {
9803
9797
  header = new DefaultHeader();
9804
9798
  }
9805
9799
  const panel = new PaneFramework({
@@ -9847,9 +9841,11 @@
9847
9841
  this.paneview.dispose();
9848
9842
  }
9849
9843
  doAddPanel(panel) {
9850
- const disposable = panel.onDidDrop((event) => {
9844
+ const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
9851
9845
  this._onDidDrop.fire(event);
9852
- });
9846
+ }), panel.onUnhandledDragOverEvent((event) => {
9847
+ this._onUnhandledDragOverEvent.fire(event);
9848
+ }));
9853
9849
  this._viewDisposables.set(panel.id, disposable);
9854
9850
  }
9855
9851
  doRemovePanel(panel) {
@@ -10132,7 +10128,7 @@
10132
10128
  this._onDidBlur = new Emitter();
10133
10129
  this.onDidBlur = this._onDidBlur.event;
10134
10130
  this._element = document.createElement('div');
10135
- this._element.className = 'dockview-react-part';
10131
+ this._element.className = 'dv-react-part';
10136
10132
  this._element.style.height = '100%';
10137
10133
  this._element.style.width = '100%';
10138
10134
  }
@@ -10170,7 +10166,7 @@
10170
10166
  this.component = component;
10171
10167
  this.reactPortalStore = reactPortalStore;
10172
10168
  this._element = document.createElement('div');
10173
- this._element.className = 'dockview-react-part';
10169
+ this._element.className = 'dv-react-part';
10174
10170
  this._element.style.height = '100%';
10175
10171
  this._element.style.width = '100%';
10176
10172
  }
@@ -10206,7 +10202,7 @@
10206
10202
  this.component = component;
10207
10203
  this.reactPortalStore = reactPortalStore;
10208
10204
  this._element = document.createElement('div');
10209
- this._element.className = 'dockview-react-part';
10205
+ this._element.className = 'dv-react-part';
10210
10206
  this._element.style.height = '100%';
10211
10207
  this._element.style.width = '100%';
10212
10208
  }
@@ -10248,7 +10244,7 @@
10248
10244
  this._group = _group;
10249
10245
  this.mutableDisposable = new MutableDisposable();
10250
10246
  this._element = document.createElement('div');
10251
- this._element.className = 'dockview-react-part';
10247
+ this._element.className = 'dv-react-part';
10252
10248
  this._element.style.height = '100%';
10253
10249
  this._element.style.width = '100%';
10254
10250
  }
@@ -10307,8 +10303,8 @@
10307
10303
  : undefined;
10308
10304
  }
10309
10305
  const DEFAULT_REACT_TAB = 'props.defaultTabComponent';
10310
- function extractCoreOptions(props) {
10311
- const coreOptions = PROPERTY_KEYS.reduce((obj, key) => {
10306
+ function extractCoreOptions$3(props) {
10307
+ const coreOptions = PROPERTY_KEYS_DOCKVIEW.reduce((obj, key) => {
10312
10308
  if (key in props) {
10313
10309
  obj[key] = props[key];
10314
10310
  }
@@ -10324,7 +10320,7 @@
10324
10320
  const prevProps = React.useRef({});
10325
10321
  React.useEffect(() => {
10326
10322
  const changes = {};
10327
- PROPERTY_KEYS.forEach((propKey) => {
10323
+ PROPERTY_KEYS_DOCKVIEW.forEach((propKey) => {
10328
10324
  const key = propKey;
10329
10325
  const propValue = props[key];
10330
10326
  if (key in props && propValue !== prevProps.current[key]) {
@@ -10335,7 +10331,7 @@
10335
10331
  dockviewRef.current.updateOptions(changes);
10336
10332
  }
10337
10333
  prevProps.current = props;
10338
- }, PROPERTY_KEYS.map((key) => props[key]));
10334
+ }, PROPERTY_KEYS_DOCKVIEW.map((key) => props[key]));
10339
10335
  React.useEffect(() => {
10340
10336
  var _a;
10341
10337
  if (!domRef.current) {
@@ -10371,7 +10367,7 @@
10371
10367
  ? DEFAULT_REACT_TAB
10372
10368
  : undefined,
10373
10369
  };
10374
- const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
10370
+ const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$3(props)), frameworkOptions));
10375
10371
  const { clientWidth, clientHeight } = domRef.current;
10376
10372
  api.layout(clientWidth, clientHeight);
10377
10373
  if (props.onReady) {
@@ -10582,31 +10578,47 @@
10582
10578
  }
10583
10579
  }
10584
10580
 
10581
+ function extractCoreOptions$2(props) {
10582
+ const coreOptions = PROPERTY_KEYS_SPLITVIEW.reduce((obj, key) => {
10583
+ if (key in props) {
10584
+ obj[key] = props[key];
10585
+ }
10586
+ return obj;
10587
+ }, {});
10588
+ return coreOptions;
10589
+ }
10585
10590
  const SplitviewReact = React.forwardRef((props, ref) => {
10586
10591
  const domRef = React.useRef(null);
10587
10592
  const splitviewRef = React.useRef();
10588
10593
  const [portals, addPortal] = usePortalsLifecycle();
10589
10594
  React.useImperativeHandle(ref, () => domRef.current, []);
10595
+ const prevProps = React.useRef({});
10590
10596
  React.useEffect(() => {
10591
- var _a;
10592
- const api = createSplitview(domRef.current, {
10593
- disableAutoResizing: props.disableAutoResizing,
10594
- orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.HORIZONTAL,
10595
- frameworkComponents: props.components,
10596
- frameworkWrapper: {
10597
- createComponent: (id, componentId, component) => {
10598
- return new ReactPanelView(id, componentId, component, {
10599
- addPortal,
10600
- });
10601
- },
10602
- },
10603
- proportionalLayout: typeof props.proportionalLayout === 'boolean'
10604
- ? props.proportionalLayout
10605
- : true,
10606
- styles: props.hideBorders
10607
- ? { separatorBorder: 'transparent' }
10608
- : undefined,
10597
+ const changes = {};
10598
+ PROPERTY_KEYS_SPLITVIEW.forEach((propKey) => {
10599
+ const key = propKey;
10600
+ const propValue = props[key];
10601
+ if (key in props && propValue !== prevProps.current[key]) {
10602
+ changes[key] = propValue;
10603
+ }
10609
10604
  });
10605
+ if (splitviewRef.current) {
10606
+ splitviewRef.current.updateOptions(changes);
10607
+ }
10608
+ prevProps.current = props;
10609
+ }, PROPERTY_KEYS_SPLITVIEW.map((key) => props[key]));
10610
+ React.useEffect(() => {
10611
+ if (!domRef.current) {
10612
+ return () => {
10613
+ // noop
10614
+ };
10615
+ }
10616
+ const frameworkOptions = {
10617
+ createComponent: (options) => {
10618
+ return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
10619
+ },
10620
+ };
10621
+ const api = createSplitview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$2(props)), frameworkOptions));
10610
10622
  const { clientWidth, clientHeight } = domRef.current;
10611
10623
  api.layout(clientWidth, clientHeight);
10612
10624
  if (props.onReady) {
@@ -10622,7 +10634,9 @@
10622
10634
  return;
10623
10635
  }
10624
10636
  splitviewRef.current.updateOptions({
10625
- frameworkComponents: props.components,
10637
+ createComponent: (options) => {
10638
+ return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
10639
+ },
10626
10640
  });
10627
10641
  }, [props.components]);
10628
10642
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
@@ -10647,36 +10661,47 @@
10647
10661
  }
10648
10662
  }
10649
10663
 
10664
+ function extractCoreOptions$1(props) {
10665
+ const coreOptions = PROPERTY_KEYS_GRIDVIEW.reduce((obj, key) => {
10666
+ if (key in props) {
10667
+ obj[key] = props[key];
10668
+ }
10669
+ return obj;
10670
+ }, {});
10671
+ return coreOptions;
10672
+ }
10650
10673
  const GridviewReact = React.forwardRef((props, ref) => {
10651
10674
  const domRef = React.useRef(null);
10652
10675
  const gridviewRef = React.useRef();
10653
10676
  const [portals, addPortal] = usePortalsLifecycle();
10654
10677
  React.useImperativeHandle(ref, () => domRef.current, []);
10678
+ const prevProps = React.useRef({});
10679
+ React.useEffect(() => {
10680
+ const changes = {};
10681
+ PROPERTY_KEYS_GRIDVIEW.forEach((propKey) => {
10682
+ const key = propKey;
10683
+ const propValue = props[key];
10684
+ if (key in props && propValue !== prevProps.current[key]) {
10685
+ changes[key] = propValue;
10686
+ }
10687
+ });
10688
+ if (gridviewRef.current) {
10689
+ gridviewRef.current.updateOptions(changes);
10690
+ }
10691
+ prevProps.current = props;
10692
+ }, PROPERTY_KEYS_GRIDVIEW.map((key) => props[key]));
10655
10693
  React.useEffect(() => {
10656
- var _a;
10657
10694
  if (!domRef.current) {
10658
10695
  return () => {
10659
10696
  // noop
10660
10697
  };
10661
10698
  }
10662
- const api = createGridview(domRef.current, {
10663
- disableAutoResizing: props.disableAutoResizing,
10664
- proportionalLayout: typeof props.proportionalLayout === 'boolean'
10665
- ? props.proportionalLayout
10666
- : true,
10667
- orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.HORIZONTAL,
10668
- frameworkComponents: props.components,
10669
- frameworkComponentFactory: {
10670
- createComponent: (id, componentId, component) => {
10671
- return new ReactGridPanelView(id, componentId, component, {
10672
- addPortal,
10673
- });
10674
- },
10699
+ const frameworkOptions = {
10700
+ createComponent: (options) => {
10701
+ return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
10675
10702
  },
10676
- styles: props.hideBorders
10677
- ? { separatorBorder: 'transparent' }
10678
- : undefined,
10679
- });
10703
+ };
10704
+ const api = createGridview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$1(props)), frameworkOptions));
10680
10705
  const { clientWidth, clientHeight } = domRef.current;
10681
10706
  api.layout(clientWidth, clientHeight);
10682
10707
  if (props.onReady) {
@@ -10692,7 +10717,9 @@
10692
10717
  return;
10693
10718
  }
10694
10719
  gridviewRef.current.updateOptions({
10695
- frameworkComponents: props.components,
10720
+ createComponent: (options) => {
10721
+ return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
10722
+ },
10696
10723
  });
10697
10724
  }, [props.components]);
10698
10725
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
@@ -10734,32 +10761,52 @@
10734
10761
  }
10735
10762
  }
10736
10763
 
10764
+ function extractCoreOptions(props) {
10765
+ const coreOptions = PROPERTY_KEYS_PANEVIEW.reduce((obj, key) => {
10766
+ if (key in props) {
10767
+ obj[key] = props[key];
10768
+ }
10769
+ return obj;
10770
+ }, {});
10771
+ return coreOptions;
10772
+ }
10737
10773
  const PaneviewReact = React.forwardRef((props, ref) => {
10738
10774
  const domRef = React.useRef(null);
10739
10775
  const paneviewRef = React.useRef();
10740
10776
  const [portals, addPortal] = usePortalsLifecycle();
10741
10777
  React.useImperativeHandle(ref, () => domRef.current, []);
10778
+ const prevProps = React.useRef({});
10742
10779
  React.useEffect(() => {
10743
- const createComponent = (id, _componentId, component) => new PanePanelSection(id, component, {
10744
- addPortal,
10780
+ const changes = {};
10781
+ PROPERTY_KEYS_PANEVIEW.forEach((propKey) => {
10782
+ const key = propKey;
10783
+ const propValue = props[key];
10784
+ if (key in props && propValue !== prevProps.current[key]) {
10785
+ changes[key] = propValue;
10786
+ }
10745
10787
  });
10746
- const api = createPaneview(domRef.current, {
10747
- disableAutoResizing: props.disableAutoResizing,
10748
- frameworkComponents: props.components,
10749
- components: {},
10750
- headerComponents: {},
10751
- disableDnd: props.disableDnd,
10752
- headerframeworkComponents: props.headerComponents,
10753
- frameworkWrapper: {
10754
- header: {
10755
- createComponent,
10756
- },
10757
- body: {
10758
- createComponent,
10759
- },
10788
+ if (paneviewRef.current) {
10789
+ paneviewRef.current.updateOptions(changes);
10790
+ }
10791
+ prevProps.current = props;
10792
+ }, PROPERTY_KEYS_PANEVIEW.map((key) => props[key]));
10793
+ React.useEffect(() => {
10794
+ var _a;
10795
+ if (!domRef.current) {
10796
+ return () => {
10797
+ // noop
10798
+ };
10799
+ }
10800
+ const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
10801
+ const frameworkOptions = {
10802
+ createComponent: (options) => {
10803
+ return new PanePanelSection(options.id, props.components[options.name], { addPortal });
10760
10804
  },
10761
- showDndOverlay: props.showDndOverlay,
10762
- });
10805
+ createHeaderComponent: (options) => {
10806
+ return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
10807
+ },
10808
+ };
10809
+ const api = createPaneview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
10763
10810
  const { clientWidth, clientHeight } = domRef.current;
10764
10811
  api.layout(clientWidth, clientHeight);
10765
10812
  if (props.onReady) {
@@ -10775,41 +10822,38 @@
10775
10822
  return;
10776
10823
  }
10777
10824
  paneviewRef.current.updateOptions({
10778
- frameworkComponents: props.components,
10825
+ createComponent: (options) => {
10826
+ return new PanePanelSection(options.id, props.components[options.name], { addPortal });
10827
+ },
10779
10828
  });
10780
10829
  }, [props.components]);
10781
10830
  React.useEffect(() => {
10831
+ var _a;
10782
10832
  if (!paneviewRef.current) {
10783
10833
  return;
10784
10834
  }
10835
+ const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
10785
10836
  paneviewRef.current.updateOptions({
10786
- headerframeworkComponents: props.headerComponents,
10837
+ createHeaderComponent: (options) => {
10838
+ return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
10839
+ },
10787
10840
  });
10788
10841
  }, [props.headerComponents]);
10789
10842
  React.useEffect(() => {
10790
10843
  if (!paneviewRef.current) {
10791
10844
  return () => {
10792
- //
10845
+ // noop
10793
10846
  };
10794
10847
  }
10795
- const api = paneviewRef.current;
10796
- const disposable = api.onDidDrop((event) => {
10848
+ const disposable = paneviewRef.current.onDidDrop((event) => {
10797
10849
  if (props.onDidDrop) {
10798
- props.onDidDrop(Object.assign(Object.assign({}, event), { api }));
10850
+ props.onDidDrop(event);
10799
10851
  }
10800
10852
  });
10801
10853
  return () => {
10802
10854
  disposable.dispose();
10803
10855
  };
10804
10856
  }, [props.onDidDrop]);
10805
- React.useEffect(() => {
10806
- if (!paneviewRef.current) {
10807
- return;
10808
- }
10809
- paneviewRef.current.updateOptions({
10810
- showDndOverlay: props.showDndOverlay,
10811
- });
10812
- }, [props.showDndOverlay]);
10813
10857
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10814
10858
  });
10815
10859
  PaneviewReact.displayName = 'PaneviewComponent';
@@ -10837,7 +10881,10 @@
10837
10881
  exports.GridviewComponent = GridviewComponent;
10838
10882
  exports.GridviewPanel = GridviewPanel;
10839
10883
  exports.GridviewReact = GridviewReact;
10840
- exports.PROPERTY_KEYS = PROPERTY_KEYS;
10884
+ exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
10885
+ exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
10886
+ exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
10887
+ exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
10841
10888
  exports.PaneFramework = PaneFramework;
10842
10889
  exports.PaneTransfer = PaneTransfer;
10843
10890
  exports.PanelTransfer = PanelTransfer;
@@ -10846,6 +10893,7 @@
10846
10893
  exports.PaneviewComponent = PaneviewComponent;
10847
10894
  exports.PaneviewPanel = PaneviewPanel;
10848
10895
  exports.PaneviewReact = PaneviewReact;
10896
+ exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
10849
10897
  exports.ReactPart = ReactPart;
10850
10898
  exports.ReactPartContext = ReactPartContext;
10851
10899
  exports.Splitview = Splitview;