dockview-react 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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-react
3
- * @version 2.1.4
3
+ * @version 3.0.1
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -99,6 +99,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
99
99
  this._defaultPrevented = true;
100
100
  }
101
101
  }
102
+ class AcceptableEvent {
103
+ constructor() {
104
+ this._isAccepted = false;
105
+ }
106
+ get isAccepted() {
107
+ return this._isAccepted;
108
+ }
109
+ accept() {
110
+ this._isAccepted = true;
111
+ }
112
+ }
102
113
  class LeakageMonitor {
103
114
  constructor() {
104
115
  this.events = new Map();
@@ -1490,6 +1501,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
1490
1501
  }
1491
1502
  }
1492
1503
 
1504
+ const PROPERTY_KEYS_SPLITVIEW = (() => {
1505
+ /**
1506
+ * by readong the keys from an empty value object TypeScript will error
1507
+ * when we add or remove new properties to `DockviewOptions`
1508
+ */
1509
+ const properties = {
1510
+ orientation: undefined,
1511
+ descriptor: undefined,
1512
+ proportionalLayout: undefined,
1513
+ styles: undefined,
1514
+ margin: undefined,
1515
+ disableAutoResizing: undefined,
1516
+ className: undefined,
1517
+ };
1518
+ return Object.keys(properties);
1519
+ })();
1520
+
1493
1521
  class Paneview extends CompositeDisposable {
1494
1522
  get onDidAddView() {
1495
1523
  return this.splitview.onDidAddView;
@@ -2619,6 +2647,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2619
2647
  }
2620
2648
  }
2621
2649
 
