dockview-core 2.1.4 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) 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/options.d.ts +4 -8
  6. package/dist/cjs/dockview/options.js +28 -20
  7. package/dist/cjs/events.d.ts +9 -0
  8. package/dist/cjs/events.js +18 -1
  9. package/dist/cjs/gridview/baseComponentGridview.js +1 -2
  10. package/dist/cjs/gridview/gridviewComponent.js +15 -24
  11. package/dist/cjs/gridview/options.d.ts +10 -12
  12. package/dist/cjs/gridview/options.js +15 -0
  13. package/dist/cjs/index.d.ts +4 -4
  14. package/dist/cjs/index.js +8 -1
  15. package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +2 -2
  16. package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +6 -2
  17. package/dist/cjs/paneview/draggablePaneviewPanel.js +8 -9
  18. package/dist/cjs/paneview/options.d.ts +25 -21
  19. package/dist/cjs/paneview/options.js +42 -0
  20. package/dist/cjs/paneview/paneviewComponent.d.ts +12 -15
  21. package/dist/cjs/paneview/paneviewComponent.js +30 -40
  22. package/dist/cjs/paneview/paneviewPanel.d.ts +3 -8
  23. package/dist/cjs/splitview/options.d.ts +7 -9
  24. package/dist/cjs/splitview/options.js +17 -0
  25. package/dist/cjs/splitview/splitview.d.ts +5 -5
  26. package/dist/cjs/splitview/splitviewComponent.js +10 -21
  27. package/dist/dockview-core.amd.js +161 -161
  28. package/dist/dockview-core.amd.js.map +1 -1
  29. package/dist/dockview-core.amd.min.js +2 -2
  30. package/dist/dockview-core.amd.min.js.map +1 -1
  31. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  32. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  33. package/dist/dockview-core.amd.noStyle.js +161 -161
  34. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  35. package/dist/dockview-core.cjs.js +161 -161
  36. package/dist/dockview-core.cjs.js.map +1 -1
  37. package/dist/dockview-core.esm.js +157 -161
  38. package/dist/dockview-core.esm.js.map +1 -1
  39. package/dist/dockview-core.esm.min.js +2 -2
  40. package/dist/dockview-core.esm.min.js.map +1 -1
  41. package/dist/dockview-core.js +161 -161
  42. package/dist/dockview-core.js.map +1 -1
  43. package/dist/dockview-core.min.js +2 -2
  44. package/dist/dockview-core.min.js.map +1 -1
  45. package/dist/dockview-core.min.noStyle.js +2 -2
  46. package/dist/dockview-core.min.noStyle.js.map +1 -1
  47. package/dist/dockview-core.noStyle.js +161 -161
  48. package/dist/dockview-core.noStyle.js.map +1 -1
  49. package/dist/esm/api/component.api.d.ts +4 -3
  50. package/dist/esm/api/component.api.js +4 -10
  51. package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +2 -1
  52. package/dist/esm/dockview/components/titlebar/tabsContainer.js +20 -23
  53. package/dist/esm/dockview/options.d.ts +4 -8
  54. package/dist/esm/dockview/options.js +4 -9
  55. package/dist/esm/events.d.ts +9 -0
  56. package/dist/esm/events.js +11 -0
  57. package/dist/esm/gridview/baseComponentGridview.js +1 -2
  58. package/dist/esm/gridview/gridviewComponent.js +15 -24
  59. package/dist/esm/gridview/options.d.ts +10 -12
  60. package/dist/esm/gridview/options.js +14 -1
  61. package/dist/esm/index.d.ts +4 -4
  62. package/dist/esm/index.js +3 -0
  63. package/dist/esm/paneview/defaultPaneviewHeader.d.ts +2 -2
  64. package/dist/esm/paneview/draggablePaneviewPanel.d.ts +6 -2
  65. package/dist/esm/paneview/draggablePaneviewPanel.js +8 -9
  66. package/dist/esm/paneview/options.d.ts +25 -21
  67. package/dist/esm/paneview/options.js +22 -1
  68. package/dist/esm/paneview/paneviewComponent.d.ts +12 -15
  69. package/dist/esm/paneview/paneviewComponent.js +30 -40
  70. package/dist/esm/paneview/paneviewPanel.d.ts +3 -8
  71. package/dist/esm/splitview/options.d.ts +7 -9
  72. package/dist/esm/splitview/options.js +16 -1
  73. package/dist/esm/splitview/splitview.d.ts +5 -5
  74. package/dist/esm/splitview/splitviewComponent.js +10 -21
  75. package/package.json +1 -1
  76. package/dist/cjs/panel/componentFactory.d.ts +0 -11
  77. package/dist/cjs/panel/componentFactory.js +0 -30
  78. package/dist/esm/panel/componentFactory.d.ts +0 -11
  79. package/dist/esm/panel/componentFactory.js +0 -24
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 2.1.4
3
+ * @version 3.0.1
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -103,6 +103,17 @@
103
103
  this._defaultPrevented = true;
