dockview 2.1.4 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +287 -238
  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 +287 -238
  21. package/dist/dockview.amd.noStyle.js.map +1 -1
  22. package/dist/dockview.cjs.js +287 -238
  23. package/dist/dockview.cjs.js.map +1 -1
  24. package/dist/dockview.esm.js +283 -238
  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 +287 -238
  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 +287 -238
  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
package/dist/dockview.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 2.1.4
3
+ * @version 3.0.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -133,6 +133,17 @@
133
133
  this._defaultPrevented = true;
134
134
  }
135
135
  }
136
+ class AcceptableEvent {
137
+ constructor() {
138
+ this._isAccepted = false;
139
+ }
140
+ get isAccepted() {
141
+ return this._isAccepted;
142
+ }
143
+ accept() {
144
+ this._isAccepted = true;
145
+ }
146
+ }
136
147
  class LeakageMonitor {
137
148
  constructor() {
138
149
  this.events = new Map();
@@ -1524,6 +1535,23 @@
1524
1535
  }
1525
1536
  }
1526
1537
 
1538
+ const PROPERTY_KEYS_SPLITVIEW = (() => {
1539
+ /**
1540
+ * by readong the keys from an empty value object TypeScript will error
1541
+ * when we add or remove new properties to `DockviewOptions`
1542
+ */
1543
+ const properties = {
1544
+ orientation: undefined,
1545
+ descriptor: undefined,
1546
+ proportionalLayout: undefined,
1547
+ styles: undefined,
1548
+ margin: undefined,
1549
+ disableAutoResizing: undefined,
1550
+ className: undefined,
1551
+ };
1552
+ return Object.keys(properties);
1553
+ })();
1554
+
1527
1555
  class Paneview extends CompositeDisposable {
1528
1556
  get onDidAddView() {
1529
1557
  return this.splitview.onDidAddView;
@@ -2653,6 +2681,21 @@
2653
2681
  }
2654
2682
  }
2655
2683
 
