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
  */
@@ -129,6 +129,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
129
129
  this._defaultPrevented = true;
130
130
  }
131
131
  }
132
+ class AcceptableEvent {
133
+ constructor() {
134
+ this._isAccepted = false;
135
+ }
136
+ get isAccepted() {
137
+ return this._isAccepted;
138
+ }
139
+ accept() {
140
+ this._isAccepted = true;
141
+ }
142
+ }
132
143
  class LeakageMonitor {
133
144
  constructor() {
134
145
  this.events = new Map();
@@ -1520,6 +1531,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
1520
1531
  }
1521
1532
  }
1522
1533
 
1534
+ const PROPERTY_KEYS_SPLITVIEW = (() => {
1535
+ /**
1536
+ * by readong the keys from an empty value object TypeScript will error
1537
+ * when we add or remove new properties to `DockviewOptions`
1538
+ */
1539
+ const properties = {
1540
+ orientation: undefined,
1541
+ descriptor: undefined,
1542
+ proportionalLayout: undefined,
1543
+ styles: undefined,
1544
+ margin: undefined,
1545
+ disableAutoResizing: undefined,
1546
+ className: undefined,
1547
+ };
1548
+ return Object.keys(properties);
1549
+ })();
1550
+
1523
1551
  class Paneview extends CompositeDisposable {
1524
1552
  get onDidAddView() {
1525
1553
  return this.splitview.onDidAddView;
@@ -2649,6 +2677,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2649
2677
  }
2650
2678
  }
2651
2679
 