104
104
  }
105
105
  }
106
+ class AcceptableEvent {
107
+ constructor() {
108
+ this._isAccepted = false;
109
+ }
110
+ get isAccepted() {
111
+ return this._isAccepted;
112
+ }
113
+ accept() {
114
+ this._isAccepted = true;
115
+ }
116
+ }
106
117
  class LeakageMonitor {
107
118
  constructor() {
108
119
  this.events = new Map();
@@ -1494,6 +1505,23 @@
1494
1505
  }
1495
1506
  }
1496
1507
 
1508
+ const PROPERTY_KEYS_SPLITVIEW = (() => {
1509
+ /**
1510
+ * by readong the keys from an empty value object TypeScript will error
1511
+ * when we add or remove new properties to `DockviewOptions`
1512
+ */
1513
+ const properties = {
1514
+ orientation: undefined,
1515
+ descriptor: undefined,
1516
+ proportionalLayout: undefined,
1517
+ styles: undefined,
1518
+ margin: undefined,
1519
+ disableAutoResizing: undefined,
1520
+ className: undefined,
1521
+ };
1522
+ return Object.keys(properties);
1523
+ })();
1524
+
1497
1525
  class Paneview extends CompositeDisposable {
1498
1526
  get onDidAddView() {
1499
1527
  return this.splitview.onDidAddView;
@@ -2623,6 +2651,21 @@
2623
2651
  }
2624
2652
  }
2625
2653
 