2650
+ const PROPERTY_KEYS_GRIDVIEW = (() => {
2651
+ /**
2652
+ * by readong the keys from an empty value object TypeScript will error
2653
+ * when we add or remove new properties to `DockviewOptions`
2654
+ */
2655
+ const properties = {
2656
+ disableAutoResizing: undefined,
2657
+ proportionalLayout: undefined,
2658
+ orientation: undefined,
2659
+ hideBorders: undefined,
2660
+ className: undefined,
2661
+ };
2662
+ return Object.keys(properties);
2663
+ })();
2664
+
2622
2665
  class Resizable extends CompositeDisposable {
2623
2666
  get element() {
2624
2667
  return this._element;
@@ -2728,7 +2771,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2728
2771
  }
2729
2772
  constructor(parentElement, options) {
2730
2773
  var _a;
2731
- super(document.createElement('div'), options.disableAutoResizing);
2774
+ super(parentElement, options.disableAutoResizing);
2732
2775
  this._id = nextLayoutId$1.next();
2733
2776
  this._groups = new Map();
2734
2777
  this._onDidRemove = new Emitter();
@@ -2747,7 +2790,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2747
2790
  this.element.style.width = '100%';
2748
2791
  this._classNames = new Classnames(this.element);
2749
2792
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
2750
- parentElement.appendChild(this.element);
2751
2793
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
2752
2794
  this.gridview.locked = !!options.locked;
2753
2795
  this.element.appendChild(this.gridview.element);
@@ -3096,15 +3138,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3096
3138
  * Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
3097
3139
  */
3098
3140
  get onDidDrop() {
3099
- const emitter = new Emitter();
3100
- const disposable = this.component.onDidDrop((e) => {
3101
- emitter.fire(Object.assign(Object.assign({}, e), { api: this }));
3102
- });
3103
- emitter.dispose = () => {
3104
- disposable.dispose();
3105
- emitter.dispose();
3106
- };
3107
- return emitter.event;
3141
+ return this.component.onDidDrop;
3142
+ }
3143
+ get onUnhandledDragOverEvent() {
3144
+ return this.component.onUnhandledDragOverEvent;
3108
3145
  }
3109
3146
  constructor(component) {
3110
3147
  this.component = component;
@@ -4031,6 +4068,28 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4031
4068
  return 'center';
4032
4069
  }
4033
4070
 
4071
+ const PROPERTY_KEYS_PANEVIEW = (() => {
4072
+ /**
4073
+ * by readong the keys from an empty value object TypeScript will error
4074
+ * when we add or remove new properties to `DockviewOptions`
4075
+ */
4076
+ const properties = {
4077
+ disableAutoResizing: undefined,
4078
+ disableDnd: undefined,
4079
+ className: undefined,
4080
+ };
4081
+ return Object.keys(properties);
4082
+ })();
4083
+ class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
4084
+ constructor(nativeEvent, position, getData, panel) {
4085
+ super();
4086
+ this.nativeEvent = nativeEvent;
4087
+ this.position = position;
4088
+ this.getData = getData;
4089
+ this.panel = panel;
4090
+ }
4091
+ }
4092
+
4034
4093
  class WillFocusEvent extends DockviewEvent {
4035
4094
  constructor() {
4036
4095
  super();
@@ -4454,6 +4513,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4454
4513
  this.accessor = accessor;
4455
4514
  this._onDidDrop = new Emitter();
4456
4515
  this.onDidDrop = this._onDidDrop.event;
4516
+ this._onUnhandledDragOverEvent = new Emitter();
4517
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
4518
+ this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
4457
4519
  if (!disableDnd) {
4458
4520
  this.initDragFeatures();
4459
4521
  }
@@ -4480,7 +4542,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4480
4542
  overlayModel: {
4481
4543
  activationSize: { type: 'percentage', value: 50 },
4482
4544
  },
4483
- canDisplayOverlay: (event) => {
4545
+ canDisplayOverlay: (event, position) => {
4484
4546
  const data = getPaneData();
4485
4547
  if (data) {
4486
4548
  if (data.paneId !== this.id &&
@@ -4488,14 +4550,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4488
4550
  return true;
4489
4551
  }
4490
4552
  }
4491
- if (this.accessor.options.showDndOverlay) {
4492
- return this.accessor.options.showDndOverlay({
4493
- nativeEvent: event,
4494
- getData: getPaneData,
4495
- panel: this,
4496
- });
4497
- }
4498
- return false;
4553
+ const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
4554
+ this._onUnhandledDragOverEvent.fire(firedEvent);
4555
+ return firedEvent.isAccepted;
4499
4556
  },
4500
4557
  });
4501
4558
  this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
@@ -4950,15 +5007,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4950
5007
  this._element.appendChild(this.leftActionsContainer);
4951
5008
  this._element.appendChild(this.voidContainer.element);
4952
5009
  this._element.appendChild(this.rightActionsContainer);
4953
- this.addDisposables(this.accessor.onDidAddPanel((e) => {
4954
- if (e.api.group === this.group) {
4955
- toggleClass(this._element, 'dv-single-tab', this.size === 1);
4956
- }
4957
- }), this.accessor.onDidRemovePanel((e) => {
4958
- if (e.api.group === this.group) {
4959
- toggleClass(this._element, 'dv-single-tab', this.size === 1);
4960
- }
4961
- }), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
5010
+ this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
4962
5011
  this._onGroupDragStart.fire({
4963
5012
  nativeEvent: event,
4964
5013
  group: this.group,
@@ -5003,20 +5052,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5003
5052
  setActive(_isGroupActive) {
5004
5053
  // noop
5005
5054
  }
5006
- addTab(tab, index = this.tabs.length) {
5007
- if (index < 0 || index > this.tabs.length) {
5008
- throw new Error('invalid location');
5009
- }
5010
- this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
5011
- this.tabs = [
5012
- ...this.tabs.slice(0, index),
5013
- tab,
5014
- ...this.tabs.slice(index),
5015
- ];
5016
- if (this.selectedIndex < 0) {
5017
- this.selectedIndex = index;
5018
- }
5019
- }
5020
5055
  delete(id) {
5021
5056
  const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
5022
5057
  const tabToRemove = this.tabs.splice(index, 1)[0];
@@ -5024,6 +5059,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5024
5059
  disposable.dispose();
5025
5060
  value.dispose();
5026
5061
  value.element.remove();
5062
+ this.updateClassnames();
5027
5063
  }
5028
5064
  setActivePanel(panel) {
5029
5065
  this.tabs.forEach((tab) => {
@@ -5092,25 +5128,37 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5092
5128
  }
5093
5129
  this.tabs = [];
5094
5130
  }
5131
+ addTab(tab, index = this.tabs.length) {
5132
+ if (index < 0 || index > this.tabs.length) {
5133
+ throw new Error('invalid location');
5134
+ }
5135
+ this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
5136
+ this.tabs = [
5137
+ ...this.tabs.slice(0, index),
5138
+ tab,
5139
+ ...this.tabs.slice(index),
5140
+ ];
5141
+ if (this.selectedIndex < 0) {
5142
+ this.selectedIndex = index;
5143
+ }
5144
+ this.updateClassnames();
5145
+ }
5146
+ updateClassnames() {
5147
+ toggleClass(this._element, 'dv-single-tab', this.size === 1);
5148
+ }
5095
5149
  }
5096
5150
 
5097
- class DockviewUnhandledDragOverEvent {
5098
- get isAccepted() {
5099
- return this._isAccepted;
5100
- }
5151
+ class DockviewUnhandledDragOverEvent extends AcceptableEvent {
5101
5152
  constructor(nativeEvent, target, position, getData, group) {
5153
+ super();
5102
5154
  this.nativeEvent = nativeEvent;
5103
5155
  this.target = target;
5104
5156
  this.position = position;
5105
5157
  this.getData = getData;
5106
5158
  this.group = group;
5107
- this._isAccepted = false;
5108
- }
5109
- accept() {
5110
- this._isAccepted = true;
5111
5159
  }
5112
5160
  }
5113
- const PROPERTY_KEYS = (() => {
5161
+ const PROPERTY_KEYS_DOCKVIEW = (() => {
5114
5162
  /**
5115
5163
  * by readong the keys from an empty value object TypeScript will error
5116
5164
  * when we add or remove new properties to `DockviewOptions`
@@ -8956,31 +9004,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8956
9004
  }
8957
9005
  }
8958
9006
 
8959
- function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
8960
- const Component = typeof componentName === 'string'
8961
- ? components[componentName]
8962
- : undefined;
8963
- const FrameworkComponent = typeof componentName === 'string'
8964
- ? frameworkComponents[componentName]
8965
- : undefined;
8966
- if (Component && FrameworkComponent) {
8967
- throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
8968
- }
8969
- if (FrameworkComponent) {
8970
- if (!createFrameworkComponent) {
8971
- throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
8972
- }
8973
- return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
8974
- }
8975
- if (!Component) {
8976
- if (fallback) {
8977
- return fallback();
8978
- }
8979
- throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
8980
- }
8981
- return new Component(id, componentName);
8982
- }
8983
-
8984
9007
  class GridviewComponent extends BaseGrid {
8985
9008
  get orientation() {
8986
9009
  return this.gridview.orientation;
@@ -8998,10 +9021,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8998
9021
  this._deserializer = value;
8999
9022
  }
9000
9023
  constructor(parentElement, options) {
9024
+ var _a;
9001
9025
  super(parentElement, {
9002
- proportionalLayout: options.proportionalLayout,
9026
+ proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9003
9027
  orientation: options.orientation,
9004
- styles: options.styles,
9028
+ styles: options.hideBorders
9029
+ ? { separatorBorder: 'transparent' }
9030
+ : undefined,
9005
9031
  disableAutoResizing: options.disableAutoResizing,
9006
9032
  className: options.className,
9007
9033
  });
@@ -9021,12 +9047,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9021
9047
  }), this.onDidActiveChange((event) => {
9022
9048
  this._onDidActiveGroupChange.fire(event);
9023
9049
  }));
9024
- if (!this.options.components) {
9025
- this.options.components = {};
9026
- }
9027
- if (!this.options.frameworkComponents) {
9028
- this.options.frameworkComponents = {};
9029
- }
9030
9050
  }
9031
9051
  updateOptions(options) {
9032
9052
  super.updateOptions(options);
@@ -9076,14 +9096,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9076
9096
  const height = this.height;
9077
9097
  this.gridview.deserialize(grid, {
9078
9098
  fromJSON: (node) => {
9079
- var _a, _b;
9080
9099
  const { data } = node;
9081
- 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
9082
- ? {
9083
- createComponent: this.options.frameworkComponentFactory
9084
- .createComponent,
9085
- }
9086
- : undefined);
9100
+ const view = this.options.createComponent({
9101
+ id: data.id,
9102
+ name: data.component,
9103
+ });
9087
9104
  queue.push(() => view.init({
9088
9105
  params: data.params,
9089
9106
  minimumWidth: data.minimumWidth,
@@ -9161,7 +9178,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9161
9178
  this.doAddGroup(removedPanel, relativeLocation, options.size);
9162
9179
  }
9163
9180
  addPanel(options) {
9164
- var _a, _b, _c, _d, _e, _f;
9181
+ var _a, _b, _c, _d;
9165
9182
  let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
9166
9183
  if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
9167
9184
  const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
@@ -9177,14 +9194,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9177
9194
  relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
9178
9195
  }
9179
9196
  }
9180
- 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
9181
- ? {
9182
- createComponent: this.options.frameworkComponentFactory
9183
- .createComponent,
9184
- }
9185
- : undefined);
9197
+ const view = this.options.createComponent({
9198
+ id: options.id,
9199
+ name: options.component,
9200
+ });
9186
9201
  view.init({
9187
- params: (_f = options.params) !== null && _f !== void 0 ? _f : {},
9202
+ params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9188
9203
  minimumWidth: options.minimumWidth,
9189
9204
  maximumWidth: options.maximumWidth,
9190
9205
  minimumHeight: options.minimumHeight,
@@ -9312,12 +9327,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9312
9327
  this._classNames = new Classnames(this.element);
9313
9328
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9314
9329
  this._options = options;
9315
- if (!options.components) {
9316
- options.components = {};
9317
- }
9318
- if (!options.frameworkComponents) {
9319
- options.frameworkComponents = {};
9320
- }
9321
9330
  this.splitview = new Splitview(this.element, options);
9322
9331
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9323
9332
  }
@@ -9380,18 +9389,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9380
9389
  return this.panels.find((view) => view.id === id);
9381
9390
  }
9382
9391
  addPanel(options) {
9383
- var _a, _b, _c;
9392
+ var _a;
9384
9393
  if (this._panels.has(options.id)) {
9385
9394
  throw new Error(`panel ${options.id} already exists`);
9386
9395
  }
9387
- 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
9388
- ? {
9389
- createComponent: this.options.frameworkWrapper.createComponent,
9390
- }
9391
- : undefined);
9396
+ const view = this.options.createComponent({
9397
+ id: options.id,
9398
+ name: options.component,
9399
+ });
9392
9400
  view.orientation = this.splitview.orientation;
9393
9401
  view.init({
9394
- params: (_c = options.params) !== null && _c !== void 0 ? _c : {},
9402
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9395
9403
  minimumSize: options.minimumSize,
9396
9404
  maximumSize: options.maximumSize,
9397
9405
  snap: options.snap,
@@ -9453,17 +9461,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9453
9461
  descriptor: {
9454
9462
  size,
9455
9463
  views: views.map((view) => {
9456
- var _a, _b;
9457
9464
  const data = view.data;
9458
9465
  if (this._panels.has(data.id)) {
9459
9466
  throw new Error(`panel ${data.id} already exists`);
9460
9467
  }
9461
- 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
9462
- ? {
9463
- createComponent: this.options.frameworkWrapper
9464
- .createComponent,
9465
- }
9466
- : undefined);
9468
+ const panel = this.options.createComponent({
9469
+ id: data.id,
9470
+ name: data.component,
9471
+ });
9467
9472
  queue.push(() => {
9468
9473
  var _a;
9469
9474
  panel.init({
@@ -9646,16 +9651,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9646
9651
  this.onDidAddView = this._onDidAddView.event;
9647
9652
  this._onDidRemoveView = new Emitter();
9648
9653
  this.onDidRemoveView = this._onDidRemoveView.event;
9649
- this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9654
+ this._onUnhandledDragOverEvent = new Emitter();
9655
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9656
+ this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9650
9657
  this._classNames = new Classnames(this.element);
9651
9658
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9652
9659
  this._options = options;
9653
- if (!options.components) {
9654
- options.components = {};
9655
- }
9656
- if (!options.frameworkComponents) {
9657
- options.frameworkComponents = {};
9658
- }
9659
9660
  this.paneview = new Paneview(this.element, {
9660
9661
  // only allow paneview in the vertical orientation for now
9661
9662
  orientation: exports.Orientation.VERTICAL,
@@ -9680,22 +9681,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9680
9681
  this._options = Object.assign(Object.assign({}, this.options), options);
9681
9682
  }
9682
9683
  addPanel(options) {
9683
- var _a, _b, _c, _d;
9684
- 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
9685
- ? {
9686
- createComponent: this.options.frameworkWrapper.body.createComponent,
9687
- }
9688
- : undefined);
9684
+ var _a;
9685
+ const body = this.options.createComponent({
9686
+ id: options.id,
9687
+ name: options.component,
9688
+ });
9689
9689
  let header;
9690
- if (options.headerComponent) {
9691
- header = createComponent(options.id, options.headerComponent, (_c = this.options.headerComponents) !== null && _c !== void 0 ? _c : {}, this.options.headerframeworkComponents, this.options.frameworkWrapper
9692
- ? {
9693
- createComponent: this.options.frameworkWrapper.header
9694
- .createComponent,
9695
- }
9696
- : undefined);
9690
+ if (options.headerComponent && this.options.createHeaderComponent) {
9691
+ header = this.options.createHeaderComponent({
9692
+ id: options.id,
9693
+ name: options.headerComponent,
9694
+ });
9697
9695
  }
9698
- else {
9696
+ if (!header) {
9699
9697
  header = new DefaultHeader();
9700
9698
  }
9701
9699
  const view = new PaneFramework({
@@ -9713,7 +9711,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9713
9711
  const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
9714
9712
  const index = typeof options.index === 'number' ? options.index : undefined;
9715
9713
  view.init({
9716
- params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9714
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9717
9715
  minimumBodySize: options.minimumBodySize,
9718
9716
  maximumBodySize: options.maximumBodySize,
9719
9717
  isExpanded: options.isExpanded,
@@ -9778,24 +9776,20 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9778
9776
  descriptor: {
9779
9777
  size,
9780
9778
  views: views.map((view) => {
9781
- var _a, _b, _c, _d;
9782
9779
  const data = view.data;
9783
- 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
9784
- ? {
9785
- createComponent: this.options.frameworkWrapper.body
9786
- .createComponent,
9787
- }
9788
- : undefined);
9780
+ const body = this.options.createComponent({
9781
+ id: data.id,
9782
+ name: data.component,
9783
+ });
9789
9784
  let header;
9790
- if (data.headerComponent) {
9791
- 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
9792
- ? {
9793
- createComponent: this.options.frameworkWrapper.header
9794
- .createComponent,
9795
- }
9796
- : undefined);
9785
+ if (data.headerComponent &&
9786
+ this.options.createHeaderComponent) {
9787
+ header = this.options.createHeaderComponent({
9788
+ id: data.id,
9789
+ name: data.headerComponent,
9790
+ });
9797
9791
  }
9798
- else {
9792
+ if (!header) {
9799
9793
  header = new DefaultHeader();
9800
9794
  }
9801
9795
  const panel = new PaneFramework({
@@ -9843,9 +9837,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9843
9837
  this.paneview.dispose();
9844
9838
  }
9845
9839
  doAddPanel(panel) {
9846
- const disposable = panel.onDidDrop((event) => {
9840
+ const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
9847
9841
  this._onDidDrop.fire(event);
9848
- });
9842
+ }), panel.onUnhandledDragOverEvent((event) => {
9843
+ this._onUnhandledDragOverEvent.fire(event);
9844
+ }));
9849
9845
  this._viewDisposables.set(panel.id, disposable);
9850
9846
  }
9851
9847
  doRemovePanel(panel) {
@@ -10128,7 +10124,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10128
10124
  this._onDidBlur = new Emitter();
10129
10125
  this.onDidBlur = this._onDidBlur.event;
10130
10126
  this._element = document.createElement('div');
10131
- this._element.className = 'dockview-react-part';
10127
+ this._element.className = 'dv-react-part';
10132
10128
  this._element.style.height = '100%';
10133
10129
  this._element.style.width = '100%';
10134
10130
  }
@@ -10166,7 +10162,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10166
10162
  this.component = component;
10167
10163
  this.reactPortalStore = reactPortalStore;
10168
10164
  this._element = document.createElement('div');
10169
- this._element.className = 'dockview-react-part';
10165
+ this._element.className = 'dv-react-part';
10170
10166
  this._element.style.height = '100%';
10171
10167
  this._element.style.width = '100%';
10172
10168
  }
@@ -10202,7 +10198,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10202
10198
  this.component = component;
10203
10199
  this.reactPortalStore = reactPortalStore;
10204
10200
  this._element = document.createElement('div');
10205
- this._element.className = 'dockview-react-part';
10201
+ this._element.className = 'dv-react-part';
10206
10202
  this._element.style.height = '100%';
10207
10203
  this._element.style.width = '100%';
10208
10204
  }
@@ -10244,7 +10240,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10244
10240
  this._group = _group;
10245
10241
  this.mutableDisposable = new MutableDisposable();
10246
10242
  this._element = document.createElement('div');
10247
- this._element.className = 'dockview-react-part';
10243
+ this._element.className = 'dv-react-part';
10248
10244
  this._element.style.height = '100%';
10249
10245
  this._element.style.width = '100%';
10250
10246
  }
@@ -10303,8 +10299,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10303
10299
  : undefined;
10304
10300
  }
10305
10301
  const DEFAULT_REACT_TAB = 'props.defaultTabComponent';
10306
- function extractCoreOptions(props) {
10307
- const coreOptions = PROPERTY_KEYS.reduce((obj, key) => {
10302
+ function extractCoreOptions$3(props) {
10303
+ const coreOptions = PROPERTY_KEYS_DOCKVIEW.reduce((obj, key) => {
10308
10304
  if (key in props) {
10309
10305
  obj[key] = props[key];
10310
10306
  }
@@ -10320,7 +10316,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10320
10316
  const prevProps = React.useRef({});
10321
10317
  React.useEffect(() => {
10322
10318
  const changes = {};
10323
- PROPERTY_KEYS.forEach((propKey) => {
10319
+ PROPERTY_KEYS_DOCKVIEW.forEach((propKey) => {
10324
10320
  const key = propKey;
10325
10321
  const propValue = props[key];
10326
10322
  if (key in props && propValue !== prevProps.current[key]) {
@@ -10331,7 +10327,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10331
10327
  dockviewRef.current.updateOptions(changes);
10332
10328
  }
10333
10329
  prevProps.current = props;
10334
- }, PROPERTY_KEYS.map((key) => props[key]));
10330
+ }, PROPERTY_KEYS_DOCKVIEW.map((key) => props[key]));
10335
10331
  React.useEffect(() => {
10336
10332
  var _a;
10337
10333
  if (!domRef.current) {
@@ -10367,7 +10363,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10367
10363
  ? DEFAULT_REACT_TAB
10368
10364
  : undefined,
10369
10365
  };
10370
- const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
10366
+ const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$3(props)), frameworkOptions));
10371
10367
  const { clientWidth, clientHeight } = domRef.current;
10372
10368
  api.layout(clientWidth, clientHeight);
10373
10369
  if (props.onReady) {
@@ -10555,31 +10551,47 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10555
10551
  }
10556
10552
  }
10557
10553
 
10554
+ function extractCoreOptions$2(props) {
10555
+ const coreOptions = PROPERTY_KEYS_SPLITVIEW.reduce((obj, key) => {
10556
+ if (key in props) {
10557
+ obj[key] = props[key];
10558
+ }
10559
+ return obj;
10560
+ }, {});
10561
+ return coreOptions;
10562
+ }
10558
10563
  const SplitviewReact = React.forwardRef((props, ref) => {
10559
10564
  const domRef = React.useRef(null);
10560
10565
  const splitviewRef = React.useRef();
10561
10566
  const [portals, addPortal] = usePortalsLifecycle();
10562
10567
  React.useImperativeHandle(ref, () => domRef.current, []);
10568
+ const prevProps = React.useRef({});
10563
10569
  React.useEffect(() => {
10564
- var _a;
10565
- const api = createSplitview(domRef.current, {
10566
- disableAutoResizing: props.disableAutoResizing,
10567
- orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.HORIZONTAL,
10568
- frameworkComponents: props.components,
10569
- frameworkWrapper: {
10570
- createComponent: (id, componentId, component) => {
10571
- return new ReactPanelView(id, componentId, component, {
10572
- addPortal,
10573
- });
10574
- },
10575
- },
10576
- proportionalLayout: typeof props.proportionalLayout === 'boolean'
10577
- ? props.proportionalLayout
10578
- : true,
10579
- styles: props.hideBorders
10580
- ? { separatorBorder: 'transparent' }
10581
- : undefined,
10570
+ const changes = {};
10571
+ PROPERTY_KEYS_SPLITVIEW.forEach((propKey) => {
10572
+ const key = propKey;
10573
+ const propValue = props[key];
10574
+ if (key in props && propValue !== prevProps.current[key]) {
10575
+ changes[key] = propValue;
10576
+ }
10582
10577
  });
10578
+ if (splitviewRef.current) {
10579
+ splitviewRef.current.updateOptions(changes);
10580
+ }
10581
+ prevProps.current = props;
10582
+ }, PROPERTY_KEYS_SPLITVIEW.map((key) => props[key]));
10583
+ React.useEffect(() => {
10584
+ if (!domRef.current) {
10585
+ return () => {
10586
+ // noop
10587
+ };
10588
+ }
10589
+ const frameworkOptions = {
10590
+ createComponent: (options) => {
10591
+ return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
10592
+ },
10593
+ };
10594
+ const api = createSplitview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$2(props)), frameworkOptions));
10583
10595
  const { clientWidth, clientHeight } = domRef.current;
10584
10596
  api.layout(clientWidth, clientHeight);
10585
10597
  if (props.onReady) {
@@ -10595,7 +10607,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10595
10607
  return;
10596
10608
  }
10597
10609
  splitviewRef.current.updateOptions({
10598
- frameworkComponents: props.components,
10610
+ createComponent: (options) => {
10611
+ return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
10612
+ },
10599
10613
  });
10600
10614
  }, [props.components]);
10601
10615
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
@@ -10620,36 +10634,47 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10620
10634
  }
10621
10635
  }
10622
10636
 
10637
+ function extractCoreOptions$1(props) {
10638
+ const coreOptions = PROPERTY_KEYS_GRIDVIEW.reduce((obj, key) => {
10639
+ if (key in props) {
10640
+ obj[key] = props[key];
10641
+ }
10642
+ return obj;
10643
+ }, {});
10644
+ return coreOptions;
10645
+ }
10623
10646
  const GridviewReact = React.forwardRef((props, ref) => {
10624
10647
  const domRef = React.useRef(null);
10625
10648
  const gridviewRef = React.useRef();
10626
10649
  const [portals, addPortal] = usePortalsLifecycle();
10627
10650
  React.useImperativeHandle(ref, () => domRef.current, []);
10651
+ const prevProps = React.useRef({});
10652
+ React.useEffect(() => {
10653
+ const changes = {};
10654
+ PROPERTY_KEYS_GRIDVIEW.forEach((propKey) => {
10655
+ const key = propKey;
10656
+ const propValue = props[key];
10657
+ if (key in props && propValue !== prevProps.current[key]) {
10658
+ changes[key] = propValue;
10659
+ }
10660
+ });
10661
+ if (gridviewRef.current) {
10662
+ gridviewRef.current.updateOptions(changes);
10663
+ }
10664
+ prevProps.current = props;
10665
+ }, PROPERTY_KEYS_GRIDVIEW.map((key) => props[key]));
10628
10666
  React.useEffect(() => {
10629
- var _a;
10630
10667
  if (!domRef.current) {
10631
10668
  return () => {
10632
10669
  // noop
10633
10670
  };
10634
10671
  }
10635
- const api = createGridview(domRef.current, {
10636
- disableAutoResizing: props.disableAutoResizing,
10637
- proportionalLayout: typeof props.proportionalLayout === 'boolean'
10638
- ? props.proportionalLayout
10639
- : true,
10640
- orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.HORIZONTAL,
10641
- frameworkComponents: props.components,
10642
- frameworkComponentFactory: {
10643
- createComponent: (id, componentId, component) => {
10644
- return new ReactGridPanelView(id, componentId, component, {
10645
- addPortal,
10646
- });
10647
- },
10672
+ const frameworkOptions = {
10673
+ createComponent: (options) => {
10674
+ return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
10648
10675
  },
10649
- styles: props.hideBorders
10650
- ? { separatorBorder: 'transparent' }
10651
- : undefined,
10652
- });
10676
+ };
10677
+ const api = createGridview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$1(props)), frameworkOptions));
10653
10678
  const { clientWidth, clientHeight } = domRef.current;
10654
10679
  api.layout(clientWidth, clientHeight);
10655
10680
  if (props.onReady) {
@@ -10665,7 +10690,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10665
10690
  return;
10666
10691
  }
10667
10692
  gridviewRef.current.updateOptions({
10668
- frameworkComponents: props.components,
10693
+ createComponent: (options) => {
10694
+ return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
10695
+ },
10669
10696
  });
10670
10697
  }, [props.components]);
10671
10698
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
@@ -10707,32 +10734,52 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10707
10734
  }
10708
10735
  }
10709
10736
 
10737
+ function extractCoreOptions(props) {
10738
+ const coreOptions = PROPERTY_KEYS_PANEVIEW.reduce((obj, key) => {
10739
+ if (key in props) {
10740
+ obj[key] = props[key];
10741
+ }
10742
+ return obj;
10743
+ }, {});
10744
+ return coreOptions;
10745
+ }
10710
10746
  const PaneviewReact = React.forwardRef((props, ref) => {
10711
10747
  const domRef = React.useRef(null);
10712
10748
  const paneviewRef = React.useRef();
10713
10749
  const [portals, addPortal] = usePortalsLifecycle();
10714
10750
  React.useImperativeHandle(ref, () => domRef.current, []);
10751
+ const prevProps = React.useRef({});
10715
10752
  React.useEffect(() => {
10716
- const createComponent = (id, _componentId, component) => new PanePanelSection(id, component, {
10717
- addPortal,
10753
+ const changes = {};
10754
+ PROPERTY_KEYS_PANEVIEW.forEach((propKey) => {
10755
+ const key = propKey;
10756
+ const propValue = props[key];
10757
+ if (key in props && propValue !== prevProps.current[key]) {
10758
+ changes[key] = propValue;
10759
+ }
10718
10760
  });
10719
- const api = createPaneview(domRef.current, {
10720
- disableAutoResizing: props.disableAutoResizing,
10721
- frameworkComponents: props.components,
10722
- components: {},
10723
- headerComponents: {},
10724
- disableDnd: props.disableDnd,
10725
- headerframeworkComponents: props.headerComponents,
10726
- frameworkWrapper: {
10727
- header: {
10728
- createComponent,
10729
- },
10730
- body: {
10731
- createComponent,
10732
- },
10761
+ if (paneviewRef.current) {
10762
+ paneviewRef.current.updateOptions(changes);
10763
+ }
10764
+ prevProps.current = props;
10765
+ }, PROPERTY_KEYS_PANEVIEW.map((key) => props[key]));
10766
+ React.useEffect(() => {
10767
+ var _a;
10768
+ if (!domRef.current) {
10769
+ return () => {
10770
+ // noop
10771
+ };
10772
+ }
10773
+ const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
10774
+ const frameworkOptions = {
10775
+ createComponent: (options) => {
10776
+ return new PanePanelSection(options.id, props.components[options.name], { addPortal });
10733
10777
  },
10734
- showDndOverlay: props.showDndOverlay,
10735
- });
10778
+ createHeaderComponent: (options) => {
10779
+ return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
10780
+ },
10781
+ };
10782
+ const api = createPaneview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
10736
10783
  const { clientWidth, clientHeight } = domRef.current;
10737
10784
  api.layout(clientWidth, clientHeight);
10738
10785
  if (props.onReady) {
@@ -10748,41 +10795,38 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10748
10795
  return;
10749
10796
  }
10750
10797
  paneviewRef.current.updateOptions({
10751
- frameworkComponents: props.components,
10798
+ createComponent: (options) => {
10799
+ return new PanePanelSection(options.id, props.components[options.name], { addPortal });
10800
+ },
10752
10801
  });
10753
10802
  }, [props.components]);
10754
10803
  React.useEffect(() => {
10804
+ var _a;
10755
10805
  if (!paneviewRef.current) {
10756
10806
  return;
10757
10807
  }
10808
+ const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
10758
10809
  paneviewRef.current.updateOptions({
10759
- headerframeworkComponents: props.headerComponents,
10810
+ createHeaderComponent: (options) => {
10811
+ return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
10812
+ },
10760
10813
  });
10761
10814
  }, [props.headerComponents]);
10762
10815
  React.useEffect(() => {
10763
10816
  if (!paneviewRef.current) {
10764
10817
  return () => {
10765
- //
10818
+ // noop
10766
10819
  };
10767
10820
  }
10768
- const api = paneviewRef.current;
10769
- const disposable = api.onDidDrop((event) => {
10821
+ const disposable = paneviewRef.current.onDidDrop((event) => {
10770
10822
  if (props.onDidDrop) {
10771
- props.onDidDrop(Object.assign(Object.assign({}, event), { api }));
10823
+ props.onDidDrop(event);
10772
10824
  }
10773
10825
  });
10774
10826
  return () => {
10775
10827
  disposable.dispose();
10776
10828
  };
10777
10829
  }, [props.onDidDrop]);
10778
- React.useEffect(() => {
10779
- if (!paneviewRef.current) {
10780
- return;
10781
- }
10782
- paneviewRef.current.updateOptions({
10783
- showDndOverlay: props.showDndOverlay,
10784
- });
10785
- }, [props.showDndOverlay]);
10786
10830
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10787
10831
  });
10788
10832
  PaneviewReact.displayName = 'PaneviewComponent';
@@ -10810,7 +10854,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10810
10854
  exports.GridviewComponent = GridviewComponent;
10811
10855
  exports.GridviewPanel = GridviewPanel;
10812
10856
  exports.GridviewReact = GridviewReact;
10813
- exports.PROPERTY_KEYS = PROPERTY_KEYS;
10857
+ exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
10858
+ exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
10859
+ exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
10860
+ exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
10814
10861
  exports.PaneFramework = PaneFramework;
10815
10862
  exports.PaneTransfer = PaneTransfer;
10816
10863
  exports.PanelTransfer = PanelTransfer;
@@ -10819,6 +10866,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10819
10866
  exports.PaneviewComponent = PaneviewComponent;
10820
10867
  exports.PaneviewPanel = PaneviewPanel;
10821
10868
  exports.PaneviewReact = PaneviewReact;
10869
+ exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
10822
10870
  exports.ReactPart = ReactPart;
10823
10871
  exports.ReactPartContext = ReactPartContext;
10824
10872
  exports.Splitview = Splitview;