2684
+ const PROPERTY_KEYS_GRIDVIEW = (() => {
2685
+ /**
2686
+ * by readong the keys from an empty value object TypeScript will error
2687
+ * when we add or remove new properties to `DockviewOptions`
2688
+ */
2689
+ const properties = {
2690
+ disableAutoResizing: undefined,
2691
+ proportionalLayout: undefined,
2692
+ orientation: undefined,
2693
+ hideBorders: undefined,
2694
+ className: undefined,
2695
+ };
2696
+ return Object.keys(properties);
2697
+ })();
2698
+
2656
2699
  class Resizable extends CompositeDisposable {
2657
2700
  get element() {
2658
2701
  return this._element;
@@ -3130,15 +3173,10 @@
3130
3173
  * Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
3131
3174
  */
3132
3175
  get onDidDrop() {
3133
- const emitter = new Emitter();
3134
- const disposable = this.component.onDidDrop((e) => {
3135
- emitter.fire(Object.assign(Object.assign({}, e), { api: this }));
3136
- });
3137
- emitter.dispose = () => {
3138
- disposable.dispose();
3139
- emitter.dispose();
3140
- };
3141
- return emitter.event;
3176
+ return this.component.onDidDrop;
3177
+ }
3178
+ get onUnhandledDragOverEvent() {
3179
+ return this.component.onUnhandledDragOverEvent;
3142
3180
  }
3143
3181
  constructor(component) {
3144
3182
  this.component = component;
@@ -4065,6 +4103,28 @@
4065
4103
  return 'center';
4066
4104
  }
4067
4105
 
4106
+ const PROPERTY_KEYS_PANEVIEW = (() => {
4107
+ /**
4108
+ * by readong the keys from an empty value object TypeScript will error
4109
+ * when we add or remove new properties to `DockviewOptions`
4110
+ */
4111
+ const properties = {
4112
+ disableAutoResizing: undefined,
4113
+ disableDnd: undefined,
4114
+ className: undefined,
4115
+ };
4116
+ return Object.keys(properties);
4117
+ })();
4118
+ class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
4119
+ constructor(nativeEvent, position, getData, panel) {
4120
+ super();
4121
+ this.nativeEvent = nativeEvent;
4122
+ this.position = position;
4123
+ this.getData = getData;
4124
+ this.panel = panel;
4125
+ }
4126
+ }
4127
+
4068
4128
  class WillFocusEvent extends DockviewEvent {
4069
4129
  constructor() {
4070
4130
  super();
@@ -4488,6 +4548,9 @@
4488
4548
  this.accessor = accessor;
4489
4549
  this._onDidDrop = new Emitter();
4490
4550
  this.onDidDrop = this._onDidDrop.event;
4551
+ this._onUnhandledDragOverEvent = new Emitter();
4552
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
4553
+ this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
4491
4554
  if (!disableDnd) {
4492
4555
  this.initDragFeatures();
4493
4556
  }
@@ -4514,7 +4577,7 @@
4514
4577
  overlayModel: {
4515
4578
  activationSize: { type: 'percentage', value: 50 },
4516
4579
  },
4517
- canDisplayOverlay: (event) => {
4580
+ canDisplayOverlay: (event, position) => {
4518
4581
  const data = getPaneData();
4519
4582
  if (data) {
4520
4583
  if (data.paneId !== this.id &&
@@ -4522,14 +4585,9 @@
4522
4585
  return true;
4523
4586
  }
4524
4587
  }
4525
- if (this.accessor.options.showDndOverlay) {
4526
- return this.accessor.options.showDndOverlay({
4527
- nativeEvent: event,
4528
- getData: getPaneData,
4529
- panel: this,
4530
- });
4531
- }
4532
- return false;
4588
+ const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
4589
+ this._onUnhandledDragOverEvent.fire(firedEvent);
4590
+ return firedEvent.isAccepted;
4533
4591
  },
4534
4592
  });
4535
4593
  this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
@@ -4984,15 +5042,7 @@
4984
5042
  this._element.appendChild(this.leftActionsContainer);
4985
5043
  this._element.appendChild(this.voidContainer.element);
4986
5044
  this._element.appendChild(this.rightActionsContainer);
4987
- this.addDisposables(this.accessor.onDidAddPanel((e) => {
4988
- if (e.api.group === this.group) {
4989
- toggleClass(this._element, 'dv-single-tab', this.size === 1);
4990
- }
4991
- }), this.accessor.onDidRemovePanel((e) => {
4992
- if (e.api.group === this.group) {
4993
- toggleClass(this._element, 'dv-single-tab', this.size === 1);
4994
- }
4995
- }), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
5045
+ this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
4996
5046
  this._onGroupDragStart.fire({
4997
5047
  nativeEvent: event,
4998
5048
  group: this.group,
@@ -5037,20 +5087,6 @@
5037
5087
  setActive(_isGroupActive) {
5038
5088
  // noop
5039
5089
  }
5040
- addTab(tab, index = this.tabs.length) {
5041
- if (index < 0 || index > this.tabs.length) {
5042
- throw new Error('invalid location');
5043
- }
5044
- this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
5045
- this.tabs = [
5046
- ...this.tabs.slice(0, index),
5047
- tab,
5048
- ...this.tabs.slice(index),
5049
- ];
5050
- if (this.selectedIndex < 0) {
5051
- this.selectedIndex = index;
5052
- }
5053
- }
5054
5090
  delete(id) {
5055
5091
  const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
5056
5092
  const tabToRemove = this.tabs.splice(index, 1)[0];
@@ -5058,6 +5094,7 @@
5058
5094
  disposable.dispose();
5059
5095
  value.dispose();
5060
5096
  value.element.remove();
5097
+ this.updateClassnames();
5061
5098
  }
5062
5099
  setActivePanel(panel) {
5063
5100
  this.tabs.forEach((tab) => {
@@ -5126,25 +5163,37 @@
5126
5163
  }
5127
5164
  this.tabs = [];
5128
5165
  }
5166
+ addTab(tab, index = this.tabs.length) {
5167
+ if (index < 0 || index > this.tabs.length) {
5168
+ throw new Error('invalid location');
5169
+ }
5170
+ this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
5171
+ this.tabs = [
5172
+ ...this.tabs.slice(0, index),
5173
+ tab,
5174
+ ...this.tabs.slice(index),
5175
+ ];
5176
+ if (this.selectedIndex < 0) {
5177
+ this.selectedIndex = index;
5178
+ }
5179
+ this.updateClassnames();
5180
+ }
5181
+ updateClassnames() {
5182
+ toggleClass(this._element, 'dv-single-tab', this.size === 1);
5183
+ }
5129
5184
  }
5130
5185
 
5131
- class DockviewUnhandledDragOverEvent {
5132
- get isAccepted() {
5133
- return this._isAccepted;
5134
- }
5186
+ class DockviewUnhandledDragOverEvent extends AcceptableEvent {
5135
5187
  constructor(nativeEvent, target, position, getData, group) {
5188
+ super();
5136
5189
  this.nativeEvent = nativeEvent;
5137
5190
  this.target = target;
5138
5191
  this.position = position;
5139
5192
  this.getData = getData;
5140
5193
  this.group = group;
5141
- this._isAccepted = false;
5142
- }
5143
- accept() {
5144
- this._isAccepted = true;
5145
5194
  }
5146
5195
  }
5147
- const PROPERTY_KEYS = (() => {
5196
+ const PROPERTY_KEYS_DOCKVIEW = (() => {
5148
5197
  /**
5149
5198
  * by readong the keys from an empty value object TypeScript will error
5150
5199
  * when we add or remove new properties to `DockviewOptions`
@@ -8990,31 +9039,6 @@
8990
9039
  }
8991
9040
  }
8992
9041
 
8993
- function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
8994
- const Component = typeof componentName === 'string'
8995
- ? components[componentName]
8996
- : undefined;
8997
- const FrameworkComponent = typeof componentName === 'string'
8998
- ? frameworkComponents[componentName]
8999
- : undefined;
9000
- if (Component && FrameworkComponent) {
9001
- throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
9002
- }
9003
- if (FrameworkComponent) {
9004
- if (!createFrameworkComponent) {
9005
- throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
9006
- }
9007
- return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
9008
- }
9009
- if (!Component) {
9010
- if (fallback) {
9011
- return fallback();
9012
- }
9013
- throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
9014
- }
9015
- return new Component(id, componentName);
9016
- }
9017
-
9018
9042
  class GridviewComponent extends BaseGrid {
9019
9043
  get orientation() {
9020
9044
  return this.gridview.orientation;
@@ -9032,10 +9056,13 @@
9032
9056
  this._deserializer = value;
9033
9057
  }
9034
9058
  constructor(parentElement, options) {
9059
+ var _a;
9035
9060
  super(parentElement, {
9036
- proportionalLayout: options.proportionalLayout,
9061
+ proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9037
9062
  orientation: options.orientation,
9038
- styles: options.styles,
9063
+ styles: options.hideBorders
9064
+ ? { separatorBorder: 'transparent' }
9065
+ : undefined,
9039
9066
  disableAutoResizing: options.disableAutoResizing,
9040
9067
  className: options.className,
9041
9068
  });
@@ -9055,12 +9082,6 @@
9055
9082
  }), this.onDidActiveChange((event) => {
9056
9083
  this._onDidActiveGroupChange.fire(event);
9057
9084
  }));
9058
- if (!this.options.components) {
9059
- this.options.components = {};
9060
- }
9061
- if (!this.options.frameworkComponents) {
9062
- this.options.frameworkComponents = {};
9063
- }
9064
9085
  }
9065
9086
  updateOptions(options) {
9066
9087
  super.updateOptions(options);
@@ -9110,14 +9131,11 @@
9110
9131
  const height = this.height;
9111
9132
  this.gridview.deserialize(grid, {
9112
9133
  fromJSON: (node) => {
9113
- var _a, _b;
9114
9134
  const { data } = node;
9115
- 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
9116
- ? {
9117
- createComponent: this.options.frameworkComponentFactory
9118
- .createComponent,
9119
- }
9120
- : undefined);
9135
+ const view = this.options.createComponent({
9136
+ id: data.id,
9137
+ name: data.component,
9138
+ });
9121
9139
  queue.push(() => view.init({
9122
9140
  params: data.params,
9123
9141
  minimumWidth: data.minimumWidth,
@@ -9195,7 +9213,7 @@
9195
9213
  this.doAddGroup(removedPanel, relativeLocation, options.size);
9196
9214
  }
9197
9215
  addPanel(options) {
9198
- var _a, _b, _c, _d, _e, _f;
9216
+ var _a, _b, _c, _d;
9199
9217
  let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
9200
9218
  if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
9201
9219
  const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
@@ -9211,14 +9229,12 @@
9211
9229
  relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
9212
9230
  }
9213
9231
  }
9214
- 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
9215
- ? {
9216
- createComponent: this.options.frameworkComponentFactory
9217
- .createComponent,
9218
- }
9219
- : undefined);
9232
+ const view = this.options.createComponent({
9233
+ id: options.id,
9234
+ name: options.component,
9235
+ });
9220
9236
  view.init({
9221
- params: (_f = options.params) !== null && _f !== void 0 ? _f : {},
9237
+ params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9222
9238
  minimumWidth: options.minimumWidth,
9223
9239
  maximumWidth: options.maximumWidth,
9224
9240
  minimumHeight: options.minimumHeight,
@@ -9346,12 +9362,6 @@
9346
9362
  this._classNames = new Classnames(this.element);
9347
9363
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9348
9364
  this._options = options;
9349
- if (!options.components) {
9350
- options.components = {};
9351
- }
9352
- if (!options.frameworkComponents) {
9353
- options.frameworkComponents = {};
9354
- }
9355
9365
  this.splitview = new Splitview(this.element, options);
9356
9366
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9357
9367
  }
@@ -9414,18 +9424,17 @@
9414
9424
  return this.panels.find((view) => view.id === id);
9415
9425
  }
9416
9426
  addPanel(options) {
9417
- var _a, _b, _c;
9427
+ var _a;
9418
9428
  if (this._panels.has(options.id)) {
9419
9429
  throw new Error(`panel ${options.id} already exists`);
9420
9430
  }
9421
- 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
9422
- ? {
9423
- createComponent: this.options.frameworkWrapper.createComponent,
9424
- }
9425
- : undefined);
9431
+ const view = this.options.createComponent({
9432
+ id: options.id,
9433
+ name: options.component,
9434
+ });
9426
9435
  view.orientation = this.splitview.orientation;
9427
9436
  view.init({
9428
- params: (_c = options.params) !== null && _c !== void 0 ? _c : {},
9437
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9429
9438
  minimumSize: options.minimumSize,
9430
9439
  maximumSize: options.maximumSize,
9431
9440
  snap: options.snap,
@@ -9487,17 +9496,14 @@
9487
9496
  descriptor: {
9488
9497
  size,
9489
9498
  views: views.map((view) => {
9490
- var _a, _b;
9491
9499
  const data = view.data;
9492
9500
  if (this._panels.has(data.id)) {
9493
9501
  throw new Error(`panel ${data.id} already exists`);
9494
9502
  }
9495
- 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
9496
- ? {
9497
- createComponent: this.options.frameworkWrapper
9498
- .createComponent,
9499
- }
9500
- : undefined);
9503
+ const panel = this.options.createComponent({
9504
+ id: data.id,
9505
+ name: data.component,
9506
+ });
9501
9507
  queue.push(() => {
9502
9508
  var _a;
9503
9509
  panel.init({
@@ -9680,16 +9686,12 @@
9680
9686
  this.onDidAddView = this._onDidAddView.event;
9681
9687
  this._onDidRemoveView = new Emitter();
9682
9688
  this.onDidRemoveView = this._onDidRemoveView.event;
9683
- this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9689
+ this._onUnhandledDragOverEvent = new Emitter();
9690
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9691
+ this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9684
9692
  this._classNames = new Classnames(this.element);
9685
9693
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9686
9694
  this._options = options;
9687
- if (!options.components) {
9688
- options.components = {};
9689
- }
9690
- if (!options.frameworkComponents) {
9691
- options.frameworkComponents = {};
9692
- }
9693
9695
  this.paneview = new Paneview(this.element, {
9694
9696
  // only allow paneview in the vertical orientation for now
9695
9697
  orientation: exports.Orientation.VERTICAL,
@@ -9714,22 +9716,19 @@
9714
9716
  this._options = Object.assign(Object.assign({}, this.options), options);
9715
9717
  }
9716
9718
  addPanel(options) {
9717
- var _a, _b, _c, _d;
9718
- 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
9719
- ? {
9720
- createComponent: this.options.frameworkWrapper.body.createComponent,
9721
- }
9722
- : undefined);
9719
+ var _a;
9720
+ const body = this.options.createComponent({
9721
+ id: options.id,
9722
+ name: options.component,
9723
+ });
9723
9724
  let header;
9724
- if (options.headerComponent) {
9725
- header = createComponent(options.id, options.headerComponent, (_c = this.options.headerComponents) !== null && _c !== void 0 ? _c : {}, this.options.headerframeworkComponents, this.options.frameworkWrapper
9726
- ? {
9727
- createComponent: this.options.frameworkWrapper.header
9728
- .createComponent,
9729
- }
9730
- : undefined);
9725
+ if (options.headerComponent && this.options.createHeaderComponent) {
9726
+ header = this.options.createHeaderComponent({
9727
+ id: options.id,
9728
+ name: options.headerComponent,
9729
+ });
9731
9730
  }
9732
- else {
9731
+ if (!header) {
9733
9732
  header = new DefaultHeader();
9734
9733
  }
9735
9734
  const view = new PaneFramework({
@@ -9747,7 +9746,7 @@
9747
9746
  const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
9748
9747
  const index = typeof options.index === 'number' ? options.index : undefined;
9749
9748
  view.init({
9750
- params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9749
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9751
9750
  minimumBodySize: options.minimumBodySize,
9752
9751
  maximumBodySize: options.maximumBodySize,
9753
9752
  isExpanded: options.isExpanded,
@@ -9812,24 +9811,20 @@
9812
9811
  descriptor: {
9813
9812
  size,
9814
9813
  views: views.map((view) => {
9815
- var _a, _b, _c, _d;
9816
9814
  const data = view.data;
9817
- 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
9818
- ? {
9819
- createComponent: this.options.frameworkWrapper.body
9820
- .createComponent,
9821
- }
9822
- : undefined);
9815
+ const body = this.options.createComponent({
9816
+ id: data.id,
9817
+ name: data.component,
9818
+ });
9823
9819
  let header;
9824
- if (data.headerComponent) {
9825
- 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
9826
- ? {
9827
- createComponent: this.options.frameworkWrapper.header
9828
- .createComponent,
9829
- }
9830
- : undefined);
9820
+ if (data.headerComponent &&
9821
+ this.options.createHeaderComponent) {
9822
+ header = this.options.createHeaderComponent({
9823
+ id: data.id,
9824
+ name: data.headerComponent,
9825
+ });
9831
9826
  }
9832
- else {
9827
+ if (!header) {
9833
9828
  header = new DefaultHeader();
9834
9829
  }
9835
9830
  const panel = new PaneFramework({
@@ -9877,9 +9872,11 @@
9877
9872
  this.paneview.dispose();
9878
9873
  }
9879
9874
  doAddPanel(panel) {
9880
- const disposable = panel.onDidDrop((event) => {
9875
+ const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
9881
9876
  this._onDidDrop.fire(event);
9882
- });
9877
+ }), panel.onUnhandledDragOverEvent((event) => {
9878
+ this._onUnhandledDragOverEvent.fire(event);
9879
+ }));
9883
9880
  this._viewDisposables.set(panel.id, disposable);
9884
9881
  }
9885
9882
  doRemovePanel(panel) {
@@ -10162,7 +10159,7 @@
10162
10159
  this._onDidBlur = new Emitter();
10163
10160
  this.onDidBlur = this._onDidBlur.event;
10164
10161
  this._element = document.createElement('div');
10165
- this._element.className = 'dockview-react-part';
10162
+ this._element.className = 'dv-react-part';
10166
10163
  this._element.style.height = '100%';
10167
10164
  this._element.style.width = '100%';
10168
10165
  }
@@ -10200,7 +10197,7 @@
10200
10197
  this.component = component;
10201
10198
  this.reactPortalStore = reactPortalStore;
10202
10199
  this._element = document.createElement('div');
10203
- this._element.className = 'dockview-react-part';
10200
+ this._element.className = 'dv-react-part';
10204
10201
  this._element.style.height = '100%';
10205
10202
  this._element.style.width = '100%';
10206
10203
  }
@@ -10236,7 +10233,7 @@
10236
10233
  this.component = component;
10237
10234
  this.reactPortalStore = reactPortalStore;
10238
10235
  this._element = document.createElement('div');
10239
- this._element.className = 'dockview-react-part';
10236
+ this._element.className = 'dv-react-part';
10240
10237
  this._element.style.height = '100%';
10241
10238
  this._element.style.width = '100%';
10242
10239
  }
@@ -10278,7 +10275,7 @@
10278
10275
  this._group = _group;
10279
10276
  this.mutableDisposable = new MutableDisposable();
10280
10277
  this._element = document.createElement('div');
10281
- this._element.className = 'dockview-react-part';
10278
+ this._element.className = 'dv-react-part';
10282
10279
  this._element.style.height = '100%';
10283
10280
  this._element.style.width = '100%';
10284
10281
  }
@@ -10337,8 +10334,8 @@
10337
10334
  : undefined;
10338
10335
  }
10339
10336
  const DEFAULT_REACT_TAB = 'props.defaultTabComponent';
10340
- function extractCoreOptions(props) {
10341
- const coreOptions = PROPERTY_KEYS.reduce((obj, key) => {
10337
+ function extractCoreOptions$3(props) {
10338
+ const coreOptions = PROPERTY_KEYS_DOCKVIEW.reduce((obj, key) => {
10342
10339
  if (key in props) {
10343
10340
  obj[key] = props[key];
10344
10341
  }
@@ -10354,7 +10351,7 @@
10354
10351
  const prevProps = React.useRef({});
10355
10352
  React.useEffect(() => {
10356
10353
  const changes = {};
10357
- PROPERTY_KEYS.forEach((propKey) => {
10354
+ PROPERTY_KEYS_DOCKVIEW.forEach((propKey) => {
10358
10355
  const key = propKey;
10359
10356
  const propValue = props[key];
10360
10357
  if (key in props && propValue !== prevProps.current[key]) {
@@ -10365,7 +10362,7 @@
10365
10362
  dockviewRef.current.updateOptions(changes);
10366
10363
  }
10367
10364
  prevProps.current = props;
10368
- }, PROPERTY_KEYS.map((key) => props[key]));
10365
+ }, PROPERTY_KEYS_DOCKVIEW.map((key) => props[key]));
10369
10366
  React.useEffect(() => {
10370
10367
  var _a;
10371
10368
  if (!domRef.current) {
@@ -10401,7 +10398,7 @@
10401
10398
  ? DEFAULT_REACT_TAB
10402
10399
  : undefined,
10403
10400
  };
10404
- const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
10401
+ const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$3(props)), frameworkOptions));
10405
10402
  const { clientWidth, clientHeight } = domRef.current;
10406
10403
  api.layout(clientWidth, clientHeight);
10407
10404
  if (props.onReady) {
@@ -10612,31 +10609,47 @@
10612
10609
  }
10613
10610
  }
10614
10611
 
10612
+ function extractCoreOptions$2(props) {
10613
+ const coreOptions = PROPERTY_KEYS_SPLITVIEW.reduce((obj, key) => {
10614
+ if (key in props) {
10615
+ obj[key] = props[key];
10616
+ }
10617
+ return obj;
10618
+ }, {});
10619
+ return coreOptions;
10620
+ }
10615
10621
  const SplitviewReact = React.forwardRef((props, ref) => {
10616
10622
  const domRef = React.useRef(null);
10617
10623
  const splitviewRef = React.useRef();
10618
10624
  const [portals, addPortal] = usePortalsLifecycle();
10619
10625
  React.useImperativeHandle(ref, () => domRef.current, []);
10626
+ const prevProps = React.useRef({});
10620
10627
  React.useEffect(() => {
10621
- var _a;
10622
- const api = createSplitview(domRef.current, {
10623
- disableAutoResizing: props.disableAutoResizing,
10624
- orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.HORIZONTAL,
10625
- frameworkComponents: props.components,
10626
- frameworkWrapper: {
10627
- createComponent: (id, componentId, component) => {
10628
- return new ReactPanelView(id, componentId, component, {
10629
- addPortal,
10630
- });
10631
- },
10632
- },
10633
- proportionalLayout: typeof props.proportionalLayout === 'boolean'
10634
- ? props.proportionalLayout
10635
- : true,
10636
- styles: props.hideBorders
10637
- ? { separatorBorder: 'transparent' }
10638
- : undefined,
10628
+ const changes = {};
10629
+ PROPERTY_KEYS_SPLITVIEW.forEach((propKey) => {
10630
+ const key = propKey;
10631
+ const propValue = props[key];
10632
+ if (key in props && propValue !== prevProps.current[key]) {
10633
+ changes[key] = propValue;
10634
+ }
10639
10635
  });
10636
+ if (splitviewRef.current) {
10637
+ splitviewRef.current.updateOptions(changes);
10638
+ }
10639
+ prevProps.current = props;
10640
+ }, PROPERTY_KEYS_SPLITVIEW.map((key) => props[key]));
10641
+ React.useEffect(() => {
10642
+ if (!domRef.current) {
10643
+ return () => {
10644
+ // noop
10645
+ };
10646
+ }
10647
+ const frameworkOptions = {
10648
+ createComponent: (options) => {
10649
+ return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
10650
+ },
10651
+ };
10652
+ const api = createSplitview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$2(props)), frameworkOptions));
10640
10653
  const { clientWidth, clientHeight } = domRef.current;
10641
10654
  api.layout(clientWidth, clientHeight);
10642
10655
  if (props.onReady) {
@@ -10652,7 +10665,9 @@
10652
10665
  return;
10653
10666
  }
10654
10667
  splitviewRef.current.updateOptions({
10655
- frameworkComponents: props.components,
10668
+ createComponent: (options) => {
10669
+ return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
10670
+ },
10656
10671
  });
10657
10672
  }, [props.components]);
10658
10673
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
@@ -10677,36 +10692,47 @@
10677
10692
  }
10678
10693
  }
10679
10694
 
10695
+ function extractCoreOptions$1(props) {
10696
+ const coreOptions = PROPERTY_KEYS_GRIDVIEW.reduce((obj, key) => {
10697
+ if (key in props) {
10698
+ obj[key] = props[key];
10699
+ }
10700
+ return obj;
10701
+ }, {});
10702
+ return coreOptions;
10703
+ }
10680
10704
  const GridviewReact = React.forwardRef((props, ref) => {
10681
10705
  const domRef = React.useRef(null);
10682
10706
  const gridviewRef = React.useRef();
10683
10707
  const [portals, addPortal] = usePortalsLifecycle();
10684
10708
  React.useImperativeHandle(ref, () => domRef.current, []);
10709
+ const prevProps = React.useRef({});
10710
+ React.useEffect(() => {
10711
+ const changes = {};
10712
+ PROPERTY_KEYS_GRIDVIEW.forEach((propKey) => {
10713
+ const key = propKey;
10714
+ const propValue = props[key];
10715
+ if (key in props && propValue !== prevProps.current[key]) {
10716
+ changes[key] = propValue;
10717
+ }
10718
+ });
10719
+ if (gridviewRef.current) {
10720
+ gridviewRef.current.updateOptions(changes);
10721
+ }
10722
+ prevProps.current = props;
10723
+ }, PROPERTY_KEYS_GRIDVIEW.map((key) => props[key]));
10685
10724
  React.useEffect(() => {
10686
- var _a;
10687
10725
  if (!domRef.current) {
10688
10726
  return () => {
10689
10727
  // noop
10690
10728
  };
10691
10729
  }
10692
- const api = createGridview(domRef.current, {
10693
- disableAutoResizing: props.disableAutoResizing,
10694
- proportionalLayout: typeof props.proportionalLayout === 'boolean'
10695
- ? props.proportionalLayout
10696
- : true,
10697
- orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.HORIZONTAL,
10698
- frameworkComponents: props.components,
10699
- frameworkComponentFactory: {
10700
- createComponent: (id, componentId, component) => {
10701
- return new ReactGridPanelView(id, componentId, component, {
10702
- addPortal,
10703
- });
10704
- },
10730
+ const frameworkOptions = {
10731
+ createComponent: (options) => {
10732
+ return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
10705
10733
  },
10706
- styles: props.hideBorders
10707
- ? { separatorBorder: 'transparent' }
10708
- : undefined,
10709
- });
10734
+ };
10735
+ const api = createGridview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$1(props)), frameworkOptions));
10710
10736
  const { clientWidth, clientHeight } = domRef.current;
10711
10737
  api.layout(clientWidth, clientHeight);
10712
10738
  if (props.onReady) {
@@ -10722,7 +10748,9 @@
10722
10748
  return;
10723
10749
  }
10724
10750
  gridviewRef.current.updateOptions({
10725
- frameworkComponents: props.components,
10751
+ createComponent: (options) => {
10752
+ return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
10753
+ },
10726
10754
  });
10727
10755
  }, [props.components]);
10728
10756
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
@@ -10764,32 +10792,52 @@
10764
10792
  }
10765
10793
  }
10766
10794
 
10795
+ function extractCoreOptions(props) {
10796
+ const coreOptions = PROPERTY_KEYS_PANEVIEW.reduce((obj, key) => {
10797
+ if (key in props) {
10798
+ obj[key] = props[key];
10799
+ }
10800
+ return obj;
10801
+ }, {});
10802
+ return coreOptions;
10803
+ }
10767
10804
  const PaneviewReact = React.forwardRef((props, ref) => {
10768
10805
  const domRef = React.useRef(null);
10769
10806
  const paneviewRef = React.useRef();
10770
10807
  const [portals, addPortal] = usePortalsLifecycle();
10771
10808
  React.useImperativeHandle(ref, () => domRef.current, []);
10809
+ const prevProps = React.useRef({});
10772
10810
  React.useEffect(() => {
10773
- const createComponent = (id, _componentId, component) => new PanePanelSection(id, component, {
10774
- addPortal,
10811
+ const changes = {};
10812
+ PROPERTY_KEYS_PANEVIEW.forEach((propKey) => {
10813
+ const key = propKey;
10814
+ const propValue = props[key];
10815
+ if (key in props && propValue !== prevProps.current[key]) {
10816
+ changes[key] = propValue;
10817
+ }
10775
10818
  });
10776
- const api = createPaneview(domRef.current, {
10777
- disableAutoResizing: props.disableAutoResizing,
10778
- frameworkComponents: props.components,
10779
- components: {},
10780
- headerComponents: {},
10781
- disableDnd: props.disableDnd,
10782
- headerframeworkComponents: props.headerComponents,
10783
- frameworkWrapper: {
10784
- header: {
10785
- createComponent,
10786
- },
10787
- body: {
10788
- createComponent,
10789
- },
10819
+ if (paneviewRef.current) {
10820
+ paneviewRef.current.updateOptions(changes);
10821
+ }
10822
+ prevProps.current = props;
10823
+ }, PROPERTY_KEYS_PANEVIEW.map((key) => props[key]));
10824
+ React.useEffect(() => {
10825
+ var _a;
10826
+ if (!domRef.current) {
10827
+ return () => {
10828
+ // noop
10829
+ };
10830
+ }
10831
+ const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
10832
+ const frameworkOptions = {
10833
+ createComponent: (options) => {
10834
+ return new PanePanelSection(options.id, props.components[options.name], { addPortal });
10790
10835
  },
10791
- showDndOverlay: props.showDndOverlay,
10792
- });
10836
+ createHeaderComponent: (options) => {
10837
+ return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
10838
+ },
10839
+ };
10840
+ const api = createPaneview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
10793
10841
  const { clientWidth, clientHeight } = domRef.current;
10794
10842
  api.layout(clientWidth, clientHeight);
10795
10843
  if (props.onReady) {
@@ -10805,41 +10853,38 @@
10805
10853
  return;
10806
10854
  }
10807
10855
  paneviewRef.current.updateOptions({
10808
- frameworkComponents: props.components,
10856
+ createComponent: (options) => {
10857
+ return new PanePanelSection(options.id, props.components[options.name], { addPortal });
10858
+ },
10809
10859
  });
10810
10860
  }, [props.components]);
10811
10861
  React.useEffect(() => {
10862
+ var _a;
10812
10863
  if (!paneviewRef.current) {
10813
10864
  return;
10814
10865
  }
10866
+ const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
10815
10867
  paneviewRef.current.updateOptions({
10816
- headerframeworkComponents: props.headerComponents,
10868
+ createHeaderComponent: (options) => {
10869
+ return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
10870
+ },
10817
10871
  });
10818
10872
  }, [props.headerComponents]);
10819
10873
  React.useEffect(() => {
10820
10874
  if (!paneviewRef.current) {
10821
10875
  return () => {
10822
- //
10876
+ // noop
10823
10877
  };
10824
10878
  }
10825
- const api = paneviewRef.current;
10826
- const disposable = api.onDidDrop((event) => {
10879
+ const disposable = paneviewRef.current.onDidDrop((event) => {
10827
10880
  if (props.onDidDrop) {
10828
- props.onDidDrop(Object.assign(Object.assign({}, event), { api }));
10881
+ props.onDidDrop(event);
10829
10882
  }
10830
10883
  });
10831
10884
  return () => {
10832
10885
  disposable.dispose();
10833
10886
  };
10834
10887
  }, [props.onDidDrop]);
10835
- React.useEffect(() => {
10836
- if (!paneviewRef.current) {
10837
- return;
10838
- }
10839
- paneviewRef.current.updateOptions({
10840
- showDndOverlay: props.showDndOverlay,
10841
- });
10842
- }, [props.showDndOverlay]);
10843
10888
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10844
10889
  });
10845
10890
  PaneviewReact.displayName = 'PaneviewComponent';
@@ -10867,7 +10912,10 @@
10867
10912
  exports.GridviewComponent = GridviewComponent;
10868
10913
  exports.GridviewPanel = GridviewPanel;
10869
10914
  exports.GridviewReact = GridviewReact;
10870
- exports.PROPERTY_KEYS = PROPERTY_KEYS;
10915
+ exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
10916
+ exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
10917
+ exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
10918
+ exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
10871
10919
  exports.PaneFramework = PaneFramework;
10872
10920
  exports.PaneTransfer = PaneTransfer;
10873
10921
  exports.PanelTransfer = PanelTransfer;
@@ -10876,6 +10924,7 @@
10876
10924
  exports.PaneviewComponent = PaneviewComponent;
10877
10925
  exports.PaneviewPanel = PaneviewPanel;
10878
10926
  exports.PaneviewReact = PaneviewReact;
10927
+ exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
10879
10928
  exports.ReactPart = ReactPart;
10880
10929
  exports.ReactPartContext = ReactPartContext;
10881
10930
  exports.Splitview = Splitview;