dockview 1.15.2 → 1.16.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.
@@ -109,20 +109,19 @@ exports.DockviewReact = react_1.default.forwardRef(function (props, ref) {
109
109
  });
110
110
  }
111
111
  : undefined,
112
- parentElement: domRef.current,
113
112
  defaultTabComponent: props.defaultTabComponent
114
113
  ? DEFAULT_REACT_TAB
115
114
  : undefined,
116
115
  };
117
- var dockview = new dockview_core_1.DockviewComponent(__assign(__assign({}, extractCoreOptions(props)), frameworkOptions));
116
+ var api = (0, dockview_core_1.createDockview)(domRef.current, __assign(__assign({}, extractCoreOptions(props)), frameworkOptions));
118
117
  var _b = domRef.current, clientWidth = _b.clientWidth, clientHeight = _b.clientHeight;
119
- dockview.layout(clientWidth, clientHeight);
118
+ api.layout(clientWidth, clientHeight);
120
119
  if (props.onReady) {
121
- props.onReady({ api: new dockview_core_1.DockviewApi(dockview) });
120
+ props.onReady({ api: api });
122
121
  }
123
- dockviewRef.current = dockview;
122
+ dockviewRef.current = api;
124
123
  return function () {
125
- dockview.dispose();
124
+ api.dispose();
126
125
  };
127
126
  }, []);
128
127
  react_1.default.useEffect(function () {
@@ -36,8 +36,7 @@ exports.GridviewReact = react_1.default.forwardRef(function (props, ref) {
36
36
  // noop
37
37
  };
38
38
  }
39
- var gridview = new dockview_core_1.GridviewComponent({
40
- parentElement: domRef.current,
39
+ var api = (0, dockview_core_1.createGridview)(domRef.current, {
41
40
  disableAutoResizing: props.disableAutoResizing,
42
41
  proportionalLayout: typeof props.proportionalLayout === 'boolean'
43
42
  ? props.proportionalLayout
@@ -56,13 +55,13 @@ exports.GridviewReact = react_1.default.forwardRef(function (props, ref) {
56
55
  : undefined,
57
56
  });
58
57
  var _b = domRef.current, clientWidth = _b.clientWidth, clientHeight = _b.clientHeight;
59
- gridview.layout(clientWidth, clientHeight);
58
+ api.layout(clientWidth, clientHeight);
60
59
  if (props.onReady) {
61
- props.onReady({ api: new dockview_core_1.GridviewApi(gridview) });
60
+ props.onReady({ api: api });
62
61
  }
63
- gridviewRef.current = gridview;
62
+ gridviewRef.current = api;
64
63
  return function () {
65
- gridview.dispose();
64
+ api.dispose();
66
65
  };
67
66
  }, []);
68
67
  react_1.default.useEffect(function () {
@@ -46,8 +46,7 @@ exports.PaneviewReact = react_1.default.forwardRef(function (props, ref) {
46
46
  addPortal: addPortal,
47
47
  });
48
48
  };
49
- var paneview = new dockview_core_1.PaneviewComponent({
50
- parentElement: domRef.current,
49
+ var api = (0, dockview_core_1.createPaneview)(domRef.current, {
51
50
  disableAutoResizing: props.disableAutoResizing,
52
51
  frameworkComponents: props.components,
53
52
  components: {},
@@ -64,15 +63,14 @@ exports.PaneviewReact = react_1.default.forwardRef(function (props, ref) {
64
63
  },
65
64
  showDndOverlay: props.showDndOverlay,
66
65
  });
67
- var api = new dockview_core_1.PaneviewApi(paneview);
68
66
  var _a = domRef.current, clientWidth = _a.clientWidth, clientHeight = _a.clientHeight;
69
- paneview.layout(clientWidth, clientHeight);
67
+ api.layout(clientWidth, clientHeight);
70
68
  if (props.onReady) {
71
69
  props.onReady({ api: api });
72
70
  }
73
- paneviewRef.current = paneview;
71
+ paneviewRef.current = api;
74
72
  return function () {
75
- paneview.dispose();
73
+ api.dispose();
76
74
  };
77
75
  }, []);
78
76
  react_1.default.useEffect(function () {
@@ -97,10 +95,10 @@ exports.PaneviewReact = react_1.default.forwardRef(function (props, ref) {
97
95
  //
98
96
  };
99
97
  }
100
- var paneview = paneviewRef.current;
101
- var disposable = paneview.onDidDrop(function (event) {
98
+ var api = paneviewRef.current;
99
+ var disposable = api.onDidDrop(function (event) {
102
100
  if (props.onDidDrop) {
103
- props.onDidDrop(__assign(__assign({}, event), { api: new dockview_core_1.PaneviewApi(paneview) }));
101
+ props.onDidDrop(__assign(__assign({}, event), { api: api }));
104
102
  }
105
103
  });
106
104
  return function () {
@@ -31,8 +31,7 @@ exports.SplitviewReact = react_1.default.forwardRef(function (props, ref) {
31
31
  react_1.default.useImperativeHandle(ref, function () { return domRef.current; }, []);
32
32
  react_1.default.useEffect(function () {
33
33
  var _a;
34
- var splitview = new dockview_core_1.SplitviewComponent({
35
- parentElement: domRef.current,
34
+ var api = (0, dockview_core_1.createSplitview)(domRef.current, {
36
35
  disableAutoResizing: props.disableAutoResizing,
37
36
  orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : dockview_core_1.Orientation.HORIZONTAL,
38
37
  frameworkComponents: props.components,
@@ -51,13 +50,13 @@ exports.SplitviewReact = react_1.default.forwardRef(function (props, ref) {
51
50
  : undefined,
52
51
  });
53
52
  var _b = domRef.current, clientWidth = _b.clientWidth, clientHeight = _b.clientHeight;
54
- splitview.layout(clientWidth, clientHeight);
53
+ api.layout(clientWidth, clientHeight);
55
54
  if (props.onReady) {
56
- props.onReady({ api: new dockview_core_1.SplitviewApi(splitview) });
55
+ props.onReady({ api: api });
57
56
  }
58
- splitviewRef.current = splitview;
57
+ splitviewRef.current = api;
59
58
  return function () {
60
- splitview.dispose();
59
+ api.dispose();
61
60
  };
62
61
  }, []);
63
62
  react_1.default.useEffect(function () {