dockview-core 2.1.3 → 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 (81) hide show
  1. package/dist/cjs/api/component.api.d.ts +4 -3
  2. package/dist/cjs/api/component.api.js +8 -22
  3. package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +2 -1
  4. package/dist/cjs/dockview/components/titlebar/tabsContainer.js +30 -33
  5. package/dist/cjs/dockview/dockviewComponent.d.ts +0 -1
  6. package/dist/cjs/dockview/dockviewComponent.js +8 -13
  7. package/dist/cjs/dockview/options.d.ts +4 -8
  8. package/dist/cjs/dockview/options.js +28 -20
  9. package/dist/cjs/events.d.ts +9 -0
  10. package/dist/cjs/events.js +18 -1
  11. package/dist/cjs/gridview/gridviewComponent.js +15 -24
  12. package/dist/cjs/gridview/options.d.ts +10 -12
  13. package/dist/cjs/gridview/options.js +15 -0
  14. package/dist/cjs/index.d.ts +4 -4
  15. package/dist/cjs/index.js +8 -1
  16. package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +2 -2
  17. package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +6 -2
  18. package/dist/cjs/paneview/draggablePaneviewPanel.js +8 -9
  19. package/dist/cjs/paneview/options.d.ts +25 -21
  20. package/dist/cjs/paneview/options.js +42 -0
  21. package/dist/cjs/paneview/paneviewComponent.d.ts +12 -15
  22. package/dist/cjs/paneview/paneviewComponent.js +30 -40
  23. package/dist/cjs/paneview/paneviewPanel.d.ts +3 -8
  24. package/dist/cjs/splitview/options.d.ts +7 -9
  25. package/dist/cjs/splitview/options.js +17 -0
  26. package/dist/cjs/splitview/splitview.d.ts +5 -5
  27. package/dist/cjs/splitview/splitviewComponent.js +10 -21
  28. package/dist/dockview-core.amd.js +168 -172
  29. package/dist/dockview-core.amd.js.map +1 -1
  30. package/dist/dockview-core.amd.min.js +2 -2
  31. package/dist/dockview-core.amd.min.js.map +1 -1
  32. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  33. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  34. package/dist/dockview-core.amd.noStyle.js +168 -172
  35. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  36. package/dist/dockview-core.cjs.js +168 -172
  37. package/dist/dockview-core.cjs.js.map +1 -1
  38. package/dist/dockview-core.esm.js +164 -172
  39. package/dist/dockview-core.esm.js.map +1 -1
  40. package/dist/dockview-core.esm.min.js +2 -2
  41. package/dist/dockview-core.esm.min.js.map +1 -1
  42. package/dist/dockview-core.js +168 -172
  43. package/dist/dockview-core.js.map +1 -1
  44. package/dist/dockview-core.min.js +2 -2
  45. package/dist/dockview-core.min.js.map +1 -1
  46. package/dist/dockview-core.min.noStyle.js +2 -2
  47. package/dist/dockview-core.min.noStyle.js.map +1 -1
  48. package/dist/dockview-core.noStyle.js +168 -172
  49. package/dist/dockview-core.noStyle.js.map +1 -1
  50. package/dist/esm/api/component.api.d.ts +4 -3
  51. package/dist/esm/api/component.api.js +4 -10
  52. package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +2 -1
  53. package/dist/esm/dockview/components/titlebar/tabsContainer.js +20 -23
  54. package/dist/esm/dockview/dockviewComponent.d.ts +0 -1
  55. package/dist/esm/dockview/dockviewComponent.js +8 -13
  56. package/dist/esm/dockview/options.d.ts +4 -8
  57. package/dist/esm/dockview/options.js +4 -9
  58. package/dist/esm/events.d.ts +9 -0
  59. package/dist/esm/events.js +11 -0
  60. package/dist/esm/gridview/gridviewComponent.js +15 -24
  61. package/dist/esm/gridview/options.d.ts +10 -12
  62. package/dist/esm/gridview/options.js +14 -1
  63. package/dist/esm/index.d.ts +4 -4
  64. package/dist/esm/index.js +3 -0
  65. package/dist/esm/paneview/defaultPaneviewHeader.d.ts +2 -2
  66. package/dist/esm/paneview/draggablePaneviewPanel.d.ts +6 -2
  67. package/dist/esm/paneview/draggablePaneviewPanel.js +8 -9
  68. package/dist/esm/paneview/options.d.ts +25 -21
  69. package/dist/esm/paneview/options.js +22 -1
  70. package/dist/esm/paneview/paneviewComponent.d.ts +12 -15
  71. package/dist/esm/paneview/paneviewComponent.js +30 -40
  72. package/dist/esm/paneview/paneviewPanel.d.ts +3 -8
  73. package/dist/esm/splitview/options.d.ts +7 -9
  74. package/dist/esm/splitview/options.js +16 -1
  75. package/dist/esm/splitview/splitview.d.ts +5 -5
  76. package/dist/esm/splitview/splitviewComponent.js +10 -21
  77. package/package.json +1 -1
  78. package/dist/cjs/panel/componentFactory.d.ts +0 -11
  79. package/dist/cjs/panel/componentFactory.js +0 -30
  80. package/dist/esm/panel/componentFactory.d.ts +0 -11
  81. package/dist/esm/panel/componentFactory.js +0 -24
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 2.1.3
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`
@@ -7667,10 +7716,6 @@
7667
7716
  this._api = new DockviewApi(this);
7668
7717
  this.updateWatermark();
7669
7718
  }
7670
- dispose() {
7671
- this.clear(); // explicitly clear the layout before cleaning up
7672
- super.dispose();
7673
- }
7674
7719
  setVisible(panel, visible) {
7675
7720
  switch (panel.api.location.type) {
7676
7721
  case 'grid':
@@ -7854,30 +7899,29 @@
7854
7899
  }
7855
7900
  }
7856
7901
  else if (this.getPanel(group.id)) {
7857
- const removedGroup = group;
7902
+ group.model.renderContainer =
7903
+ this.overlayRenderContainer;
7904
+ returnedGroup = group;
7858
7905
  if (floatingBox) {
7859
- this.addFloatingGroup(removedGroup, {
7906
+ this.addFloatingGroup(group, {
7860
7907
  height: floatingBox.height,
7861
7908
  width: floatingBox.width,
7862
7909
  position: floatingBox,
7863
7910
  });
7864
7911
  }
7865
7912
  else {
7866
- this.doRemoveGroup(removedGroup, {
7913
+ this.doRemoveGroup(group, {
7867
7914
  skipDispose: true,
7868
7915
  skipActive: true,
7869
7916
  skipPopoutReturn: true,
7870
7917
  });
7871
- removedGroup.model.renderContainer =
7872
- this.overlayRenderContainer;
7873
- removedGroup.model.location = { type: 'grid' };
7874
- returnedGroup = removedGroup;
7918
+ group.model.location = { type: 'grid' };
7875
7919
  this.movingLock(() => {
7876
7920
  // suppress group add events since the group already exists
7877
- this.doAddGroup(removedGroup, [0]);
7921
+ this.doAddGroup(group, [0]);
7878
7922
  });
7879
7923
  }
7880
- this.doSetGroupAndPanelActive(removedGroup);
7924
+ this.doSetGroupAndPanelActive(group);
7881
7925
  }
7882
7926
  }));
7883
7927
  this._popoutGroups.push(value);
@@ -9018,31 +9062,6 @@
9018
9062
  }
9019
9063
  }
9020
9064
 
9021
- function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
9022
- const Component = typeof componentName === 'string'
9023
- ? components[componentName]
9024
- : undefined;
9025
- const FrameworkComponent = typeof componentName === 'string'
9026
- ? frameworkComponents[componentName]
9027
- : undefined;
9028
- if (Component && FrameworkComponent) {
9029
- throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
9030
- }
9031
- if (FrameworkComponent) {
9032
- if (!createFrameworkComponent) {
9033
- throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
9034
- }
9035
- return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
9036
- }
9037
- if (!Component) {
9038
- if (fallback) {
9039
- return fallback();
9040
- }
9041
- throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
9042
- }
9043
- return new Component(id, componentName);
9044
- }
9045
-
9046
9065
  class GridviewComponent extends BaseGrid {
9047
9066
  get orientation() {
9048
9067
  return this.gridview.orientation;
@@ -9060,10 +9079,13 @@
9060
9079
  this._deserializer = value;
9061
9080
  }
9062
9081
  constructor(parentElement, options) {
9082
+ var _a;
9063
9083
  super(parentElement, {
9064
- proportionalLayout: options.proportionalLayout,
9084
+ proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9065
9085
  orientation: options.orientation,
9066
- styles: options.styles,
9086
+ styles: options.hideBorders
9087
+ ? { separatorBorder: 'transparent' }
9088
+ : undefined,
9067
9089
  disableAutoResizing: options.disableAutoResizing,
9068
9090
  className: options.className,
9069
9091
  });
@@ -9083,12 +9105,6 @@
9083
9105
  }), this.onDidActiveChange((event) => {
9084
9106
  this._onDidActiveGroupChange.fire(event);
9085
9107
  }));
9086
- if (!this.options.components) {
9087
- this.options.components = {};
9088
- }
9089
- if (!this.options.frameworkComponents) {
9090
- this.options.frameworkComponents = {};
9091
- }
9092
9108
  }
9093
9109
  updateOptions(options) {
9094
9110
  super.updateOptions(options);
@@ -9138,14 +9154,11 @@
9138
9154
  const height = this.height;
9139
9155
  this.gridview.deserialize(grid, {
9140
9156
  fromJSON: (node) => {
9141
- var _a, _b;
9142
9157
  const { data } = node;
9143
- 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
9144
- ? {
9145
- createComponent: this.options.frameworkComponentFactory
9146
- .createComponent,
9147
- }
9148
- : undefined);
9158
+ const view = this.options.createComponent({
9159
+ id: data.id,
9160
+ name: data.component,
9161
+ });
9149
9162
  queue.push(() => view.init({
9150
9163
  params: data.params,
9151
9164
  minimumWidth: data.minimumWidth,
@@ -9223,7 +9236,7 @@
9223
9236
  this.doAddGroup(removedPanel, relativeLocation, options.size);
9224
9237
  }
9225
9238
  addPanel(options) {
9226
- var _a, _b, _c, _d, _e, _f;
9239
+ var _a, _b, _c, _d;
9227
9240
  let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
9228
9241
  if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
9229
9242
  const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
@@ -9239,14 +9252,12 @@
9239
9252
  relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
9240
9253
  }
9241
9254
  }
9242
- 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
9243
- ? {
9244
- createComponent: this.options.frameworkComponentFactory
9245
- .createComponent,
9246
- }
9247
- : undefined);
9255
+ const view = this.options.createComponent({
9256
+ id: options.id,
9257
+ name: options.component,
9258
+ });
9248
9259
  view.init({
9249
- params: (_f = options.params) !== null && _f !== void 0 ? _f : {},
9260
+ params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9250
9261
  minimumWidth: options.minimumWidth,
9251
9262
  maximumWidth: options.maximumWidth,
9252
9263
  minimumHeight: options.minimumHeight,
@@ -9374,12 +9385,6 @@
9374
9385
  this._classNames = new Classnames(this.element);
9375
9386
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9376
9387
  this._options = options;
9377
- if (!options.components) {
9378
- options.components = {};
9379
- }
9380
- if (!options.frameworkComponents) {
9381
- options.frameworkComponents = {};
9382
- }
9383
9388
  this.splitview = new Splitview(this.element, options);
9384
9389
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9385
9390
  }
@@ -9442,18 +9447,17 @@
9442
9447
  return this.panels.find((view) => view.id === id);
9443
9448
  }
9444
9449
  addPanel(options) {
9445
- var _a, _b, _c;
9450
+ var _a;
9446
9451
  if (this._panels.has(options.id)) {
9447
9452
  throw new Error(`panel ${options.id} already exists`);
9448
9453
  }
9449
- 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
9450
- ? {
9451
- createComponent: this.options.frameworkWrapper.createComponent,
9452
- }
9453
- : undefined);
9454
+ const view = this.options.createComponent({
9455
+ id: options.id,
9456
+ name: options.component,
9457
+ });
9454
9458
  view.orientation = this.splitview.orientation;
9455
9459
  view.init({
9456
- params: (_c = options.params) !== null && _c !== void 0 ? _c : {},
9460
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9457
9461
  minimumSize: options.minimumSize,
9458
9462
  maximumSize: options.maximumSize,
9459
9463
  snap: options.snap,
@@ -9515,17 +9519,14 @@
9515
9519
  descriptor: {
9516
9520
  size,
9517
9521
  views: views.map((view) => {
9518
- var _a, _b;
9519
9522
  const data = view.data;
9520
9523
  if (this._panels.has(data.id)) {
9521
9524
  throw new Error(`panel ${data.id} already exists`);
9522
9525
  }
9523
- 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
9524
- ? {
9525
- createComponent: this.options.frameworkWrapper
9526
- .createComponent,
9527
- }
9528
- : undefined);
9526
+ const panel = this.options.createComponent({
9527
+ id: data.id,
9528
+ name: data.component,
9529
+ });
9529
9530
  queue.push(() => {
9530
9531
  var _a;
9531
9532
  panel.init({
@@ -9708,16 +9709,12 @@
9708
9709
  this.onDidAddView = this._onDidAddView.event;
9709
9710
  this._onDidRemoveView = new Emitter();
9710
9711
  this.onDidRemoveView = this._onDidRemoveView.event;
9711
- this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9712
+ this._onUnhandledDragOverEvent = new Emitter();
9713
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9714
+ this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9712
9715
  this._classNames = new Classnames(this.element);
9713
9716
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9714
9717
  this._options = options;
9715
- if (!options.components) {
9716
- options.components = {};
9717
- }
9718
- if (!options.frameworkComponents) {
9719
- options.frameworkComponents = {};
9720
- }
9721
9718
  this.paneview = new Paneview(this.element, {
9722
9719
  // only allow paneview in the vertical orientation for now
9723
9720
  orientation: exports.Orientation.VERTICAL,
@@ -9742,22 +9739,19 @@
9742
9739
  this._options = Object.assign(Object.assign({}, this.options), options);
9743
9740
  }
9744
9741
  addPanel(options) {
9745
- var _a, _b, _c, _d;
9746
- 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
9747
- ? {
9748
- createComponent: this.options.frameworkWrapper.body.createComponent,
9749
- }
9750
- : undefined);
9742
+ var _a;
9743
+ const body = this.options.createComponent({
9744
+ id: options.id,
9745
+ name: options.component,
9746
+ });
9751
9747
  let header;
9752
- if (options.headerComponent) {
9753
- header = createComponent(options.id, options.headerComponent, (_c = this.options.headerComponents) !== null && _c !== void 0 ? _c : {}, this.options.headerframeworkComponents, this.options.frameworkWrapper
9754
- ? {
9755
- createComponent: this.options.frameworkWrapper.header
9756
- .createComponent,
9757
- }
9758
- : undefined);
9748
+ if (options.headerComponent && this.options.createHeaderComponent) {
9749
+ header = this.options.createHeaderComponent({
9750
+ id: options.id,
9751
+ name: options.headerComponent,
9752
+ });
9759
9753
  }
9760
- else {
9754
+ if (!header) {
9761
9755
  header = new DefaultHeader();
9762
9756
  }
9763
9757
  const view = new PaneFramework({
@@ -9775,7 +9769,7 @@
9775
9769
  const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
9776
9770
  const index = typeof options.index === 'number' ? options.index : undefined;
9777
9771
  view.init({
9778
- params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9772
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9779
9773
  minimumBodySize: options.minimumBodySize,
9780
9774
  maximumBodySize: options.maximumBodySize,
9781
9775
  isExpanded: options.isExpanded,
@@ -9840,24 +9834,20 @@
9840
9834
  descriptor: {
9841
9835
  size,
9842
9836
  views: views.map((view) => {
9843
- var _a, _b, _c, _d;
9844
9837
  const data = view.data;
9845
- 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
9846
- ? {
9847
- createComponent: this.options.frameworkWrapper.body
9848
- .createComponent,
9849
- }
9850
- : undefined);
9838
+ const body = this.options.createComponent({
9839
+ id: data.id,
9840
+ name: data.component,
9841
+ });
9851
9842
  let header;
9852
- if (data.headerComponent) {
9853
- 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
9854
- ? {
9855
- createComponent: this.options.frameworkWrapper.header
9856
- .createComponent,
9857
- }
9858
- : undefined);
9843
+ if (data.headerComponent &&
9844
+ this.options.createHeaderComponent) {
9845
+ header = this.options.createHeaderComponent({
9846
+ id: data.id,
9847
+ name: data.headerComponent,
9848
+ });
9859
9849
  }
9860
- else {
9850
+ if (!header) {
9861
9851
  header = new DefaultHeader();
9862
9852
  }
9863
9853
  const panel = new PaneFramework({
@@ -9905,9 +9895,11 @@
9905
9895
  this.paneview.dispose();
9906
9896
  }
9907
9897
  doAddPanel(panel) {
9908
- const disposable = panel.onDidDrop((event) => {
9898
+ const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
9909
9899
  this._onDidDrop.fire(event);
9910
- });
9900
+ }), panel.onUnhandledDragOverEvent((event) => {
9901
+ this._onUnhandledDragOverEvent.fire(event);
9902
+ }));
9911
9903
  this._viewDisposables.set(panel.id, disposable);
9912
9904
  }
9913
9905
  doRemovePanel(panel) {
@@ -10069,7 +10061,10 @@
10069
10061
  exports.GridviewApi = GridviewApi;
10070
10062
  exports.GridviewComponent = GridviewComponent;
10071
10063
  exports.GridviewPanel = GridviewPanel;
10072
- exports.PROPERTY_KEYS = PROPERTY_KEYS;
10064
+ exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
10065
+ exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
10066
+ exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
10067
+ exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
10073
10068
  exports.PaneFramework = PaneFramework;
10074
10069
  exports.PaneTransfer = PaneTransfer;
10075
10070
  exports.PanelTransfer = PanelTransfer;
@@ -10077,6 +10072,7 @@
10077
10072
  exports.PaneviewApi = PaneviewApi;
10078
10073
  exports.PaneviewComponent = PaneviewComponent;
10079
10074
  exports.PaneviewPanel = PaneviewPanel;
10075
+ exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
10080
10076
  exports.Splitview = Splitview;
10081
10077
  exports.SplitviewApi = SplitviewApi;
10082
10078
  exports.SplitviewComponent = SplitviewComponent;