2680
+ const PROPERTY_KEYS_GRIDVIEW = (() => {
2681
+ /**
2682
+ * by readong the keys from an empty value object TypeScript will error
2683
+ * when we add or remove new properties to `DockviewOptions`
2684
+ */
2685
+ const properties = {
2686
+ disableAutoResizing: undefined,
2687
+ proportionalLayout: undefined,
2688
+ orientation: undefined,
2689
+ hideBorders: undefined,
2690
+ className: undefined,
2691
+ };
2692
+ return Object.keys(properties);
2693
+ })();
2694
+
2652
2695
  class Resizable extends CompositeDisposable {
2653
2696
  get element() {
2654
2697
  return this._element;
@@ -2758,7 +2801,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2758
2801
  }
2759
2802
  constructor(parentElement, options) {
2760
2803
  var _a;
2761
- super(document.createElement('div'), options.disableAutoResizing);
2804
+ super(parentElement, options.disableAutoResizing);
2762
2805
  this._id = nextLayoutId$1.next();
2763
2806
  this._groups = new Map();
2764
2807
  this._onDidRemove = new Emitter();
@@ -2777,7 +2820,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2777
2820
  this.element.style.width = '100%';
2778
2821
  this._classNames = new Classnames(this.element);
2779
2822
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
2780
- parentElement.appendChild(this.element);
2781
2823
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
2782
2824
  this.gridview.locked = !!options.locked;
2783
2825
  this.element.appendChild(this.gridview.element);
@@ -3126,15 +3168,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3126
3168
  * Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
3127
3169
  */
3128
3170
  get onDidDrop() {
3129
- const emitter = new Emitter();
3130
- const disposable = this.component.onDidDrop((e) => {
3131
- emitter.fire(Object.assign(Object.assign({}, e), { api: this }));
3132
- });
3133
- emitter.dispose = () => {
3134
- disposable.dispose();
3135
- emitter.dispose();
3136
- };
3137
- return emitter.event;
3171
+ return this.component.onDidDrop;
3172
+ }
3173
+ get onUnhandledDragOverEvent() {
3174
+ return this.component.onUnhandledDragOverEvent;
3138
3175
  }
3139
3176
  constructor(component) {
3140
3177
  this.component = component;
@@ -4061,6 +4098,28 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4061
4098
  return 'center';
4062
4099
  }
4063
4100
 
4101
+ const PROPERTY_KEYS_PANEVIEW = (() => {
4102
+ /**
4103
+ * by readong the keys from an empty value object TypeScript will error
4104
+ * when we add or remove new properties to `DockviewOptions`
4105
+ */
4106
+ const properties = {
4107
+ disableAutoResizing: undefined,
4108
+ disableDnd: undefined,
4109
+ className: undefined,
4110
+ };
4111
+ return Object.keys(properties);
4112
+ })();
4113
+ class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
4114
+ constructor(nativeEvent, position, getData, panel) {
4115
+ super();
4116
+ this.nativeEvent = nativeEvent;
4117
+ this.position = position;
4118
+ this.getData = getData;
4119
+ this.panel = panel;
4120
+ }
4121
+ }
4122
+
4064
4123
  class WillFocusEvent extends DockviewEvent {
4065
4124
  constructor() {
4066
4125
  super();
@@ -4484,6 +4543,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4484
4543
  this.accessor = accessor;
4485
4544
  this._onDidDrop = new Emitter();
4486
4545
  this.onDidDrop = this._onDidDrop.event;
4546
+ this._onUnhandledDragOverEvent = new Emitter();
4547
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
4548
+ this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
4487
4549
  if (!disableDnd) {
4488
4550
  this.initDragFeatures();
4489
4551
  }
@@ -4510,7 +4572,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4510
4572
  overlayModel: {
4511
4573
  activationSize: { type: 'percentage', value: 50 },
4512
4574
  },
4513
- canDisplayOverlay: (event) => {
4575
+ canDisplayOverlay: (event, position) => {
4514
4576
  const data = getPaneData();
4515
4577
  if (data) {
4516
4578
  if (data.paneId !== this.id &&
@@ -4518,14 +4580,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4518
4580
  return true;
4519
4581
  }
4520
4582
  }
4521
- if (this.accessor.options.showDndOverlay) {
4522
- return this.accessor.options.showDndOverlay({
4523
- nativeEvent: event,
4524
- getData: getPaneData,
4525
- panel: this,
4526
- });
4527
- }
4528
- return false;
4583
+ const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
4584
+ this._onUnhandledDragOverEvent.fire(firedEvent);
4585
+ return firedEvent.isAccepted;
4529
4586
  },
4530
4587
  });
4531
4588
  this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
@@ -4980,15 +5037,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4980
5037
  this._element.appendChild(this.leftActionsContainer);
4981
5038
  this._element.appendChild(this.voidContainer.element);
4982
5039
  this._element.appendChild(this.rightActionsContainer);
4983
- this.addDisposables(this.accessor.onDidAddPanel((e) => {
4984
- if (e.api.group === this.group) {
4985
- toggleClass(this._element, 'dv-single-tab', this.size === 1);
4986
- }
4987
- }), this.accessor.onDidRemovePanel((e) => {
4988
- if (e.api.group === this.group) {
4989
- toggleClass(this._element, 'dv-single-tab', this.size === 1);
4990
- }
4991
- }), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
5040
+ this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
4992
5041
  this._onGroupDragStart.fire({
4993
5042
  nativeEvent: event,
4994
5043
  group: this.group,
@@ -5033,20 +5082,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5033
5082
  setActive(_isGroupActive) {
5034
5083
  // noop
5035
5084
  }
5036
- addTab(tab, index = this.tabs.length) {
5037
- if (index < 0 || index > this.tabs.length) {
5038
- throw new Error('invalid location');
5039
- }
5040
- this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
5041
- this.tabs = [
5042
- ...this.tabs.slice(0, index),
5043
- tab,
5044
- ...this.tabs.slice(index),
5045
- ];
5046
- if (this.selectedIndex < 0) {
5047
- this.selectedIndex = index;
5048
- }
5049
- }
5050
5085
  delete(id) {
5051
5086
  const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
5052
5087
  const tabToRemove = this.tabs.splice(index, 1)[0];
@@ -5054,6 +5089,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5054
5089
  disposable.dispose();
5055
5090
  value.dispose();
5056
5091
  value.element.remove();
5092
+ this.updateClassnames();
5057
5093
  }
5058
5094
  setActivePanel(panel) {
5059
5095
  this.tabs.forEach((tab) => {
@@ -5122,25 +5158,37 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5122
5158
  }
5123
5159
  this.tabs = [];
5124
5160
  }
5161
+ addTab(tab, index = this.tabs.length) {
5162
+ if (index < 0 || index > this.tabs.length) {
5163
+ throw new Error('invalid location');
5164
+ }
5165
+ this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
5166
+ this.tabs = [
5167
+ ...this.tabs.slice(0, index),
5168
+ tab,
5169
+ ...this.tabs.slice(index),
5170
+ ];
5171
+ if (this.selectedIndex < 0) {
5172
+ this.selectedIndex = index;
5173
+ }
5174
+ this.updateClassnames();
5175
+ }
5176
+ updateClassnames() {
5177
+ toggleClass(this._element, 'dv-single-tab', this.size === 1);
5178
+ }
5125
5179
  }
5126
5180
 
5127
- class DockviewUnhandledDragOverEvent {
5128
- get isAccepted() {
5129
- return this._isAccepted;
5130
- }
5181
+ class DockviewUnhandledDragOverEvent extends AcceptableEvent {
5131
5182
  constructor(nativeEvent, target, position, getData, group) {
5183
+ super();
5132
5184
  this.nativeEvent = nativeEvent;
5133
5185
  this.target = target;
5134
5186
  this.position = position;
5135
5187
  this.getData = getData;
5136
5188
  this.group = group;
5137
- this._isAccepted = false;
5138
- }
5139
- accept() {
5140
- this._isAccepted = true;
5141
5189
  }
5142
5190
  }
5143
- const PROPERTY_KEYS = (() => {
5191
+ const PROPERTY_KEYS_DOCKVIEW = (() => {
5144
5192
  /**
5145
5193
  * by readong the keys from an empty value object TypeScript will error
5146
5194
  * when we add or remove new properties to `DockviewOptions`
@@ -8986,31 +9034,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8986
9034
  }
8987
9035
  }
8988
9036
 
8989
- function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
8990
- const Component = typeof componentName === 'string'
8991
- ? components[componentName]
8992
- : undefined;
8993
- const FrameworkComponent = typeof componentName === 'string'
8994
- ? frameworkComponents[componentName]
8995
- : undefined;
8996
- if (Component && FrameworkComponent) {
8997
- throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
8998
- }
8999
- if (FrameworkComponent) {
9000
- if (!createFrameworkComponent) {
9001
- throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
9002
- }
9003
- return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
9004
- }
9005
- if (!Component) {
9006
- if (fallback) {
9007
- return fallback();
9008
- }
9009
- throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
9010
- }
9011
- return new Component(id, componentName);
9012
- }
9013
-
9014
9037
  class GridviewComponent extends BaseGrid {
9015
9038
  get orientation() {
9016
9039
  return this.gridview.orientation;
@@ -9028,10 +9051,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9028
9051
  this._deserializer = value;
9029
9052
  }
9030
9053
  constructor(parentElement, options) {
9054
+ var _a;
9031
9055
  super(parentElement, {
9032
- proportionalLayout: options.proportionalLayout,
9056
+ proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9033
9057
  orientation: options.orientation,
9034
- styles: options.styles,
9058
+ styles: options.hideBorders
9059
+ ? { separatorBorder: 'transparent' }
9060
+ : undefined,
9035
9061
  disableAutoResizing: options.disableAutoResizing,
9036
9062
  className: options.className,
9037
9063
  });
@@ -9051,12 +9077,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9051
9077
  }), this.onDidActiveChange((event) => {
9052
9078
  this._onDidActiveGroupChange.fire(event);
9053
9079
  }));
9054
- if (!this.options.components) {
9055
- this.options.components = {};
9056
- }
9057
- if (!this.options.frameworkComponents) {
9058
- this.options.frameworkComponents = {};
9059
- }
9060
9080
  }
9061
9081
  updateOptions(options) {
9062
9082
  super.updateOptions(options);
@@ -9106,14 +9126,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9106
9126
  const height = this.height;
9107
9127
  this.gridview.deserialize(grid, {
9108
9128
  fromJSON: (node) => {
9109
- var _a, _b;
9110
9129
  const { data } = node;
9111
- 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
9112
- ? {
9113
- createComponent: this.options.frameworkComponentFactory
9114
- .createComponent,
9115
- }
9116
- : undefined);
9130
+ const view = this.options.createComponent({
9131
+ id: data.id,
9132
+ name: data.component,
9133
+ });
9117
9134
  queue.push(() => view.init({
9118
9135
  params: data.params,
9119
9136
  minimumWidth: data.minimumWidth,
@@ -9191,7 +9208,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9191
9208
  this.doAddGroup(removedPanel, relativeLocation, options.size);
9192
9209
  }
9193
9210
  addPanel(options) {
9194
- var _a, _b, _c, _d, _e, _f;
9211
+ var _a, _b, _c, _d;
9195
9212
  let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
9196
9213
  if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
9197
9214
  const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
@@ -9207,14 +9224,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9207
9224
  relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
9208
9225
  }
9209
9226
  }
9210
- 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
9211
- ? {
9212
- createComponent: this.options.frameworkComponentFactory
9213
- .createComponent,
9214
- }
9215
- : undefined);
9227
+ const view = this.options.createComponent({
9228
+ id: options.id,
9229
+ name: options.component,
9230
+ });
9216
9231
  view.init({
9217
- params: (_f = options.params) !== null && _f !== void 0 ? _f : {},
9232
+ params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9218
9233
  minimumWidth: options.minimumWidth,
9219
9234
  maximumWidth: options.maximumWidth,
9220
9235
  minimumHeight: options.minimumHeight,
@@ -9342,12 +9357,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9342
9357
  this._classNames = new Classnames(this.element);
9343
9358
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9344
9359
  this._options = options;
9345
- if (!options.components) {
9346
- options.components = {};
9347
- }
9348
- if (!options.frameworkComponents) {
9349
- options.frameworkComponents = {};
9350
- }
9351
9360
  this.splitview = new Splitview(this.element, options);
9352
9361
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9353
9362
  }
@@ -9410,18 +9419,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9410
9419
  return this.panels.find((view) => view.id === id);
9411
9420
  }
9412
9421
  addPanel(options) {
9413
- var _a, _b, _c;
9422
+ var _a;
9414
9423
  if (this._panels.has(options.id)) {
9415
9424
  throw new Error(`panel ${options.id} already exists`);
9416
9425
  }
9417
- 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
9418
- ? {
9419
- createComponent: this.options.frameworkWrapper.createComponent,
9420
- }
9421
- : undefined);
9426
+ const view = this.options.createComponent({
9427
+ id: options.id,
9428
+ name: options.component,
9429
+ });
9422
9430
  view.orientation = this.splitview.orientation;
9423
9431
  view.init({
9424
- params: (_c = options.params) !== null && _c !== void 0 ? _c : {},
9432
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9425
9433
  minimumSize: options.minimumSize,
9426
9434
  maximumSize: options.maximumSize,
9427
9435
  snap: options.snap,
@@ -9483,17 +9491,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9483
9491
  descriptor: {
9484
9492
  size,
9485
9493
  views: views.map((view) => {
9486
- var _a, _b;
9487
9494
  const data = view.data;
9488
9495
  if (this._panels.has(data.id)) {
9489
9496
  throw new Error(`panel ${data.id} already exists`);
9490
9497
  }
9491
- 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
9492
- ? {
9493
- createComponent: this.options.frameworkWrapper
9494
- .createComponent,
9495
- }
9496
- : undefined);
9498
+ const panel = this.options.createComponent({
9499
+ id: data.id,
9500
+ name: data.component,
9501
+ });
9497
9502
  queue.push(() => {
9498
9503
  var _a;
9499
9504
  panel.init({
@@ -9676,16 +9681,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9676
9681
  this.onDidAddView = this._onDidAddView.event;
9677
9682
  this._onDidRemoveView = new Emitter();
9678
9683
  this.onDidRemoveView = this._onDidRemoveView.event;
9679
- this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9684
+ this._onUnhandledDragOverEvent = new Emitter();
9685
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9686
+ this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9680
9687
  this._classNames = new Classnames(this.element);
9681
9688
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9682
9689
  this._options = options;
9683
- if (!options.components) {
9684
- options.components = {};
9685
- }
9686
- if (!options.frameworkComponents) {
9687
- options.frameworkComponents = {};
9688
- }
9689
9690
  this.paneview = new Paneview(this.element, {
9690
9691
  // only allow paneview in the vertical orientation for now
9691
9692
  orientation: exports.Orientation.VERTICAL,
@@ -9710,22 +9711,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9710
9711
  this._options = Object.assign(Object.assign({}, this.options), options);
9711
9712
  }
9712
9713
  addPanel(options) {
9713
- var _a, _b, _c, _d;
9714
- 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
9715
- ? {
9716
- createComponent: this.options.frameworkWrapper.body.createComponent,
9717
- }
9718
- : undefined);
9714
+ var _a;
9715
+ const body = this.options.createComponent({
9716
+ id: options.id,
9717
+ name: options.component,
9718
+ });
9719
9719
  let header;
9720
- if (options.headerComponent) {
9721
- header = createComponent(options.id, options.headerComponent, (_c = this.options.headerComponents) !== null && _c !== void 0 ? _c : {}, this.options.headerframeworkComponents, this.options.frameworkWrapper
9722
- ? {
9723
- createComponent: this.options.frameworkWrapper.header
9724
- .createComponent,
9725
- }
9726
- : undefined);
9720
+ if (options.headerComponent && this.options.createHeaderComponent) {
9721
+ header = this.options.createHeaderComponent({
9722
+ id: options.id,
9723
+ name: options.headerComponent,
9724
+ });
9727
9725
  }
9728
- else {
9726
+ if (!header) {
9729
9727
  header = new DefaultHeader();
9730
9728
  }
9731
9729
  const view = new PaneFramework({
@@ -9743,7 +9741,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9743
9741
  const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
9744
9742
  const index = typeof options.index === 'number' ? options.index : undefined;
9745
9743
  view.init({
9746
- params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9744
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9747
9745
  minimumBodySize: options.minimumBodySize,
9748
9746
  maximumBodySize: options.maximumBodySize,
9749
9747
  isExpanded: options.isExpanded,
@@ -9808,24 +9806,20 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9808
9806
  descriptor: {
9809
9807
  size,
9810
9808
  views: views.map((view) => {
9811
- var _a, _b, _c, _d;
9812
9809
  const data = view.data;
9813
- 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
9814
- ? {
9815
- createComponent: this.options.frameworkWrapper.body
9816
- .createComponent,
9817
- }
9818
- : undefined);
9810
+ const body = this.options.createComponent({
9811
+ id: data.id,
9812
+ name: data.component,
9813
+ });
9819
9814
  let header;
9820
- if (data.headerComponent) {
9821
- 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
9822
- ? {
9823
- createComponent: this.options.frameworkWrapper.header
9824
- .createComponent,
9825
- }
9826
- : undefined);
9815
+ if (data.headerComponent &&
9816
+ this.options.createHeaderComponent) {
9817
+ header = this.options.createHeaderComponent({
9818
+ id: data.id,
9819
+ name: data.headerComponent,
9820
+ });
9827
9821
  }
9828
- else {
9822
+ if (!header) {
9829
9823
  header = new DefaultHeader();
9830
9824
  }
9831
9825
  const panel = new PaneFramework({
@@ -9873,9 +9867,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9873
9867
  this.paneview.dispose();
9874
9868
  }
9875
9869
  doAddPanel(panel) {
9876
- const disposable = panel.onDidDrop((event) => {
9870
+ const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
9877
9871
  this._onDidDrop.fire(event);
9878
- });
9872
+ }), panel.onUnhandledDragOverEvent((event) => {
9873
+ this._onUnhandledDragOverEvent.fire(event);
9874
+ }));
9879
9875
  this._viewDisposables.set(panel.id, disposable);
9880
9876
  }
9881
9877
  doRemovePanel(panel) {
@@ -10158,7 +10154,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10158
10154
  this._onDidBlur = new Emitter();
10159
10155
  this.onDidBlur = this._onDidBlur.event;
10160
10156
  this._element = document.createElement('div');
10161
- this._element.className = 'dockview-react-part';
10157
+ this._element.className = 'dv-react-part';
10162
10158
  this._element.style.height = '100%';
10163
10159
  this._element.style.width = '100%';
10164
10160
  }
@@ -10196,7 +10192,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10196
10192
  this.component = component;
10197
10193
  this.reactPortalStore = reactPortalStore;
10198
10194
  this._element = document.createElement('div');
10199
- this._element.className = 'dockview-react-part';
10195
+ this._element.className = 'dv-react-part';
10200
10196
  this._element.style.height = '100%';
10201
10197
  this._element.style.width = '100%';
10202
10198
  }
@@ -10232,7 +10228,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10232
10228
  this.component = component;
10233
10229
  this.reactPortalStore = reactPortalStore;
10234
10230
  this._element = document.createElement('div');
10235
- this._element.className = 'dockview-react-part';
10231
+ this._element.className = 'dv-react-part';
10236
10232
  this._element.style.height = '100%';
10237
10233
  this._element.style.width = '100%';
10238
10234
  }
@@ -10274,7 +10270,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10274
10270
  this._group = _group;
10275
10271
  this.mutableDisposable = new MutableDisposable();
10276
10272
  this._element = document.createElement('div');
10277
- this._element.className = 'dockview-react-part';
10273
+ this._element.className = 'dv-react-part';
10278
10274
  this._element.style.height = '100%';
10279
10275
  this._element.style.width = '100%';
10280
10276
  }
@@ -10333,8 +10329,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10333
10329
  : undefined;
10334
10330
  }
10335
10331
  const DEFAULT_REACT_TAB = 'props.defaultTabComponent';
10336
- function extractCoreOptions(props) {
10337
- const coreOptions = PROPERTY_KEYS.reduce((obj, key) => {
10332
+ function extractCoreOptions$3(props) {
10333
+ const coreOptions = PROPERTY_KEYS_DOCKVIEW.reduce((obj, key) => {
10338
10334
  if (key in props) {
10339
10335
  obj[key] = props[key];
10340
10336
  }
@@ -10350,7 +10346,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10350
10346
  const prevProps = React.useRef({});
10351
10347
  React.useEffect(() => {
10352
10348
  const changes = {};
10353
- PROPERTY_KEYS.forEach((propKey) => {
10349
+ PROPERTY_KEYS_DOCKVIEW.forEach((propKey) => {
10354
10350
  const key = propKey;
10355
10351
  const propValue = props[key];
10356
10352
  if (key in props && propValue !== prevProps.current[key]) {
@@ -10361,7 +10357,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10361
10357
  dockviewRef.current.updateOptions(changes);
10362
10358
  }
10363
10359
  prevProps.current = props;
10364
- }, PROPERTY_KEYS.map((key) => props[key]));
10360
+ }, PROPERTY_KEYS_DOCKVIEW.map((key) => props[key]));
10365
10361
  React.useEffect(() => {
10366
10362
  var _a;
10367
10363
  if (!domRef.current) {
@@ -10397,7 +10393,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10397
10393
  ? DEFAULT_REACT_TAB
10398
10394
  : undefined,
10399
10395
  };
10400
- const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
10396
+ const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$3(props)), frameworkOptions));
10401
10397
  const { clientWidth, clientHeight } = domRef.current;
10402
10398
  api.layout(clientWidth, clientHeight);
10403
10399
  if (props.onReady) {
@@ -10585,31 +10581,47 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10585
10581
  }
10586
10582
  }
10587
10583
 
10584
+ function extractCoreOptions$2(props) {
10585
+ const coreOptions = PROPERTY_KEYS_SPLITVIEW.reduce((obj, key) => {
10586
+ if (key in props) {
10587
+ obj[key] = props[key];
10588
+ }
10589
+ return obj;
10590
+ }, {});
10591
+ return coreOptions;
10592
+ }
10588
10593
  const SplitviewReact = React.forwardRef((props, ref) => {
10589
10594
  const domRef = React.useRef(null);
10590
10595
  const splitviewRef = React.useRef();
10591
10596
  const [portals, addPortal] = usePortalsLifecycle();
10592
10597
  React.useImperativeHandle(ref, () => domRef.current, []);
10598
+ const prevProps = React.useRef({});
10593
10599
  React.useEffect(() => {
10594
- var _a;
10595
- const api = createSplitview(domRef.current, {
10596
- disableAutoResizing: props.disableAutoResizing,
10597
- orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.HORIZONTAL,
10598
- frameworkComponents: props.components,
10599
- frameworkWrapper: {
10600
- createComponent: (id, componentId, component) => {
10601
- return new ReactPanelView(id, componentId, component, {
10602
- addPortal,
10603
- });
10604
- },
10605
- },
10606
- proportionalLayout: typeof props.proportionalLayout === 'boolean'
10607
- ? props.proportionalLayout
10608
- : true,
10609
- styles: props.hideBorders
10610
- ? { separatorBorder: 'transparent' }
10611
- : undefined,
10600
+ const changes = {};
10601
+ PROPERTY_KEYS_SPLITVIEW.forEach((propKey) => {
10602
+ const key = propKey;
10603
+ const propValue = props[key];
10604
+ if (key in props && propValue !== prevProps.current[key]) {
10605
+ changes[key] = propValue;
10606
+ }
10612
10607
  });
10608
+ if (splitviewRef.current) {
10609
+ splitviewRef.current.updateOptions(changes);
10610
+ }
10611
+ prevProps.current = props;
10612
+ }, PROPERTY_KEYS_SPLITVIEW.map((key) => props[key]));
10613
+ React.useEffect(() => {
10614
+ if (!domRef.current) {
10615
+ return () => {
10616
+ // noop
10617
+ };
10618
+ }
10619
+ const frameworkOptions = {
10620
+ createComponent: (options) => {
10621
+ return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
10622
+ },
10623
+ };
10624
+ const api = createSplitview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$2(props)), frameworkOptions));
10613
10625
  const { clientWidth, clientHeight } = domRef.current;
10614
10626
  api.layout(clientWidth, clientHeight);
10615
10627
  if (props.onReady) {
@@ -10625,7 +10637,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10625
10637
  return;
10626
10638
  }
10627
10639
  splitviewRef.current.updateOptions({
10628
- frameworkComponents: props.components,
10640
+ createComponent: (options) => {
10641
+ return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
10642
+ },
10629
10643
  });
10630
10644
  }, [props.components]);
10631
10645
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
@@ -10650,36 +10664,47 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10650
10664
  }
10651
10665
  }
10652
10666
 
10667
+ function extractCoreOptions$1(props) {
10668
+ const coreOptions = PROPERTY_KEYS_GRIDVIEW.reduce((obj, key) => {
10669
+ if (key in props) {
10670
+ obj[key] = props[key];
10671
+ }
10672
+ return obj;
10673
+ }, {});
10674
+ return coreOptions;
10675
+ }
10653
10676
  const GridviewReact = React.forwardRef((props, ref) => {
10654
10677
  const domRef = React.useRef(null);
10655
10678
  const gridviewRef = React.useRef();
10656
10679
  const [portals, addPortal] = usePortalsLifecycle();
10657
10680
  React.useImperativeHandle(ref, () => domRef.current, []);
10681
+ const prevProps = React.useRef({});
10682
+ React.useEffect(() => {
10683
+ const changes = {};
10684
+ PROPERTY_KEYS_GRIDVIEW.forEach((propKey) => {
10685
+ const key = propKey;
10686
+ const propValue = props[key];
10687
+ if (key in props && propValue !== prevProps.current[key]) {
10688
+ changes[key] = propValue;
10689
+ }
10690
+ });
10691
+ if (gridviewRef.current) {
10692
+ gridviewRef.current.updateOptions(changes);
10693
+ }
10694
+ prevProps.current = props;
10695
+ }, PROPERTY_KEYS_GRIDVIEW.map((key) => props[key]));
10658
10696
  React.useEffect(() => {
10659
- var _a;
10660
10697
  if (!domRef.current) {
10661
10698
  return () => {
10662
10699
  // noop
10663
10700
  };
10664
10701
  }
10665
- const api = createGridview(domRef.current, {
10666
- disableAutoResizing: props.disableAutoResizing,
10667
- proportionalLayout: typeof props.proportionalLayout === 'boolean'
10668
- ? props.proportionalLayout
10669
- : true,
10670
- orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.HORIZONTAL,
10671
- frameworkComponents: props.components,
10672
- frameworkComponentFactory: {
10673
- createComponent: (id, componentId, component) => {
10674
- return new ReactGridPanelView(id, componentId, component, {
10675
- addPortal,
10676
- });
10677
- },
10702
+ const frameworkOptions = {
10703
+ createComponent: (options) => {
10704
+ return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
10678
10705
  },
10679
- styles: props.hideBorders
10680
- ? { separatorBorder: 'transparent' }
10681
- : undefined,
10682
- });
10706
+ };
10707
+ const api = createGridview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$1(props)), frameworkOptions));
10683
10708
  const { clientWidth, clientHeight } = domRef.current;
10684
10709
  api.layout(clientWidth, clientHeight);
10685
10710
  if (props.onReady) {
@@ -10695,7 +10720,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10695
10720
  return;
10696
10721
  }
10697
10722
  gridviewRef.current.updateOptions({
10698
- frameworkComponents: props.components,
10723
+ createComponent: (options) => {
10724
+ return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
10725
+ },
10699
10726
  });
10700
10727
  }, [props.components]);
10701
10728
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
@@ -10737,32 +10764,52 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10737
10764
  }
10738
10765
  }
10739
10766
 
10767
+ function extractCoreOptions(props) {
10768
+ const coreOptions = PROPERTY_KEYS_PANEVIEW.reduce((obj, key) => {
10769
+ if (key in props) {
10770
+ obj[key] = props[key];
10771
+ }
10772
+ return obj;
10773
+ }, {});
10774
+ return coreOptions;
10775
+ }
10740
10776
  const PaneviewReact = React.forwardRef((props, ref) => {
10741
10777
  const domRef = React.useRef(null);
10742
10778
  const paneviewRef = React.useRef();
10743
10779
  const [portals, addPortal] = usePortalsLifecycle();
10744
10780
  React.useImperativeHandle(ref, () => domRef.current, []);
10781
+ const prevProps = React.useRef({});
10745
10782
  React.useEffect(() => {
10746
- const createComponent = (id, _componentId, component) => new PanePanelSection(id, component, {
10747
- addPortal,
10783
+ const changes = {};
10784
+ PROPERTY_KEYS_PANEVIEW.forEach((propKey) => {
10785
+ const key = propKey;
10786
+ const propValue = props[key];
10787
+ if (key in props && propValue !== prevProps.current[key]) {
10788
+ changes[key] = propValue;
10789
+ }
10748
10790
  });
10749
- const api = createPaneview(domRef.current, {
10750
- disableAutoResizing: props.disableAutoResizing,
10751
- frameworkComponents: props.components,
10752
- components: {},
10753
- headerComponents: {},
10754
- disableDnd: props.disableDnd,
10755
- headerframeworkComponents: props.headerComponents,
10756
- frameworkWrapper: {
10757
- header: {
10758
- createComponent,
10759
- },
10760
- body: {
10761
- createComponent,
10762
- },
10791
+ if (paneviewRef.current) {
10792
+ paneviewRef.current.updateOptions(changes);
10793
+ }
10794
+ prevProps.current = props;
10795
+ }, PROPERTY_KEYS_PANEVIEW.map((key) => props[key]));
10796
+ React.useEffect(() => {
10797
+ var _a;
10798
+ if (!domRef.current) {
10799
+ return () => {
10800
+ // noop
10801
+ };
10802
+ }
10803
+ const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
10804
+ const frameworkOptions = {
10805
+ createComponent: (options) => {
10806
+ return new PanePanelSection(options.id, props.components[options.name], { addPortal });
10763
10807
  },
10764
- showDndOverlay: props.showDndOverlay,
10765
- });
10808
+ createHeaderComponent: (options) => {
10809
+ return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
10810
+ },
10811
+ };
10812
+ const api = createPaneview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
10766
10813
  const { clientWidth, clientHeight } = domRef.current;
10767
10814
  api.layout(clientWidth, clientHeight);
10768
10815
  if (props.onReady) {
@@ -10778,41 +10825,38 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10778
10825
  return;
10779
10826
  }
10780
10827
  paneviewRef.current.updateOptions({
10781
- frameworkComponents: props.components,
10828
+ createComponent: (options) => {
10829
+ return new PanePanelSection(options.id, props.components[options.name], { addPortal });
10830
+ },
10782
10831
  });
10783
10832
  }, [props.components]);
10784
10833
  React.useEffect(() => {
10834
+ var _a;
10785
10835
  if (!paneviewRef.current) {
10786
10836
  return;
10787
10837
  }
10838
+ const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
10788
10839
  paneviewRef.current.updateOptions({
10789
- headerframeworkComponents: props.headerComponents,
10840
+ createHeaderComponent: (options) => {
10841
+ return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
10842
+ },
10790
10843
  });
10791
10844
  }, [props.headerComponents]);
10792
10845
  React.useEffect(() => {
10793
10846
  if (!paneviewRef.current) {
10794
10847
  return () => {
10795
- //
10848
+ // noop
10796
10849
  };
10797
10850
  }
10798
- const api = paneviewRef.current;
10799
- const disposable = api.onDidDrop((event) => {
10851
+ const disposable = paneviewRef.current.onDidDrop((event) => {
10800
10852
  if (props.onDidDrop) {
10801
- props.onDidDrop(Object.assign(Object.assign({}, event), { api }));
10853
+ props.onDidDrop(event);
10802
10854
  }
10803
10855
  });
10804
10856
  return () => {
10805
10857
  disposable.dispose();
10806
10858
  };
10807
10859
  }, [props.onDidDrop]);
10808
- React.useEffect(() => {
10809
- if (!paneviewRef.current) {
10810
- return;
10811
- }
10812
- paneviewRef.current.updateOptions({
10813
- showDndOverlay: props.showDndOverlay,
10814
- });
10815
- }, [props.showDndOverlay]);
10816
10860
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10817
10861
  });
10818
10862
  PaneviewReact.displayName = 'PaneviewComponent';
@@ -10840,7 +10884,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10840
10884
  exports.GridviewComponent = GridviewComponent;
10841
10885
  exports.GridviewPanel = GridviewPanel;
10842
10886
  exports.GridviewReact = GridviewReact;
10843
- exports.PROPERTY_KEYS = PROPERTY_KEYS;
10887
+ exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
10888
+ exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
10889
+ exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
10890
+ exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
10844
10891
  exports.PaneFramework = PaneFramework;
10845
10892
  exports.PaneTransfer = PaneTransfer;
10846
10893
  exports.PanelTransfer = PanelTransfer;
@@ -10849,6 +10896,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10849
10896
  exports.PaneviewComponent = PaneviewComponent;
10850
10897
  exports.PaneviewPanel = PaneviewPanel;
10851
10898
  exports.PaneviewReact = PaneviewReact;
10899
+ exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
10852
10900
  exports.ReactPart = ReactPart;
10853
10901
  exports.ReactPartContext = ReactPartContext;
10854
10902
  exports.Splitview = Splitview;