2654
+ const PROPERTY_KEYS_GRIDVIEW = (() => {
2655
+ /**
2656
+ * by readong the keys from an empty value object TypeScript will error
2657
+ * when we add or remove new properties to `DockviewOptions`
2658
+ */
2659
+ const properties = {
2660
+ disableAutoResizing: undefined,
2661
+ proportionalLayout: undefined,
2662
+ orientation: undefined,
2663
+ hideBorders: undefined,
2664
+ className: undefined,
2665
+ };
2666
+ return Object.keys(properties);
2667
+ })();
2668
+
2626
2669
  class Resizable extends CompositeDisposable {
2627
2670
  get element() {
2628
2671
  return this._element;
@@ -2732,7 +2775,7 @@
2732
2775
  }
2733
2776
  constructor(parentElement, options) {
2734
2777
  var _a;
2735
- super(document.createElement('div'), options.disableAutoResizing);
2778
+ super(parentElement, options.disableAutoResizing);
2736
2779
  this._id = nextLayoutId$1.next();
2737
2780
  this._groups = new Map();
2738
2781
  this._onDidRemove = new Emitter();
@@ -2751,7 +2794,6 @@
2751
2794
  this.element.style.width = '100%';
2752
2795
  this._classNames = new Classnames(this.element);
2753
2796
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
2754
- parentElement.appendChild(this.element);
2755
2797
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
2756
2798
  this.gridview.locked = !!options.locked;
2757
2799
  this.element.appendChild(this.gridview.element);
@@ -3100,15 +3142,10 @@
3100
3142
  * Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
3101
3143
  */
3102
3144
  get onDidDrop() {
3103
- const emitter = new Emitter();
3104
- const disposable = this.component.onDidDrop((e) => {
3105
- emitter.fire(Object.assign(Object.assign({}, e), { api: this }));
3106
- });
3107
- emitter.dispose = () => {
3108
- disposable.dispose();
3109
- emitter.dispose();
3110
- };
3111
- return emitter.event;
3145
+ return this.component.onDidDrop;
3146
+ }
3147
+ get onUnhandledDragOverEvent() {
3148
+ return this.component.onUnhandledDragOverEvent;
3112
3149
  }
3113
3150
  constructor(component) {
3114
3151
  this.component = component;
@@ -4035,6 +4072,28 @@
4035
4072
  return 'center';
4036
4073
  }
4037
4074
 
4075
+ const PROPERTY_KEYS_PANEVIEW = (() => {
4076
+ /**
4077
+ * by readong the keys from an empty value object TypeScript will error
4078
+ * when we add or remove new properties to `DockviewOptions`
4079
+ */
4080
+ const properties = {
4081
+ disableAutoResizing: undefined,
4082
+ disableDnd: undefined,
4083
+ className: undefined,
4084
+ };
4085
+ return Object.keys(properties);
4086
+ })();
4087
+ class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
4088
+ constructor(nativeEvent, position, getData, panel) {
4089
+ super();
4090
+ this.nativeEvent = nativeEvent;
4091
+ this.position = position;
4092
+ this.getData = getData;
4093
+ this.panel = panel;
4094
+ }
4095
+ }
4096
+
4038
4097
  class WillFocusEvent extends DockviewEvent {
4039
4098
  constructor() {
4040
4099
  super();
@@ -4458,6 +4517,9 @@
4458
4517
  this.accessor = accessor;
4459
4518
  this._onDidDrop = new Emitter();
4460
4519
  this.onDidDrop = this._onDidDrop.event;
4520
+ this._onUnhandledDragOverEvent = new Emitter();
4521
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
4522
+ this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
4461
4523
  if (!disableDnd) {
4462
4524
  this.initDragFeatures();
4463
4525
  }
@@ -4484,7 +4546,7 @@
4484
4546
  overlayModel: {
4485
4547
  activationSize: { type: 'percentage', value: 50 },
4486
4548
  },
4487
- canDisplayOverlay: (event) => {
4549
+ canDisplayOverlay: (event, position) => {
4488
4550
  const data = getPaneData();
4489
4551
  if (data) {
4490
4552
  if (data.paneId !== this.id &&
@@ -4492,14 +4554,9 @@
4492
4554
  return true;
4493
4555
  }
4494
4556
  }
4495
- if (this.accessor.options.showDndOverlay) {
4496
- return this.accessor.options.showDndOverlay({
4497
- nativeEvent: event,
4498
- getData: getPaneData,
4499
- panel: this,
4500
- });
4501
- }
4502
- return false;
4557
+ const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
4558
+ this._onUnhandledDragOverEvent.fire(firedEvent);
4559
+ return firedEvent.isAccepted;
4503
4560
  },
4504
4561
  });
4505
4562
  this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
@@ -4954,15 +5011,7 @@
4954
5011
  this._element.appendChild(this.leftActionsContainer);
4955
5012
  this._element.appendChild(this.voidContainer.element);
4956
5013
  this._element.appendChild(this.rightActionsContainer);
4957
- this.addDisposables(this.accessor.onDidAddPanel((e) => {
4958
- if (e.api.group === this.group) {
4959
- toggleClass(this._element, 'dv-single-tab', this.size === 1);
4960
- }
4961
- }), this.accessor.onDidRemovePanel((e) => {
4962
- if (e.api.group === this.group) {
4963
- toggleClass(this._element, 'dv-single-tab', this.size === 1);
4964
- }
4965
- }), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
5014
+ this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
4966
5015
  this._onGroupDragStart.fire({
4967
5016
  nativeEvent: event,
4968
5017
  group: this.group,
@@ -5007,20 +5056,6 @@
5007
5056
  setActive(_isGroupActive) {
5008
5057
  // noop
5009
5058
  }
5010
- addTab(tab, index = this.tabs.length) {
5011
- if (index < 0 || index > this.tabs.length) {
5012
- throw new Error('invalid location');
5013
- }
5014
- this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
5015
- this.tabs = [
5016
- ...this.tabs.slice(0, index),
5017
- tab,
5018
- ...this.tabs.slice(index),
5019
- ];
5020
- if (this.selectedIndex < 0) {
5021
- this.selectedIndex = index;
5022
- }
5023
- }
5024
5059
  delete(id) {
5025
5060
  const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
5026
5061
  const tabToRemove = this.tabs.splice(index, 1)[0];
@@ -5028,6 +5063,7 @@
5028
5063
  disposable.dispose();
5029
5064
  value.dispose();
5030
5065
  value.element.remove();
5066
+ this.updateClassnames();
5031
5067
  }
5032
5068
  setActivePanel(panel) {
5033
5069
  this.tabs.forEach((tab) => {
@@ -5096,25 +5132,37 @@
5096
5132
  }
5097
5133
  this.tabs = [];
5098
5134
  }
5135
+ addTab(tab, index = this.tabs.length) {
5136
+ if (index < 0 || index > this.tabs.length) {
5137
+ throw new Error('invalid location');
5138
+ }
5139
+ this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
5140
+ this.tabs = [
5141
+ ...this.tabs.slice(0, index),
5142
+ tab,
5143
+ ...this.tabs.slice(index),
5144
+ ];
5145
+ if (this.selectedIndex < 0) {
5146
+ this.selectedIndex = index;
5147
+ }
5148
+ this.updateClassnames();
5149
+ }
5150
+ updateClassnames() {
5151
+ toggleClass(this._element, 'dv-single-tab', this.size === 1);
5152
+ }
5099
5153
  }
5100
5154
 
5101
- class DockviewUnhandledDragOverEvent {
5102
- get isAccepted() {
5103
- return this._isAccepted;
5104
- }
5155
+ class DockviewUnhandledDragOverEvent extends AcceptableEvent {
5105
5156
  constructor(nativeEvent, target, position, getData, group) {
5157
+ super();
5106
5158
  this.nativeEvent = nativeEvent;
5107
5159
  this.target = target;
5108
5160
  this.position = position;
5109
5161
  this.getData = getData;
5110
5162
  this.group = group;
5111
- this._isAccepted = false;
5112
- }
5113
- accept() {
5114
- this._isAccepted = true;
5115
5163
  }
5116
5164
  }
5117
- const PROPERTY_KEYS = (() => {
5165
+ const PROPERTY_KEYS_DOCKVIEW = (() => {
5118
5166
  /**
5119
5167
  * by readong the keys from an empty value object TypeScript will error
5120
5168
  * when we add or remove new properties to `DockviewOptions`
@@ -8983,31 +9031,6 @@
8983
9031
  }
8984
9032
  }
8985
9033
 
8986
- function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
8987
- const Component = typeof componentName === 'string'
8988
- ? components[componentName]
8989
- : undefined;
8990
- const FrameworkComponent = typeof componentName === 'string'
8991
- ? frameworkComponents[componentName]
8992
- : undefined;
8993
- if (Component && FrameworkComponent) {
8994
- throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
8995
- }
8996
- if (FrameworkComponent) {
8997
- if (!createFrameworkComponent) {
8998
- throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
8999
- }
9000
- return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
9001
- }
9002
- if (!Component) {
9003
- if (fallback) {
9004
- return fallback();
9005
- }
9006
- throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
9007
- }
9008
- return new Component(id, componentName);
9009
- }
9010
-
9011
9034
  class GridviewComponent extends BaseGrid {
9012
9035
  get orientation() {
9013
9036
  return this.gridview.orientation;
@@ -9025,10 +9048,13 @@
9025
9048
  this._deserializer = value;
9026
9049
  }
9027
9050
  constructor(parentElement, options) {
9051
+ var _a;
9028
9052
  super(parentElement, {
9029
- proportionalLayout: options.proportionalLayout,
9053
+ proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9030
9054
  orientation: options.orientation,
9031
- styles: options.styles,
9055
+ styles: options.hideBorders
9056
+ ? { separatorBorder: 'transparent' }
9057
+ : undefined,
9032
9058
  disableAutoResizing: options.disableAutoResizing,
9033
9059
  className: options.className,
9034
9060
  });
@@ -9048,12 +9074,6 @@
9048
9074
  }), this.onDidActiveChange((event) => {
9049
9075
  this._onDidActiveGroupChange.fire(event);
9050
9076
  }));
9051
- if (!this.options.components) {
9052
- this.options.components = {};
9053
- }
9054
- if (!this.options.frameworkComponents) {
9055
- this.options.frameworkComponents = {};
9056
- }
9057
9077
  }
9058
9078
  updateOptions(options) {
9059
9079
  super.updateOptions(options);
@@ -9103,14 +9123,11 @@
9103
9123
  const height = this.height;
9104
9124
  this.gridview.deserialize(grid, {
9105
9125
  fromJSON: (node) => {
9106
- var _a, _b;
9107
9126
  const { data } = node;
9108
- 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
9109
- ? {
9110
- createComponent: this.options.frameworkComponentFactory
9111
- .createComponent,
9112
- }
9113
- : undefined);
9127
+ const view = this.options.createComponent({
9128
+ id: data.id,
9129
+ name: data.component,
9130
+ });
9114
9131
  queue.push(() => view.init({
9115
9132
  params: data.params,
9116
9133
  minimumWidth: data.minimumWidth,
@@ -9188,7 +9205,7 @@
9188
9205
  this.doAddGroup(removedPanel, relativeLocation, options.size);
9189
9206
  }
9190
9207
  addPanel(options) {
9191
- var _a, _b, _c, _d, _e, _f;
9208
+ var _a, _b, _c, _d;
9192
9209
  let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
9193
9210
  if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
9194
9211
  const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
@@ -9204,14 +9221,12 @@
9204
9221
  relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
9205
9222
  }
9206
9223
  }
9207
- 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
9208
- ? {
9209
- createComponent: this.options.frameworkComponentFactory
9210
- .createComponent,
9211
- }
9212
- : undefined);
9224
+ const view = this.options.createComponent({
9225
+ id: options.id,
9226
+ name: options.component,
9227
+ });
9213
9228
  view.init({
9214
- params: (_f = options.params) !== null && _f !== void 0 ? _f : {},
9229
+ params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9215
9230
  minimumWidth: options.minimumWidth,
9216
9231
  maximumWidth: options.maximumWidth,
9217
9232
  minimumHeight: options.minimumHeight,
@@ -9339,12 +9354,6 @@
9339
9354
  this._classNames = new Classnames(this.element);
9340
9355
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9341
9356
  this._options = options;
9342
- if (!options.components) {
9343
- options.components = {};
9344
- }
9345
- if (!options.frameworkComponents) {
9346
- options.frameworkComponents = {};
9347
- }
9348
9357
  this.splitview = new Splitview(this.element, options);
9349
9358
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9350
9359
  }
@@ -9407,18 +9416,17 @@
9407
9416
  return this.panels.find((view) => view.id === id);
9408
9417
  }
9409
9418
  addPanel(options) {
9410
- var _a, _b, _c;
9419
+ var _a;
9411
9420
  if (this._panels.has(options.id)) {
9412
9421
  throw new Error(`panel ${options.id} already exists`);
9413
9422
  }
9414
- 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
9415
- ? {
9416
- createComponent: this.options.frameworkWrapper.createComponent,
9417
- }
9418
- : undefined);
9423
+ const view = this.options.createComponent({
9424
+ id: options.id,
9425
+ name: options.component,
9426
+ });
9419
9427
  view.orientation = this.splitview.orientation;
9420
9428
  view.init({
9421
- params: (_c = options.params) !== null && _c !== void 0 ? _c : {},
9429
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9422
9430
  minimumSize: options.minimumSize,
9423
9431
  maximumSize: options.maximumSize,
9424
9432
  snap: options.snap,
@@ -9480,17 +9488,14 @@
9480
9488
  descriptor: {
9481
9489
  size,
9482
9490
  views: views.map((view) => {
9483
- var _a, _b;
9484
9491
  const data = view.data;
9485
9492
  if (this._panels.has(data.id)) {
9486
9493
  throw new Error(`panel ${data.id} already exists`);
9487
9494
  }
9488
- 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
9489
- ? {
9490
- createComponent: this.options.frameworkWrapper
9491
- .createComponent,
9492
- }
9493
- : undefined);
9495
+ const panel = this.options.createComponent({
9496
+ id: data.id,
9497
+ name: data.component,
9498
+ });
9494
9499
  queue.push(() => {
9495
9500
  var _a;
9496
9501
  panel.init({
@@ -9673,16 +9678,12 @@
9673
9678
  this.onDidAddView = this._onDidAddView.event;
9674
9679
  this._onDidRemoveView = new Emitter();
9675
9680
  this.onDidRemoveView = this._onDidRemoveView.event;
9676
- this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9681
+ this._onUnhandledDragOverEvent = new Emitter();
9682
+ this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9683
+ this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9677
9684
  this._classNames = new Classnames(this.element);
9678
9685
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9679
9686
  this._options = options;
9680
- if (!options.components) {
9681
- options.components = {};
9682
- }
9683
- if (!options.frameworkComponents) {
9684
- options.frameworkComponents = {};
9685
- }
9686
9687
  this.paneview = new Paneview(this.element, {
9687
9688
  // only allow paneview in the vertical orientation for now
9688
9689
  orientation: exports.Orientation.VERTICAL,
@@ -9707,22 +9708,19 @@
9707
9708
  this._options = Object.assign(Object.assign({}, this.options), options);
9708
9709
  }
9709
9710
  addPanel(options) {
9710
- var _a, _b, _c, _d;
9711
- 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
9712
- ? {
9713
- createComponent: this.options.frameworkWrapper.body.createComponent,
9714
- }
9715
- : undefined);
9711
+ var _a;
9712
+ const body = this.options.createComponent({
9713
+ id: options.id,
9714
+ name: options.component,
9715
+ });
9716
9716
  let header;
9717
- if (options.headerComponent) {
9718
- header = createComponent(options.id, options.headerComponent, (_c = this.options.headerComponents) !== null && _c !== void 0 ? _c : {}, this.options.headerframeworkComponents, this.options.frameworkWrapper
9719
- ? {
9720
- createComponent: this.options.frameworkWrapper.header
9721
- .createComponent,
9722
- }
9723
- : undefined);
9717
+ if (options.headerComponent && this.options.createHeaderComponent) {
9718
+ header = this.options.createHeaderComponent({
9719
+ id: options.id,
9720
+ name: options.headerComponent,
9721
+ });
9724
9722
  }
9725
- else {
9723
+ if (!header) {
9726
9724
  header = new DefaultHeader();
9727
9725
  }
9728
9726
  const view = new PaneFramework({
@@ -9740,7 +9738,7 @@
9740
9738
  const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
9741
9739
  const index = typeof options.index === 'number' ? options.index : undefined;
9742
9740
  view.init({
9743
- params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
9741
+ params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
9744
9742
  minimumBodySize: options.minimumBodySize,
9745
9743
  maximumBodySize: options.maximumBodySize,
9746
9744
  isExpanded: options.isExpanded,
@@ -9805,24 +9803,20 @@
9805
9803
  descriptor: {
9806
9804
  size,
9807
9805
  views: views.map((view) => {
9808
- var _a, _b, _c, _d;
9809
9806
  const data = view.data;
9810
- 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
9811
- ? {
9812
- createComponent: this.options.frameworkWrapper.body
9813
- .createComponent,
9814
- }
9815
- : undefined);
9807
+ const body = this.options.createComponent({
9808
+ id: data.id,
9809
+ name: data.component,
9810
+ });
9816
9811
  let header;
9817
- if (data.headerComponent) {
9818
- 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
9819
- ? {
9820
- createComponent: this.options.frameworkWrapper.header
9821
- .createComponent,
9822
- }
9823
- : undefined);
9812
+ if (data.headerComponent &&
9813
+ this.options.createHeaderComponent) {
9814
+ header = this.options.createHeaderComponent({
9815
+ id: data.id,
9816
+ name: data.headerComponent,
9817
+ });
9824
9818
  }
9825
- else {
9819
+ if (!header) {
9826
9820
  header = new DefaultHeader();
9827
9821
  }
9828
9822
  const panel = new PaneFramework({
@@ -9870,9 +9864,11 @@
9870
9864
  this.paneview.dispose();
9871
9865
  }
9872
9866
  doAddPanel(panel) {
9873
- const disposable = panel.onDidDrop((event) => {
9867
+ const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
9874
9868
  this._onDidDrop.fire(event);
9875
- });
9869
+ }), panel.onUnhandledDragOverEvent((event) => {
9870
+ this._onUnhandledDragOverEvent.fire(event);
9871
+ }));
9876
9872
  this._viewDisposables.set(panel.id, disposable);
9877
9873
  }
9878
9874
  doRemovePanel(panel) {
@@ -10034,7 +10030,10 @@
10034
10030
  exports.GridviewApi = GridviewApi;
10035
10031
  exports.GridviewComponent = GridviewComponent;
10036
10032
  exports.GridviewPanel = GridviewPanel;
10037
- exports.PROPERTY_KEYS = PROPERTY_KEYS;
10033
+ exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
10034
+ exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
10035
+ exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
10036
+ exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
10038
10037
  exports.PaneFramework = PaneFramework;
10039
10038
  exports.PaneTransfer = PaneTransfer;
10040
10039
  exports.PanelTransfer = PanelTransfer;
@@ -10042,6 +10041,7 @@
10042
10041
  exports.PaneviewApi = PaneviewApi;
10043
10042
  exports.PaneviewComponent = PaneviewComponent;
10044
10043
  exports.PaneviewPanel = PaneviewPanel;
10044
+ exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
10045
10045
  exports.Splitview = Splitview;
10046
10046
  exports.SplitviewApi = SplitviewApi;
10047
10047
  exports.SplitviewComponent = SplitviewComponent;