@aptre/flex-layout 0.1.6 → 0.1.8

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.
package/dist/index.mjs CHANGED
@@ -78,12 +78,7 @@ var Rect = class _Rect {
78
78
  }
79
79
  }
80
80
  removeInsets(insets) {
81
- return new _Rect(
82
- this.x + insets.left,
83
- this.y + insets.top,
84
- Math.max(0, this.width - insets.left - insets.right),
85
- Math.max(0, this.height - insets.top - insets.bottom)
86
- );
81
+ return new _Rect(this.x + insets.left, this.y + insets.top, Math.max(0, this.width - insets.left - insets.right), Math.max(0, this.height - insets.top - insets.bottom));
87
82
  }
88
83
  centerInRect(outerRect) {
89
84
  this.x = (outerRect.width - this.width) / 2;
@@ -159,22 +154,12 @@ var DockLocation = class _DockLocation {
159
154
  if (this === _DockLocation.TOP) {
160
155
  return new Rect(r.x, r.y, r.width, r.height / 2);
161
156
  } else if (this === _DockLocation.BOTTOM) {
162
- return new Rect(
163
- r.x,
164
- r.getBottom() - r.height / 2,
165
- r.width,
166
- r.height / 2
167
- );
157
+ return new Rect(r.x, r.getBottom() - r.height / 2, r.width, r.height / 2);
168
158
  }
169
159
  if (this === _DockLocation.LEFT) {
170
160
  return new Rect(r.x, r.y, r.width / 2, r.height);
171
161
  } else if (this === _DockLocation.RIGHT) {
172
- return new Rect(
173
- r.getRight() - r.width / 2,
174
- r.y,
175
- r.width / 2,
176
- r.height
177
- );
162
+ return new Rect(r.getRight() - r.width / 2, r.y, r.width / 2, r.height);
178
163
  } else {
179
164
  return r.clone();
180
165
  }
@@ -183,39 +168,19 @@ var DockLocation = class _DockLocation {
183
168
  split(rect, size) {
184
169
  if (this === _DockLocation.TOP) {
185
170
  const r1 = new Rect(rect.x, rect.y, rect.width, size);
186
- const r2 = new Rect(
187
- rect.x,
188
- rect.y + size,
189
- rect.width,
190
- rect.height - size
191
- );
171
+ const r2 = new Rect(rect.x, rect.y + size, rect.width, rect.height - size);
192
172
  return { start: r1, end: r2 };
193
173
  } else if (this === _DockLocation.LEFT) {
194
174
  const r1 = new Rect(rect.x, rect.y, size, rect.height);
195
- const r2 = new Rect(
196
- rect.x + size,
197
- rect.y,
198
- rect.width - size,
199
- rect.height
200
- );
175
+ const r2 = new Rect(rect.x + size, rect.y, rect.width - size, rect.height);
201
176
  return { start: r1, end: r2 };
202
177
  }
203
178
  if (this === _DockLocation.RIGHT) {
204
- const r1 = new Rect(
205
- rect.getRight() - size,
206
- rect.y,
207
- size,
208
- rect.height
209
- );
179
+ const r1 = new Rect(rect.getRight() - size, rect.y, size, rect.height);
210
180
  const r2 = new Rect(rect.x, rect.y, rect.width - size, rect.height);
211
181
  return { start: r1, end: r2 };
212
182
  } else {
213
- const r1 = new Rect(
214
- rect.x,
215
- rect.getBottom() - size,
216
- rect.width,
217
- size
218
- );
183
+ const r1 = new Rect(rect.x, rect.getBottom() - size, rect.width, size);
219
184
  const r2 = new Rect(rect.x, rect.y, rect.width, rect.height - size);
220
185
  return { start: r1, end: r2 };
221
186
  }
@@ -288,23 +253,14 @@ var DragDrop = class _DragDrop {
288
253
  this._rootElement = this._document.body;
289
254
  }
290
255
  this.resizeGlass();
291
- this._document.defaultView?.addEventListener(
292
- "resize",
293
- this.resizeGlass
294
- );
256
+ this._document.defaultView?.addEventListener("resize", this.resizeGlass);
295
257
  this._document.body.appendChild(this._glass);
296
258
  this._glass.tabIndex = -1;
297
259
  this._glass.focus();
298
260
  this._glass.addEventListener("keydown", this._onKeyPress);
299
- this._glass.addEventListener("dragenter", this._onDragEnter, {
300
- passive: false
301
- });
302
- this._glass.addEventListener("dragover", this._onMouseMove, {
303
- passive: false
304
- });
305
- this._glass.addEventListener("dragleave", this._onDragLeave, {
306
- passive: false
307
- });
261
+ this._glass.addEventListener("dragenter", this._onDragEnter, { passive: false });
262
+ this._glass.addEventListener("dragover", this._onMouseMove, { passive: false });
263
+ this._glass.addEventListener("dragleave", this._onDragLeave, { passive: false });
308
264
  this._glassShowing = true;
309
265
  this._fDragCancel = fCancel;
310
266
  this._manualGlassManagement = false;
@@ -319,10 +275,7 @@ var DragDrop = class _DragDrop {
319
275
  hideGlass() {
320
276
  if (this._glassShowing) {
321
277
  this._document.body.removeChild(this._glass);
322
- this._document.defaultView?.removeEventListener(
323
- "resize",
324
- this.resizeGlass
325
- );
278
+ this._document.defaultView?.removeEventListener("resize", this.resizeGlass);
326
279
  this._glassShowing = false;
327
280
  this._document = void 0;
328
281
  this._rootElement = void 0;
@@ -366,9 +319,7 @@ var DragDrop = class _DragDrop {
366
319
  this._startX = posEvent.clientX;
367
320
  this._startY = posEvent.clientY;
368
321
  if (!window.matchMedia || window.matchMedia("(pointer: fine)").matches) {
369
- this._setDefaultGlassCursor(
370
- getComputedStyle(event.target).cursor
371
- );
322
+ this._setDefaultGlassCursor(getComputedStyle(event.target).cursor);
372
323
  }
373
324
  this._stopPropagation(event);
374
325
  this._preventDefault(event);
@@ -387,34 +338,16 @@ var DragDrop = class _DragDrop {
387
338
  this._active = true;
388
339
  if (event?.type === "dragenter") {
389
340
  this._dragDepth = 1;
390
- this._rootElement.addEventListener("dragenter", this._onDragEnter, {
391
- passive: false
392
- });
393
- this._rootElement.addEventListener("dragover", this._onMouseMove, {
394
- passive: false
395
- });
396
- this._rootElement.addEventListener("dragleave", this._onDragLeave, {
397
- passive: false
398
- });
399
- this._document.addEventListener("dragend", this._onDragCancel, {
400
- passive: false
401
- });
402
- this._document.addEventListener("drop", this._onMouseUp, {
403
- passive: false
404
- });
341
+ this._rootElement.addEventListener("dragenter", this._onDragEnter, { passive: false });
342
+ this._rootElement.addEventListener("dragover", this._onMouseMove, { passive: false });
343
+ this._rootElement.addEventListener("dragleave", this._onDragLeave, { passive: false });
344
+ this._document.addEventListener("dragend", this._onDragCancel, { passive: false });
345
+ this._document.addEventListener("drop", this._onMouseUp, { passive: false });
405
346
  } else {
406
- this._document.addEventListener("mouseup", this._onMouseUp, {
407
- passive: false
408
- });
409
- this._document.addEventListener("mousemove", this._onMouseMove, {
410
- passive: false
411
- });
412
- this._document.addEventListener("touchend", this._onMouseUp, {
413
- passive: false
414
- });
415
- this._document.addEventListener("touchmove", this._onMouseMove, {
416
- passive: false
417
- });
347
+ this._document.addEventListener("mouseup", this._onMouseUp, { passive: false });
348
+ this._document.addEventListener("mousemove", this._onMouseMove, { passive: false });
349
+ this._document.addEventListener("touchend", this._onMouseUp, { passive: false });
350
+ this._document.addEventListener("touchmove", this._onMouseMove, { passive: false });
418
351
  }
419
352
  }
420
353
  isDragging() {
@@ -490,10 +423,7 @@ var DragDrop = class _DragDrop {
490
423
  this._dragging = true;
491
424
  if (this._fDragStart) {
492
425
  this._setDefaultGlassCursor("move");
493
- this._dragging = this._fDragStart({
494
- clientX: this._startX,
495
- clientY: this._startY
496
- });
426
+ this._dragging = this._fDragStart({ clientX: this._startX, clientY: this._startY });
497
427
  }
498
428
  }
499
429
  if (this._dragging) {
@@ -698,9 +628,7 @@ var Actions = class _Actions {
698
628
  * @returns {Action} the action
699
629
  */
700
630
  static setActiveTabset(tabsetNodeId) {
701
- return new Action(_Actions.SET_ACTIVE_TABSET, {
702
- tabsetNode: tabsetNodeId
703
- });
631
+ return new Action(_Actions.SET_ACTIVE_TABSET, { tabsetNode: tabsetNodeId });
704
632
  }
705
633
  /**
706
634
  * Adjust the splitter between two tabsets
@@ -739,9 +667,7 @@ var Actions = class _Actions {
739
667
  * @returns {Action} the action
740
668
  */
741
669
  static updateModelAttributes(attributes) {
742
- return new Action(_Actions.UPDATE_MODEL_ATTRIBUTES, {
743
- json: attributes
744
- });
670
+ return new Action(_Actions.UPDATE_MODEL_ATTRIBUTES, { json: attributes });
745
671
  }
746
672
  /**
747
673
  * Updates the given nodes json attributes
@@ -750,10 +676,7 @@ var Actions = class _Actions {
750
676
  * @returns {Action} the action
751
677
  */
752
678
  static updateNodeAttributes(nodeId, attributes) {
753
- return new Action(_Actions.UPDATE_NODE_ATTRIBUTES, {
754
- node: nodeId,
755
- json: attributes
756
- });
679
+ return new Action(_Actions.UPDATE_NODE_ATTRIBUTES, { node: nodeId, json: attributes });
757
680
  }
758
681
  static floatTab(nodeId) {
759
682
  return new Action(_Actions.FLOAT_TAB, { node: nodeId });
@@ -804,12 +727,7 @@ var AttributeDefinitions = class {
804
727
  this.nameToAttribute = {};
805
728
  }
806
729
  addWithAll(name, modelName, defaultValue, alwaysWriteJson) {
807
- const attr = new Attribute(
808
- name,
809
- modelName,
810
- defaultValue,
811
- alwaysWriteJson
812
- );
730
+ const attr = new Attribute(name, modelName, defaultValue, alwaysWriteJson);
813
731
  this.attributes.push(attr);
814
732
  this.nameToAttribute[name] = attr;
815
733
  return attr;
@@ -867,9 +785,7 @@ var AttributeDefinitions = class {
867
785
  }
868
786
  toTypescriptInterface(name, parentAttributes) {
869
787
  const lines = [];
870
- const sorted = this.attributes.sort(
871
- (a, b) => a.name.localeCompare(b.name)
872
- );
788
+ const sorted = this.attributes.sort((a, b) => a.name.localeCompare(b.name));
873
789
  lines.push("export interface I" + name + "Attributes {");
874
790
  for (let i = 0; i < sorted.length; i++) {
875
791
  const c = sorted[i];
@@ -891,9 +807,7 @@ var AttributeDefinitions = class {
891
807
  lines.push(" " + c.name + ": " + defValue + ";");
892
808
  } else {
893
809
  const comment = (defaultValue !== void 0 ? "default: " + defValue : "") + (inherited !== void 0 ? " - inherited from global " + inherited : "");
894
- lines.push(
895
- " " + c.name + required + ": " + type + ";" + (comment.length > 0 ? " // " + comment : "")
896
- );
810
+ lines.push(" " + c.name + required + ": " + type + ";" + (comment.length > 0 ? " // " + comment : ""));
897
811
  }
898
812
  }
899
813
  lines.push("}");
@@ -972,6 +886,7 @@ var CLASSES = /* @__PURE__ */ ((CLASSES2) => {
972
886
  CLASSES2["FLEXLAYOUT__TAB_BORDER"] = "flexlayout__tab_border";
973
887
  CLASSES2["FLEXLAYOUT__TAB_BORDER_"] = "flexlayout__tab_border_";
974
888
  CLASSES2["FLEXLAYOUT__TAB_BUTTON"] = "flexlayout__tab_button";
889
+ CLASSES2["FLEXLAYOUT__TAB_BUTTON_STRETCH"] = "flexlayout__tab_button_stretch";
975
890
  CLASSES2["FLEXLAYOUT__TAB_BUTTON_CONTENT"] = "flexlayout__tab_button_content";
976
891
  CLASSES2["FLEXLAYOUT__TAB_BUTTON_LEADING"] = "flexlayout__tab_button_leading";
977
892
  CLASSES2["FLEXLAYOUT__TAB_BUTTON_OVERFLOW"] = "flexlayout__tab_button_overflow";
@@ -1558,9 +1473,7 @@ var RowNode = class _RowNode extends Node {
1558
1473
  child._setTempSize(0);
1559
1474
  } else {
1560
1475
  const minSize = child.getMinSize(this.getOrientation());
1561
- const size = Math.floor(
1562
- availablePixels * (child.getWeight() / totalWeight)
1563
- );
1476
+ const size = Math.floor(availablePixels * (child.getWeight() / totalWeight));
1564
1477
  child._setTempSize(Math.max(minSize, size));
1565
1478
  }
1566
1479
  variableSize += child._getTempSize();
@@ -1574,9 +1487,7 @@ var RowNode = class _RowNode extends Node {
1574
1487
  while (totalSizeGiven < pixelSize) {
1575
1488
  for (const child of drawChildren) {
1576
1489
  if (!(child instanceof SplitterNode)) {
1577
- const prefSize = child._getPrefSize(
1578
- this.getOrientation()
1579
- );
1490
+ const prefSize = child._getPrefSize(this.getOrientation());
1580
1491
  if (!child._isFixed() && (prefSize === void 0 || resizePreferred) && totalSizeGiven < pixelSize) {
1581
1492
  child._setTempSize(child._getTempSize() + 1);
1582
1493
  totalSizeGiven++;
@@ -1621,25 +1532,9 @@ var RowNode = class _RowNode extends Node {
1621
1532
  let p = 0;
1622
1533
  for (const child of drawChildren) {
1623
1534
  if (this.getOrientation() === Orientation.HORZ) {
1624
- child._layout(
1625
- new Rect(
1626
- this._rect.x + p,
1627
- this._rect.y,
1628
- child._getTempSize(),
1629
- this._rect.height
1630
- ),
1631
- metrics
1632
- );
1535
+ child._layout(new Rect(this._rect.x + p, this._rect.y, child._getTempSize(), this._rect.height), metrics);
1633
1536
  } else {
1634
- child._layout(
1635
- new Rect(
1636
- this._rect.x,
1637
- this._rect.y + p,
1638
- this._rect.width,
1639
- child._getTempSize()
1640
- ),
1641
- metrics
1642
- );
1537
+ child._layout(new Rect(this._rect.x, this._rect.y + p, this._rect.width, child._getTempSize()), metrics);
1643
1538
  }
1644
1539
  p += child._getTempSize();
1645
1540
  }
@@ -1769,9 +1664,7 @@ var RowNode = class _RowNode extends Node {
1769
1664
  }
1770
1665
  for (let j = 0; j < subChildChildren.length; j++) {
1771
1666
  const subsubChild = subChildChildren[j];
1772
- subsubChild._setWeight(
1773
- child.getWeight() * subsubChild.getWeight() / subChildrenTotal
1774
- );
1667
+ subsubChild._setWeight(child.getWeight() * subsubChild.getWeight() / subChildrenTotal);
1775
1668
  this._addChild(subsubChild, i + j);
1776
1669
  }
1777
1670
  } else {
@@ -1817,48 +1710,24 @@ var RowNode = class _RowNode extends Node {
1817
1710
  const dockLocation = DockLocation.LEFT;
1818
1711
  const outlineRect = dockLocation.getDockRect(this._rect);
1819
1712
  outlineRect.width = outlineRect.width / 2;
1820
- dropInfo = new DropInfo(
1821
- this,
1822
- outlineRect,
1823
- dockLocation,
1824
- -1,
1825
- "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
1826
- );
1713
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */);
1827
1714
  } else if (x > this._rect.getRight() - margin && yy > h / 2 - half && yy < h / 2 + half) {
1828
1715
  const dockLocation = DockLocation.RIGHT;
1829
1716
  const outlineRect = dockLocation.getDockRect(this._rect);
1830
1717
  outlineRect.width = outlineRect.width / 2;
1831
1718
  outlineRect.x += outlineRect.width;
1832
- dropInfo = new DropInfo(
1833
- this,
1834
- outlineRect,
1835
- dockLocation,
1836
- -1,
1837
- "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
1838
- );
1719
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */);
1839
1720
  } else if (y < this._rect.y + margin && xx > w / 2 - half && xx < w / 2 + half) {
1840
1721
  const dockLocation = DockLocation.TOP;
1841
1722
  const outlineRect = dockLocation.getDockRect(this._rect);
1842
1723
  outlineRect.height = outlineRect.height / 2;
1843
- dropInfo = new DropInfo(
1844
- this,
1845
- outlineRect,
1846
- dockLocation,
1847
- -1,
1848
- "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
1849
- );
1724
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */);
1850
1725
  } else if (y > this._rect.getBottom() - margin && xx > w / 2 - half && xx < w / 2 + half) {
1851
1726
  const dockLocation = DockLocation.BOTTOM;
1852
1727
  const outlineRect = dockLocation.getDockRect(this._rect);
1853
1728
  outlineRect.height = outlineRect.height / 2;
1854
1729
  outlineRect.y += outlineRect.height;
1855
- dropInfo = new DropInfo(
1856
- this,
1857
- outlineRect,
1858
- dockLocation,
1859
- -1,
1860
- "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
1861
- );
1730
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */);
1862
1731
  }
1863
1732
  if (dropInfo !== void 0) {
1864
1733
  if (!dragNode._canDockInto(dragNode, dropInfo)) {
@@ -1886,10 +1755,7 @@ var RowNode = class _RowNode extends Node {
1886
1755
  tabSet = dragNode;
1887
1756
  } else {
1888
1757
  const callback = this._model._getOnCreateTabSet();
1889
- tabSet = new TabSetNode(
1890
- this._model,
1891
- callback ? callback(dragNode) : {}
1892
- );
1758
+ tabSet = new TabSetNode(this._model, callback ? callback(dragNode) : {});
1893
1759
  tabSet._addChild(dragNode);
1894
1760
  }
1895
1761
  let size = this._children.reduce((sum, child) => {
@@ -2014,39 +1880,22 @@ var TabSetNode = class _TabSetNode extends Node {
2014
1880
  attributeDefinitions.add("selected", 0).setType(Attribute.NUMBER);
2015
1881
  attributeDefinitions.add("name", void 0).setType(Attribute.STRING);
2016
1882
  attributeDefinitions.add("config", void 0).setType("any");
2017
- attributeDefinitions.addInherited(
2018
- "enableDeleteWhenEmpty",
2019
- "tabSetEnableDeleteWhenEmpty"
2020
- );
1883
+ attributeDefinitions.addInherited("enableDeleteWhenEmpty", "tabSetEnableDeleteWhenEmpty");
2021
1884
  attributeDefinitions.addInherited("enableDrop", "tabSetEnableDrop");
2022
1885
  attributeDefinitions.addInherited("enableDrag", "tabSetEnableDrag");
2023
1886
  attributeDefinitions.addInherited("enableDivide", "tabSetEnableDivide");
2024
- attributeDefinitions.addInherited(
2025
- "enableMaximize",
2026
- "tabSetEnableMaximize"
2027
- );
1887
+ attributeDefinitions.addInherited("enableMaximize", "tabSetEnableMaximize");
2028
1888
  attributeDefinitions.addInherited("enableClose", "tabSetEnableClose");
2029
- attributeDefinitions.addInherited(
2030
- "classNameTabStrip",
2031
- "tabSetClassNameTabStrip"
2032
- );
2033
- attributeDefinitions.addInherited(
2034
- "classNameHeader",
2035
- "tabSetClassNameHeader"
2036
- );
2037
- attributeDefinitions.addInherited(
2038
- "enableTabStrip",
2039
- "tabSetEnableTabStrip"
2040
- );
1889
+ attributeDefinitions.addInherited("enableSingleTabStretch", "tabSetEnableSingleTabStretch");
1890
+ attributeDefinitions.addInherited("classNameTabStrip", "tabSetClassNameTabStrip");
1891
+ attributeDefinitions.addInherited("classNameHeader", "tabSetClassNameHeader");
1892
+ attributeDefinitions.addInherited("enableTabStrip", "tabSetEnableTabStrip");
2041
1893
  attributeDefinitions.addInherited("borderInsets", "tabSetBorderInsets");
2042
1894
  attributeDefinitions.addInherited("marginInsets", "tabSetMarginInsets");
2043
1895
  attributeDefinitions.addInherited("minWidth", "tabSetMinWidth");
2044
1896
  attributeDefinitions.addInherited("minHeight", "tabSetMinHeight");
2045
1897
  attributeDefinitions.addInherited("headerHeight", "tabSetHeaderHeight");
2046
- attributeDefinitions.addInherited(
2047
- "tabStripHeight",
2048
- "tabSetTabStripHeight"
2049
- );
1898
+ attributeDefinitions.addInherited("tabStripHeight", "tabSetTabStripHeight");
2050
1899
  attributeDefinitions.addInherited("tabLocation", "tabSetTabLocation");
2051
1900
  attributeDefinitions.addInherited("autoSelectTab", "tabSetAutoSelectTab").setType(Attribute.BOOLEAN);
2052
1901
  return attributeDefinitions;
@@ -2125,6 +1974,9 @@ var TabSetNode = class _TabSetNode extends Node {
2125
1974
  isEnableClose() {
2126
1975
  return this._getAttr("enableClose");
2127
1976
  }
1977
+ isEnableSingleTabStretch() {
1978
+ return this._getAttr("enableSingleTabStretch");
1979
+ }
2128
1980
  canMaximize() {
2129
1981
  if (this.isEnableMaximize()) {
2130
1982
  if (this.getModel().getMaximizedTabset() === this) {
@@ -2190,30 +2042,14 @@ var TabSetNode = class _TabSetNode extends Node {
2190
2042
  if (dragNode === this) {
2191
2043
  const dockLocation = DockLocation.CENTER;
2192
2044
  const outlineRect = this._tabHeaderRect;
2193
- dropInfo = new DropInfo(
2194
- this,
2195
- outlineRect,
2196
- dockLocation,
2197
- -1,
2198
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2199
- );
2045
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2200
2046
  } else if (this._contentRect.contains(x, y)) {
2201
2047
  let dockLocation = DockLocation.CENTER;
2202
2048
  if (this._model.getMaximizedTabset() === void 0) {
2203
- dockLocation = DockLocation.getLocation(
2204
- this._contentRect,
2205
- x,
2206
- y
2207
- );
2049
+ dockLocation = DockLocation.getLocation(this._contentRect, x, y);
2208
2050
  }
2209
2051
  const outlineRect = dockLocation.getDockRect(this._rect);
2210
- dropInfo = new DropInfo(
2211
- this,
2212
- outlineRect,
2213
- dockLocation,
2214
- -1,
2215
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2216
- );
2052
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2217
2053
  } else if (this._tabHeaderRect != null && this._tabHeaderRect.contains(x, y)) {
2218
2054
  let r;
2219
2055
  let yy;
@@ -2237,13 +2073,7 @@ var TabSetNode = class _TabSetNode extends Node {
2237
2073
  if (x >= p && x < childCenter) {
2238
2074
  const dockLocation = DockLocation.CENTER;
2239
2075
  const outlineRect = new Rect(r.x - 2, yy, 3, h);
2240
- dropInfo = new DropInfo(
2241
- this,
2242
- outlineRect,
2243
- dockLocation,
2244
- i,
2245
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2246
- );
2076
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, i, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2247
2077
  break;
2248
2078
  }
2249
2079
  p = childCenter;
@@ -2252,13 +2082,7 @@ var TabSetNode = class _TabSetNode extends Node {
2252
2082
  if (dropInfo == null) {
2253
2083
  const dockLocation = DockLocation.CENTER;
2254
2084
  const outlineRect = new Rect(r.getRight() - 2, yy, 3, h);
2255
- dropInfo = new DropInfo(
2256
- this,
2257
- outlineRect,
2258
- dockLocation,
2259
- this._children.length,
2260
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2261
- );
2085
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, this._children.length, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2262
2086
  }
2263
2087
  }
2264
2088
  if (!dragNode._canDockInto(dragNode, dropInfo)) {
@@ -2285,31 +2109,16 @@ var TabSetNode = class _TabSetNode extends Node {
2285
2109
  }
2286
2110
  if (this.isEnableTabStrip()) {
2287
2111
  if (this.getTabLocation() === "top") {
2288
- this._tabHeaderRect = new Rect(
2289
- rect.x,
2290
- rect.y + y,
2291
- rect.width,
2292
- this._calculatedTabBarHeight
2293
- );
2112
+ this._tabHeaderRect = new Rect(rect.x, rect.y + y, rect.width, this._calculatedTabBarHeight);
2294
2113
  } else {
2295
- this._tabHeaderRect = new Rect(
2296
- rect.x,
2297
- rect.y + rect.height - this._calculatedTabBarHeight,
2298
- rect.width,
2299
- this._calculatedTabBarHeight
2300
- );
2114
+ this._tabHeaderRect = new Rect(rect.x, rect.y + rect.height - this._calculatedTabBarHeight, rect.width, this._calculatedTabBarHeight);
2301
2115
  }
2302
2116
  h += this._calculatedTabBarHeight;
2303
2117
  if (this.getTabLocation() === "top") {
2304
2118
  y += this._calculatedTabBarHeight;
2305
2119
  }
2306
2120
  }
2307
- this._contentRect = new Rect(
2308
- rect.x,
2309
- rect.y + y,
2310
- rect.width,
2311
- rect.height - h
2312
- );
2121
+ this._contentRect = new Rect(rect.x, rect.y + y, rect.width, rect.height - h);
2313
2122
  for (let i = 0; i < this._children.length; i++) {
2314
2123
  const child = this._children[i];
2315
2124
  child._layout(this._contentRect, metrics);
@@ -2370,10 +2179,7 @@ var TabSetNode = class _TabSetNode extends Node {
2370
2179
  let tabSet;
2371
2180
  if (dragNode instanceof TabNode) {
2372
2181
  const callback = this._model._getOnCreateTabSet();
2373
- tabSet = new _TabSetNode(
2374
- this._model,
2375
- callback ? callback(dragNode) : {}
2376
- );
2182
+ tabSet = new _TabSetNode(this._model, callback ? callback(dragNode) : {});
2377
2183
  tabSet._addChild(dragNode);
2378
2184
  dragParent = tabSet;
2379
2185
  } else {
@@ -2491,10 +2297,7 @@ function adjustSelectedIndex(parent, removedIndex) {
2491
2297
  }
2492
2298
  }
2493
2299
  function randomUUID() {
2494
- return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(
2495
- /[018]/g,
2496
- (c) => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
2497
- );
2300
+ return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16));
2498
2301
  }
2499
2302
 
2500
2303
  // src/model/BorderNode.ts
@@ -2542,14 +2345,8 @@ var BorderNode = class _BorderNode extends Node {
2542
2345
  attributeDefinitions.addInherited("barSize", "borderBarSize").setType(Attribute.NUMBER);
2543
2346
  attributeDefinitions.addInherited("enableDrop", "borderEnableDrop").setType(Attribute.BOOLEAN);
2544
2347
  attributeDefinitions.addInherited("className", "borderClassName").setType(Attribute.STRING);
2545
- attributeDefinitions.addInherited(
2546
- "autoSelectTabWhenOpen",
2547
- "borderAutoSelectTabWhenOpen"
2548
- ).setType(Attribute.BOOLEAN);
2549
- attributeDefinitions.addInherited(
2550
- "autoSelectTabWhenClosed",
2551
- "borderAutoSelectTabWhenClosed"
2552
- ).setType(Attribute.BOOLEAN);
2348
+ attributeDefinitions.addInherited("autoSelectTabWhenOpen", "borderAutoSelectTabWhenOpen").setType(Attribute.BOOLEAN);
2349
+ attributeDefinitions.addInherited("autoSelectTabWhenClosed", "borderAutoSelectTabWhenClosed").setType(Attribute.BOOLEAN);
2553
2350
  attributeDefinitions.addInherited("size", "borderSize").setType(Attribute.NUMBER);
2554
2351
  attributeDefinitions.addInherited("minSize", "borderMinSize").setType(Attribute.NUMBER);
2555
2352
  attributeDefinitions.addInherited("enableAutoHide", "borderEnableAutoHide").setType(Attribute.BOOLEAN);
@@ -2702,10 +2499,7 @@ var BorderNode = class _BorderNode extends Node {
2702
2499
  _layoutBorderInner(inner, metrics) {
2703
2500
  this._drawChildren = [];
2704
2501
  const location = this._location;
2705
- const split1 = location.split(
2706
- inner,
2707
- this._adjustedSize + this._model.getSplitterSize()
2708
- );
2502
+ const split1 = location.split(inner, this._adjustedSize + this._model.getSplitterSize());
2709
2503
  const split2 = location.reflect().split(split1.start, this._model.getSplitterSize());
2710
2504
  this._contentRect = split2.end;
2711
2505
  for (let i = 0; i < this._children.length; i++) {
@@ -2752,52 +2546,19 @@ var BorderNode = class _BorderNode extends Node {
2752
2546
  childRect = child.getTabRect();
2753
2547
  childCenter = childRect.x + childRect.width / 2;
2754
2548
  if (x >= pos && x < childCenter) {
2755
- const outlineRect = new Rect(
2756
- childRect.x - 2,
2757
- childY,
2758
- 3,
2759
- childHeight
2760
- );
2761
- dropInfo = new DropInfo(
2762
- this,
2763
- outlineRect,
2764
- dockLocation,
2765
- i,
2766
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2767
- );
2549
+ const outlineRect = new Rect(childRect.x - 2, childY, 3, childHeight);
2550
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, i, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2768
2551
  break;
2769
2552
  }
2770
2553
  pos = childCenter;
2771
2554
  }
2772
2555
  if (dropInfo == null) {
2773
- const outlineRect = new Rect(
2774
- childRect.getRight() - 2,
2775
- childY,
2776
- 3,
2777
- childHeight
2778
- );
2779
- dropInfo = new DropInfo(
2780
- this,
2781
- outlineRect,
2782
- dockLocation,
2783
- this._children.length,
2784
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2785
- );
2556
+ const outlineRect = new Rect(childRect.getRight() - 2, childY, 3, childHeight);
2557
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, this._children.length, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2786
2558
  }
2787
2559
  } else {
2788
- const outlineRect = new Rect(
2789
- this._tabHeaderRect.x + 1,
2790
- this._tabHeaderRect.y + 2,
2791
- 3,
2792
- 18
2793
- );
2794
- dropInfo = new DropInfo(
2795
- this,
2796
- outlineRect,
2797
- dockLocation,
2798
- 0,
2799
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2800
- );
2560
+ const outlineRect = new Rect(this._tabHeaderRect.x + 1, this._tabHeaderRect.y + 2, 3, 18);
2561
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, 0, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2801
2562
  }
2802
2563
  } else {
2803
2564
  if (this._children.length > 0) {
@@ -2812,52 +2573,19 @@ var BorderNode = class _BorderNode extends Node {
2812
2573
  childRect = child.getTabRect();
2813
2574
  childCenter = childRect.y + childRect.height / 2;
2814
2575
  if (y >= pos && y < childCenter) {
2815
- const outlineRect = new Rect(
2816
- childX,
2817
- childRect.y - 2,
2818
- childWidth,
2819
- 3
2820
- );
2821
- dropInfo = new DropInfo(
2822
- this,
2823
- outlineRect,
2824
- dockLocation,
2825
- i,
2826
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2827
- );
2576
+ const outlineRect = new Rect(childX, childRect.y - 2, childWidth, 3);
2577
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, i, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2828
2578
  break;
2829
2579
  }
2830
2580
  pos = childCenter;
2831
2581
  }
2832
2582
  if (dropInfo == null) {
2833
- const outlineRect = new Rect(
2834
- childX,
2835
- childRect.getBottom() - 2,
2836
- childWidth,
2837
- 3
2838
- );
2839
- dropInfo = new DropInfo(
2840
- this,
2841
- outlineRect,
2842
- dockLocation,
2843
- this._children.length,
2844
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2845
- );
2583
+ const outlineRect = new Rect(childX, childRect.getBottom() - 2, childWidth, 3);
2584
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, this._children.length, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2846
2585
  }
2847
2586
  } else {
2848
- const outlineRect = new Rect(
2849
- this._tabHeaderRect.x + 2,
2850
- this._tabHeaderRect.y + 1,
2851
- 18,
2852
- 3
2853
- );
2854
- dropInfo = new DropInfo(
2855
- this,
2856
- outlineRect,
2857
- dockLocation,
2858
- 0,
2859
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2860
- );
2587
+ const outlineRect = new Rect(this._tabHeaderRect.x + 2, this._tabHeaderRect.y + 1, 18, 3);
2588
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, 0, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2861
2589
  }
2862
2590
  }
2863
2591
  if (!dragNode._canDockInto(dragNode, dropInfo)) {
@@ -2865,13 +2593,7 @@ var BorderNode = class _BorderNode extends Node {
2865
2593
  }
2866
2594
  } else if (this.getSelected() !== -1 && this._contentRect.contains(x, y)) {
2867
2595
  const outlineRect = this._contentRect;
2868
- dropInfo = new DropInfo(
2869
- this,
2870
- outlineRect,
2871
- dockLocation,
2872
- -1,
2873
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
2874
- );
2596
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
2875
2597
  if (!dragNode._canDockInto(dragNode, dropInfo)) {
2876
2598
  return void 0;
2877
2599
  }
@@ -2909,9 +2631,7 @@ var BorderNode = class _BorderNode extends Node {
2909
2631
  const json = {};
2910
2632
  _BorderNode._attributeDefinitions.toJson(json, this._attributes);
2911
2633
  json.location = this._location.getName();
2912
- json.children = this._children.map(
2913
- (child) => child.toJson()
2914
- );
2634
+ json.children = this._children.map((child) => child.toJson());
2915
2635
  return json;
2916
2636
  }
2917
2637
  /** @internal */
@@ -2923,28 +2643,16 @@ var BorderNode = class _BorderNode extends Node {
2923
2643
  const rootRow = this._model.getRoot();
2924
2644
  if (this._location === DockLocation.TOP) {
2925
2645
  pBounds[0] = outerRect.y + minSize;
2926
- pBounds[1] = Math.max(
2927
- pBounds[0],
2928
- innerRect.getBottom() - splitter.getHeight() - rootRow.getMinHeight()
2929
- );
2646
+ pBounds[1] = Math.max(pBounds[0], innerRect.getBottom() - splitter.getHeight() - rootRow.getMinHeight());
2930
2647
  } else if (this._location === DockLocation.LEFT) {
2931
2648
  pBounds[0] = outerRect.x + minSize;
2932
- pBounds[1] = Math.max(
2933
- pBounds[0],
2934
- innerRect.getRight() - splitter.getWidth() - rootRow.getMinWidth()
2935
- );
2649
+ pBounds[1] = Math.max(pBounds[0], innerRect.getRight() - splitter.getWidth() - rootRow.getMinWidth());
2936
2650
  } else if (this._location === DockLocation.BOTTOM) {
2937
2651
  pBounds[1] = outerRect.getBottom() - splitter.getHeight() - minSize;
2938
- pBounds[0] = Math.min(
2939
- pBounds[1],
2940
- innerRect.y + rootRow.getMinHeight()
2941
- );
2652
+ pBounds[0] = Math.min(pBounds[1], innerRect.y + rootRow.getMinHeight());
2942
2653
  } else if (this._location === DockLocation.RIGHT) {
2943
2654
  pBounds[1] = outerRect.getRight() - splitter.getWidth() - minSize;
2944
- pBounds[0] = Math.min(
2945
- pBounds[1],
2946
- innerRect.x + rootRow.getMinWidth()
2947
- );
2655
+ pBounds[0] = Math.min(pBounds[1], innerRect.x + rootRow.getMinWidth());
2948
2656
  }
2949
2657
  return pBounds;
2950
2658
  }
@@ -3026,36 +2734,13 @@ function getRenderStateEx(layout, node, iconFactory, titleFactory, iconAngle) {
3026
2734
  }
3027
2735
  if (leadingContent === void 0 && node.getIcon() !== void 0) {
3028
2736
  if (iconAngle !== 0) {
3029
- leadingContent = /* @__PURE__ */ React.createElement(
3030
- "img",
3031
- {
3032
- style: {
3033
- width: "1em",
3034
- height: "1em",
3035
- transform: "rotate(" + iconAngle + "deg)"
3036
- },
3037
- src: node.getIcon(),
3038
- alt: "leadingContent"
3039
- }
3040
- );
2737
+ leadingContent = /* @__PURE__ */ React.createElement("img", { style: { width: "1em", height: "1em", transform: "rotate(" + iconAngle + "deg)" }, src: node.getIcon(), alt: "leadingContent" });
3041
2738
  } else {
3042
- leadingContent = /* @__PURE__ */ React.createElement(
3043
- "img",
3044
- {
3045
- style: { width: "1em", height: "1em" },
3046
- src: node.getIcon(),
3047
- alt: "leadingContent"
3048
- }
3049
- );
2739
+ leadingContent = /* @__PURE__ */ React.createElement("img", { style: { width: "1em", height: "1em" }, src: node.getIcon(), alt: "leadingContent" });
3050
2740
  }
3051
2741
  }
3052
2742
  let buttons = [];
3053
- const renderState = {
3054
- leading: leadingContent,
3055
- content: titleContent,
3056
- name,
3057
- buttons
3058
- };
2743
+ const renderState = { leading: leadingContent, content: titleContent, name, buttons };
3059
2744
  layout.customizeTab(node, renderState);
3060
2745
  node._setRenderedName(renderState.name);
3061
2746
  return renderState;
@@ -3079,28 +2764,12 @@ function isAuxMouseEvent(event) {
3079
2764
 
3080
2765
  // src/view/BorderButton.tsx
3081
2766
  var BorderButton = (props) => {
3082
- const {
3083
- layout,
3084
- node,
3085
- selected,
3086
- border,
3087
- iconFactory,
3088
- titleFactory,
3089
- icons,
3090
- path
3091
- } = props;
2767
+ const { layout, node, selected, border, iconFactory, titleFactory, icons, path } = props;
3092
2768
  const selfRef = React2.useRef(null);
3093
2769
  const contentRef = React2.useRef(null);
3094
2770
  const onMouseDown = (event) => {
3095
2771
  if (!isAuxMouseEvent(event) && !layout.getEditingTab()) {
3096
- layout.dragStart(
3097
- event,
3098
- void 0,
3099
- node,
3100
- node.isEnableDrag(),
3101
- onClick,
3102
- onDoubleClick
3103
- );
2772
+ layout.dragStart(event, void 0, node, node.isEnableDrag(), onClick, onDoubleClick);
3104
2773
  }
3105
2774
  };
3106
2775
  const onAuxMouseClick = (event) => {
@@ -3155,14 +2824,7 @@ var BorderButton = (props) => {
3155
2824
  const layoutRect = layout.getDomRect();
3156
2825
  const r = selfRef.current?.getBoundingClientRect();
3157
2826
  if (r && layoutRect) {
3158
- node._setTabRect(
3159
- new Rect(
3160
- r.left - layoutRect.left,
3161
- r.top - layoutRect.top,
3162
- r.width,
3163
- r.height
3164
- )
3165
- );
2827
+ node._setTabRect(new Rect(r.left - layoutRect.left, r.top - layoutRect.top, r.width, r.height));
3166
2828
  }
3167
2829
  };
3168
2830
  const onTextBoxMouseDown = (event) => {
@@ -3173,12 +2835,7 @@ var BorderButton = (props) => {
3173
2835
  layout.setEditingTab(void 0);
3174
2836
  } else if (event.code === "Enter") {
3175
2837
  layout.setEditingTab(void 0);
3176
- layout.doAction(
3177
- Actions.renameTab(
3178
- node.getId(),
3179
- event.target.value
3180
- )
3181
- );
2838
+ layout.doAction(Actions.renameTab(node.getId(), event.target.value));
3182
2839
  }
3183
2840
  };
3184
2841
  const cm = layout.getClassName;
@@ -3199,13 +2856,7 @@ var BorderButton = (props) => {
3199
2856
  iconAngle = -90;
3200
2857
  }
3201
2858
  }
3202
- const renderState = getRenderStateEx(
3203
- layout,
3204
- node,
3205
- iconFactory,
3206
- titleFactory,
3207
- iconAngle
3208
- );
2859
+ const renderState = getRenderStateEx(layout, node, iconFactory, titleFactory, iconAngle);
3209
2860
  let content = renderState.content ? /* @__PURE__ */ React2.createElement("div", { className: cm("flexlayout__border_button_content" /* FLEXLAYOUT__BORDER_BUTTON_CONTENT */) }, renderState.content) : null;
3210
2861
  const leading = renderState.leading ? /* @__PURE__ */ React2.createElement("div", { className: cm("flexlayout__border_button_leading" /* FLEXLAYOUT__BORDER_BUTTON_LEADING */) }, renderState.leading) : null;
3211
2862
  if (layout.getEditingTab() === node) {
@@ -3271,12 +2922,7 @@ var TabButtonStamp = (props) => {
3271
2922
  const selfRef = React3.useRef(null);
3272
2923
  const cm = layout.getClassName;
3273
2924
  let classNames = cm("flexlayout__tab_button_stamp" /* FLEXLAYOUT__TAB_BUTTON_STAMP */);
3274
- const renderState = getRenderStateEx(
3275
- layout,
3276
- node,
3277
- iconFactory,
3278
- titleFactory
3279
- );
2925
+ const renderState = getRenderStateEx(layout, node, iconFactory, titleFactory);
3280
2926
  let content = renderState.content ? /* @__PURE__ */ React3.createElement("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */) }, renderState.content) : node._getNameForOverflowMenu();
3281
2927
  const leading = renderState.leading ? /* @__PURE__ */ React3.createElement("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */) }, renderState.leading) : null;
3282
2928
  return /* @__PURE__ */ React3.createElement("div", { ref: selfRef, className: classNames, title: node.getHelpText() }, leading, content);
@@ -3341,15 +2987,7 @@ function showPopup(triggerElement, items, onSelect, layout, iconFactory, titleFa
3341
2987
  );
3342
2988
  }
3343
2989
  var PopupMenu = (props) => {
3344
- const {
3345
- items,
3346
- onHide,
3347
- onSelect,
3348
- classNameMapper,
3349
- layout,
3350
- iconFactory,
3351
- titleFactory
3352
- } = props;
2990
+ const { items, onHide, onSelect, classNameMapper, layout, iconFactory, titleFactory } = props;
3353
2991
  const onItemClick = (item, event) => {
3354
2992
  onSelect(item);
3355
2993
  onHide();
@@ -3364,24 +3002,9 @@ var PopupMenu = (props) => {
3364
3002
  onClick: (event) => onItemClick(item, event),
3365
3003
  title: item.node.getHelpText()
3366
3004
  },
3367
- item.node.getModel().isLegacyOverflowMenu() ? item.node._getNameForOverflowMenu() : /* @__PURE__ */ React4.createElement(
3368
- TabButtonStamp,
3369
- {
3370
- node: item.node,
3371
- layout,
3372
- iconFactory,
3373
- titleFactory
3374
- }
3375
- )
3005
+ item.node.getModel().isLegacyOverflowMenu() ? item.node._getNameForOverflowMenu() : /* @__PURE__ */ React4.createElement(TabButtonStamp, { node: item.node, layout, iconFactory, titleFactory })
3376
3006
  ));
3377
- return /* @__PURE__ */ React4.createElement(
3378
- "div",
3379
- {
3380
- className: classNameMapper("flexlayout__popup_menu" /* FLEXLAYOUT__POPUP_MENU */),
3381
- "data-layout-path": "/popup-menu"
3382
- },
3383
- itemElements
3384
- );
3007
+ return /* @__PURE__ */ React4.createElement("div", { className: classNameMapper("flexlayout__popup_menu" /* FLEXLAYOUT__POPUP_MENU */), "data-layout-path": "/popup-menu" }, itemElements);
3385
3008
  };
3386
3009
 
3387
3010
  // src/view/TabOverflowHook.tsx
@@ -3475,14 +3098,8 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
3475
3098
  }
3476
3099
  }
3477
3100
  }
3478
- const extraSpace = Math.max(
3479
- 0,
3480
- endPos - (getFar(lastChild.getTabRect()) + tabMargin + shiftPos)
3481
- );
3482
- const newPosition = Math.min(
3483
- 0,
3484
- position + shiftPos + extraSpace
3485
- );
3101
+ const extraSpace = Math.max(0, endPos - (getFar(lastChild.getTabRect()) + tabMargin + shiftPos));
3102
+ const newPosition = Math.min(0, position + shiftPos + extraSpace);
3486
3103
  const diff = newPosition - position;
3487
3104
  const hidden = [];
3488
3105
  for (let i = 0; i < node.getChildren().length; i++) {
@@ -3516,14 +3133,7 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
3516
3133
  userControlledLeft.current = true;
3517
3134
  event.stopPropagation();
3518
3135
  };
3519
- return {
3520
- selfRef,
3521
- position,
3522
- userControlledLeft,
3523
- hiddenTabs,
3524
- onMouseWheel,
3525
- tabsTruncated: tabsTruncated.current
3526
- };
3136
+ return { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated: tabsTruncated.current };
3527
3137
  };
3528
3138
 
3529
3139
  // src/view/BorderTabSet.tsx
@@ -3532,19 +3142,7 @@ var BorderTabSet = (props) => {
3532
3142
  const toolbarRef = React6.useRef(null);
3533
3143
  const overflowbuttonRef = React6.useRef(null);
3534
3144
  const stickyButtonsRef = React6.useRef(null);
3535
- const {
3536
- selfRef,
3537
- position,
3538
- userControlledLeft,
3539
- hiddenTabs,
3540
- onMouseWheel,
3541
- tabsTruncated
3542
- } = useTabOverflow(
3543
- border,
3544
- Orientation.flip(border.getOrientation()),
3545
- toolbarRef,
3546
- stickyButtonsRef
3547
- );
3145
+ const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated } = useTabOverflow(border, Orientation.flip(border.getOrientation()), toolbarRef, stickyButtonsRef);
3548
3146
  const onAuxMouseClick = (event) => {
3549
3147
  if (isAuxMouseEvent(event)) {
3550
3148
  layout.auxMouseClick(border, event);
@@ -3562,14 +3160,7 @@ var BorderTabSet = (props) => {
3562
3160
  callback(border, event, hiddenTabs, onOverflowItemSelect);
3563
3161
  } else {
3564
3162
  const element = overflowbuttonRef.current;
3565
- showPopup(
3566
- element,
3567
- hiddenTabs,
3568
- onOverflowItemSelect,
3569
- layout,
3570
- iconFactory,
3571
- titleFactory
3572
- );
3163
+ showPopup(element, hiddenTabs, onOverflowItemSelect, layout, iconFactory, titleFactory);
3573
3164
  }
3574
3165
  event.stopPropagation();
3575
3166
  };
@@ -3607,15 +3198,7 @@ var BorderTabSet = (props) => {
3607
3198
  )
3608
3199
  );
3609
3200
  if (i < border.getChildren().length - 1) {
3610
- tabs.push(
3611
- /* @__PURE__ */ React6.createElement(
3612
- "div",
3613
- {
3614
- key: "divider" + i,
3615
- className: cm("flexlayout__border_tab_divider" /* FLEXLAYOUT__BORDER_TAB_DIVIDER */)
3616
- }
3617
- )
3618
- );
3201
+ tabs.push(/* @__PURE__ */ React6.createElement("div", { key: "divider" + i, className: cm("flexlayout__border_tab_divider" /* FLEXLAYOUT__BORDER_TAB_DIVIDER */) }));
3619
3202
  }
3620
3203
  };
3621
3204
  for (let i = 0; i < border.getChildren().length; i++) {
@@ -3627,13 +3210,7 @@ var BorderTabSet = (props) => {
3627
3210
  }
3628
3211
  let buttons = [];
3629
3212
  let stickyButtons = [];
3630
- const renderState = {
3631
- headerContent: void 0,
3632
- buttons,
3633
- stickyButtons,
3634
- headerButtons: [],
3635
- overflowPosition: void 0
3636
- };
3213
+ const renderState = { headerContent: void 0, buttons, stickyButtons, headerButtons: [], overflowPosition: void 0 };
3637
3214
  layout.customizeTabSet(border, renderState);
3638
3215
  buttons = renderState.buttons;
3639
3216
  if (renderState.overflowPosition === void 0) {
@@ -3654,9 +3231,7 @@ var BorderTabSet = (props) => {
3654
3231
  onDragStart: (e) => {
3655
3232
  e.preventDefault();
3656
3233
  },
3657
- className: cm(
3658
- "flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */
3659
- )
3234
+ className: cm("flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */)
3660
3235
  },
3661
3236
  stickyButtons
3662
3237
  )
@@ -3669,15 +3244,7 @@ var BorderTabSet = (props) => {
3669
3244
  if (typeof icons.more === "function") {
3670
3245
  overflowContent = icons.more(border, hiddenTabs);
3671
3246
  } else {
3672
- overflowContent = /* @__PURE__ */ React6.createElement(React6.Fragment, null, icons.more, /* @__PURE__ */ React6.createElement(
3673
- "div",
3674
- {
3675
- className: cm(
3676
- "flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */
3677
- )
3678
- },
3679
- hiddenTabs.length
3680
- ));
3247
+ overflowContent = /* @__PURE__ */ React6.createElement(React6.Fragment, null, icons.more, /* @__PURE__ */ React6.createElement("div", { className: cm("flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */) }, hiddenTabs.length));
3681
3248
  }
3682
3249
  buttons.splice(
3683
3250
  Math.min(renderState.overflowPosition, buttons.length),
@@ -3687,9 +3254,7 @@ var BorderTabSet = (props) => {
3687
3254
  {
3688
3255
  key: "overflowbutton",
3689
3256
  ref: overflowbuttonRef,
3690
- className: cm("flexlayout__border_toolbar_button" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON */) + " " + cm("flexlayout__border_toolbar_button_overflow" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW */) + " " + cm(
3691
- "flexlayout__border_toolbar_button_overflow_" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_ */ + border.getLocation().getName()
3692
- ),
3257
+ className: cm("flexlayout__border_toolbar_button" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON */) + " " + cm("flexlayout__border_toolbar_button_overflow" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW */) + " " + cm("flexlayout__border_toolbar_button_overflow_" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_ */ + border.getLocation().getName()),
3693
3258
  title: overflowTitle,
3694
3259
  onClick: onOverflowClick,
3695
3260
  onMouseDown: onInterceptMouseDown,
@@ -3720,32 +3285,14 @@ var BorderTabSet = (props) => {
3720
3285
  );
3721
3286
  }
3722
3287
  }
3723
- const toolbar = /* @__PURE__ */ React6.createElement(
3724
- "div",
3725
- {
3726
- key: "toolbar",
3727
- ref: toolbarRef,
3728
- className: cm("flexlayout__border_toolbar" /* FLEXLAYOUT__BORDER_TOOLBAR */) + " " + cm(
3729
- "flexlayout__border_toolbar_" /* FLEXLAYOUT__BORDER_TOOLBAR_ */ + border.getLocation().getName()
3730
- )
3731
- },
3732
- buttons
3733
- );
3288
+ const toolbar = /* @__PURE__ */ React6.createElement("div", { key: "toolbar", ref: toolbarRef, className: cm("flexlayout__border_toolbar" /* FLEXLAYOUT__BORDER_TOOLBAR */) + " " + cm("flexlayout__border_toolbar_" /* FLEXLAYOUT__BORDER_TOOLBAR_ */ + border.getLocation().getName()) }, buttons);
3734
3289
  style2 = layout.styleFont(style2);
3735
3290
  let innerStyle = {};
3736
3291
  const borderHeight = border.getBorderBarSize() - 1;
3737
3292
  if (border.getLocation() === DockLocation.LEFT) {
3738
- innerStyle = {
3739
- right: borderHeight,
3740
- height: borderHeight,
3741
- top: position
3742
- };
3293
+ innerStyle = { right: borderHeight, height: borderHeight, top: position };
3743
3294
  } else if (border.getLocation() === DockLocation.RIGHT) {
3744
- innerStyle = {
3745
- left: borderHeight,
3746
- height: borderHeight,
3747
- top: position
3748
- };
3295
+ innerStyle = { left: borderHeight, height: borderHeight, top: position };
3749
3296
  } else {
3750
3297
  innerStyle = { height: borderHeight, left: position };
3751
3298
  }
@@ -3762,25 +3309,7 @@ var BorderTabSet = (props) => {
3762
3309
  onContextMenu,
3763
3310
  onWheel: onMouseWheel
3764
3311
  },
3765
- /* @__PURE__ */ React6.createElement(
3766
- "div",
3767
- {
3768
- style: { height: borderHeight },
3769
- className: cm("flexlayout__border_inner" /* FLEXLAYOUT__BORDER_INNER */) + " " + cm(
3770
- "flexlayout__border_inner_" /* FLEXLAYOUT__BORDER_INNER_ */ + border.getLocation().getName()
3771
- )
3772
- },
3773
- /* @__PURE__ */ React6.createElement(
3774
- "div",
3775
- {
3776
- style: innerStyle,
3777
- className: cm("flexlayout__border_inner_tab_container" /* FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER */) + " " + cm(
3778
- "flexlayout__border_inner_tab_container_" /* FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_ */ + border.getLocation().getName()
3779
- )
3780
- },
3781
- tabs
3782
- )
3783
- ),
3312
+ /* @__PURE__ */ React6.createElement("div", { style: { height: borderHeight }, className: cm("flexlayout__border_inner" /* FLEXLAYOUT__BORDER_INNER */) + " " + cm("flexlayout__border_inner_" /* FLEXLAYOUT__BORDER_INNER_ */ + border.getLocation().getName()) }, /* @__PURE__ */ React6.createElement("div", { style: innerStyle, className: cm("flexlayout__border_inner_tab_container" /* FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER */) + " " + cm("flexlayout__border_inner_tab_container_" /* FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_ */ + border.getLocation().getName()) }, tabs)),
3784
3313
  toolbar
3785
3314
  );
3786
3315
  };
@@ -3793,27 +3322,13 @@ var Splitter = (props) => {
3793
3322
  const outlineDiv = React7.useRef(void 0);
3794
3323
  const parentNode = node.getParent();
3795
3324
  const onMouseDown = (event) => {
3796
- DragDrop.instance.setGlassCursorOverride(
3797
- node.getOrientation() === Orientation.HORZ ? "ns-resize" : "ew-resize"
3798
- );
3799
- DragDrop.instance.startDrag(
3800
- event,
3801
- onDragStart,
3802
- onDragMove,
3803
- onDragEnd,
3804
- onDragCancel,
3805
- void 0,
3806
- void 0,
3807
- layout.getCurrentDocument(),
3808
- layout.getRootDiv() ?? void 0
3809
- );
3325
+ DragDrop.instance.setGlassCursorOverride(node.getOrientation() === Orientation.HORZ ? "ns-resize" : "ew-resize");
3326
+ DragDrop.instance.startDrag(event, onDragStart, onDragMove, onDragEnd, onDragCancel, void 0, void 0, layout.getCurrentDocument(), layout.getRootDiv() ?? void 0);
3810
3327
  pBounds.current = parentNode._getSplitterBounds(node, true);
3811
3328
  const rootdiv = layout.getRootDiv();
3812
3329
  outlineDiv.current = layout.getCurrentDocument().createElement("div");
3813
3330
  outlineDiv.current.style.position = "absolute";
3814
- outlineDiv.current.className = layout.getClassName(
3815
- "flexlayout__splitter_drag" /* FLEXLAYOUT__SPLITTER_DRAG */
3816
- );
3331
+ outlineDiv.current.className = layout.getClassName("flexlayout__splitter_drag" /* FLEXLAYOUT__SPLITTER_DRAG */);
3817
3332
  outlineDiv.current.style.cursor = node.getOrientation() === Orientation.HORZ ? "ns-resize" : "ew-resize";
3818
3333
  const r2 = node.getRect();
3819
3334
  if (node.getOrientation() === Orientation.VERT && r2.width < 2) {
@@ -3866,12 +3381,7 @@ var Splitter = (props) => {
3866
3381
  }
3867
3382
  if (parentNode instanceof BorderNode) {
3868
3383
  const pos = parentNode._calculateSplit(node, value);
3869
- layout.doAction(
3870
- Actions.adjustBorderSplit(
3871
- node.getParent().getId(),
3872
- pos
3873
- )
3874
- );
3384
+ layout.doAction(Actions.adjustBorderSplit(node.getParent().getId(), pos));
3875
3385
  } else {
3876
3386
  const splitSpec = parentNode._calculateSplit(node, value);
3877
3387
  if (splitSpec !== void 0) {
@@ -3912,16 +3422,7 @@ var Splitter = (props) => {
3912
3422
  }
3913
3423
  const extra = node.getModel().getSplitterExtra();
3914
3424
  if (extra === 0) {
3915
- return /* @__PURE__ */ React7.createElement(
3916
- "div",
3917
- {
3918
- style: style2,
3919
- "data-layout-path": path,
3920
- className,
3921
- onTouchStart: onMouseDown,
3922
- onMouseDown
3923
- }
3924
- );
3425
+ return /* @__PURE__ */ React7.createElement("div", { style: style2, "data-layout-path": path, className, onTouchStart: onMouseDown, onMouseDown });
3925
3426
  } else {
3926
3427
  let r2 = r.clone();
3927
3428
  r2.x = 0;
@@ -3935,15 +3436,7 @@ var Splitter = (props) => {
3935
3436
  cursor: node.getOrientation() === Orientation.HORZ ? "ns-resize" : "ew-resize"
3936
3437
  });
3937
3438
  const className2 = cm("flexlayout__splitter_extra" /* FLEXLAYOUT__SPLITTER_EXTRA */);
3938
- return /* @__PURE__ */ React7.createElement("div", { style: style2, "data-layout-path": path, className }, /* @__PURE__ */ React7.createElement(
3939
- "div",
3940
- {
3941
- style: style22,
3942
- className: className2,
3943
- onTouchStart: onMouseDown,
3944
- onMouseDown
3945
- }
3946
- ));
3439
+ return /* @__PURE__ */ React7.createElement("div", { style: style2, "data-layout-path": path, className }, /* @__PURE__ */ React7.createElement("div", { style: style22, className: className2, onTouchStart: onMouseDown, onMouseDown }));
3947
3440
  }
3948
3441
  };
3949
3442
 
@@ -3976,9 +3469,7 @@ var ErrorBoundary = class extends React8.Component {
3976
3469
  // src/view/Tab.tsx
3977
3470
  var Tab = (props) => {
3978
3471
  const { layout, selected, node, factory, path } = props;
3979
- const [renderComponent, setRenderComponent] = React9.useState(
3980
- !props.node.isEnableRenderOnDemand() || props.selected
3981
- );
3472
+ const [renderComponent, setRenderComponent] = React9.useState(!props.node.isEnableRenderOnDemand() || props.selected);
3982
3473
  React9.useLayoutEffect(() => {
3983
3474
  if (!renderComponent && selected) {
3984
3475
  setRenderComponent(true);
@@ -4011,32 +3502,12 @@ var Tab = (props) => {
4011
3502
  let className = cm("flexlayout__tab" /* FLEXLAYOUT__TAB */);
4012
3503
  if (parentNode instanceof BorderNode) {
4013
3504
  className += " " + cm("flexlayout__tab_border" /* FLEXLAYOUT__TAB_BORDER */);
4014
- className += " " + cm(
4015
- "flexlayout__tab_border_" /* FLEXLAYOUT__TAB_BORDER_ */ + parentNode.getLocation().getName()
4016
- );
3505
+ className += " " + cm("flexlayout__tab_border_" /* FLEXLAYOUT__TAB_BORDER_ */ + parentNode.getLocation().getName());
4017
3506
  }
4018
3507
  if (node.getContentClassName() !== void 0) {
4019
3508
  className += " " + node.getContentClassName();
4020
3509
  }
4021
- return /* @__PURE__ */ React9.createElement(
4022
- "div",
4023
- {
4024
- className,
4025
- "data-layout-path": path,
4026
- onMouseDown,
4027
- onTouchStart: onMouseDown,
4028
- style: style2
4029
- },
4030
- /* @__PURE__ */ React9.createElement(
4031
- ErrorBoundary,
4032
- {
4033
- message: props.layout.i18nName(
4034
- "Error rendering component" /* Error_rendering_component */
4035
- )
4036
- },
4037
- /* @__PURE__ */ React9.createElement(Fragment2, null, child)
4038
- )
4039
- );
3510
+ return /* @__PURE__ */ React9.createElement("div", { className, "data-layout-path": path, onMouseDown, onTouchStart: onMouseDown, style: style2 }, /* @__PURE__ */ React9.createElement(ErrorBoundary, { message: props.layout.i18nName("Error rendering component" /* Error_rendering_component */) }, /* @__PURE__ */ React9.createElement(Fragment2, null, child)));
4040
3511
  };
4041
3512
 
4042
3513
  // src/view/TabSet.tsx
@@ -4050,14 +3521,7 @@ var TabButton = (props) => {
4050
3521
  const contentRef = React10.useRef(null);
4051
3522
  const onMouseDown = (event) => {
4052
3523
  if (!isAuxMouseEvent(event) && !layout.getEditingTab()) {
4053
- layout.dragStart(
4054
- event,
4055
- void 0,
4056
- node,
4057
- node.isEnableDrag(),
4058
- onClick,
4059
- onDoubleClick
4060
- );
3524
+ layout.dragStart(event, void 0, node, node.isEnableDrag(), onClick, onDoubleClick);
4061
3525
  }
4062
3526
  };
4063
3527
  const onAuxMouseClick = (event) => {
@@ -4120,14 +3584,7 @@ var TabButton = (props) => {
4120
3584
  const layoutRect = layout.getDomRect();
4121
3585
  const r = selfRef.current?.getBoundingClientRect();
4122
3586
  if (r && layoutRect) {
4123
- node._setTabRect(
4124
- new Rect(
4125
- r.left - layoutRect.left,
4126
- r.top - layoutRect.top,
4127
- r.width,
4128
- r.height
4129
- )
4130
- );
3587
+ node._setTabRect(new Rect(r.left - layoutRect.left, r.top - layoutRect.top, r.width, r.height));
4131
3588
  }
4132
3589
  };
4133
3590
  const onTextBoxMouseDown = (event) => {
@@ -4138,33 +3595,26 @@ var TabButton = (props) => {
4138
3595
  layout.setEditingTab(void 0);
4139
3596
  } else if (event.code === "Enter") {
4140
3597
  layout.setEditingTab(void 0);
4141
- layout.doAction(
4142
- Actions.renameTab(
4143
- node.getId(),
4144
- event.target.value
4145
- )
4146
- );
3598
+ layout.doAction(Actions.renameTab(node.getId(), event.target.value));
4147
3599
  }
4148
3600
  };
4149
3601
  const cm = layout.getClassName;
4150
3602
  const parentNode = node.getParent();
4151
- let baseClassName = "flexlayout__tab_button" /* FLEXLAYOUT__TAB_BUTTON */;
3603
+ const isStretch = parentNode.isEnableSingleTabStretch() && parentNode.getChildren().length === 1;
3604
+ let baseClassName = isStretch ? "flexlayout__tab_button_stretch" /* FLEXLAYOUT__TAB_BUTTON_STRETCH */ : "flexlayout__tab_button" /* FLEXLAYOUT__TAB_BUTTON */;
4152
3605
  let classNames = cm(baseClassName);
4153
3606
  classNames += " " + cm(baseClassName + "_" + parentNode.getTabLocation());
4154
- if (selected) {
4155
- classNames += " " + cm(baseClassName + "--selected");
4156
- } else {
4157
- classNames += " " + cm(baseClassName + "--unselected");
3607
+ if (!isStretch) {
3608
+ if (selected) {
3609
+ classNames += " " + cm(baseClassName + "--selected");
3610
+ } else {
3611
+ classNames += " " + cm(baseClassName + "--unselected");
3612
+ }
4158
3613
  }
4159
3614
  if (node.getClassName() !== void 0) {
4160
3615
  classNames += " " + node.getClassName();
4161
3616
  }
4162
- const renderState = getRenderStateEx(
4163
- layout,
4164
- node,
4165
- iconFactory,
4166
- titleFactory
4167
- );
3617
+ const renderState = getRenderStateEx(layout, node, iconFactory, titleFactory);
4168
3618
  let content = renderState.content ? /* @__PURE__ */ React10.createElement("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */) }, renderState.content) : null;
4169
3619
  const leading = renderState.leading ? /* @__PURE__ */ React10.createElement("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */) }, renderState.leading) : null;
4170
3620
  if (layout.getEditingTab() === node) {
@@ -4183,7 +3633,7 @@ var TabButton = (props) => {
4183
3633
  }
4184
3634
  );
4185
3635
  }
4186
- if (node.isEnableClose()) {
3636
+ if (node.isEnableClose() && !isStretch) {
4187
3637
  const closeTitle = layout.i18nName("Close" /* Close_Tab */);
4188
3638
  renderState.buttons.push(
4189
3639
  /* @__PURE__ */ React10.createElement(
@@ -4227,28 +3677,14 @@ var TabSet = (props) => {
4227
3677
  const overflowbuttonRef = React11.useRef(null);
4228
3678
  const tabbarInnerRef = React11.useRef(null);
4229
3679
  const stickyButtonsRef = React11.useRef(null);
4230
- const {
4231
- selfRef,
4232
- position,
4233
- userControlledLeft,
4234
- hiddenTabs,
4235
- onMouseWheel,
4236
- tabsTruncated
4237
- } = useTabOverflow(node, Orientation.HORZ, toolbarRef, stickyButtonsRef);
3680
+ const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated } = useTabOverflow(node, Orientation.HORZ, toolbarRef, stickyButtonsRef);
4238
3681
  const onOverflowClick = (event) => {
4239
3682
  const callback = layout.getShowOverflowMenu();
4240
3683
  if (callback !== void 0) {
4241
3684
  callback(node, event, hiddenTabs, onOverflowItemSelect);
4242
3685
  } else {
4243
3686
  const element = overflowbuttonRef.current;
4244
- showPopup(
4245
- element,
4246
- hiddenTabs,
4247
- onOverflowItemSelect,
4248
- layout,
4249
- iconFactory,
4250
- titleFactory
4251
- );
3687
+ showPopup(element, hiddenTabs, onOverflowItemSelect, layout, iconFactory, titleFactory);
4252
3688
  }
4253
3689
  event.stopPropagation();
4254
3690
  };
@@ -4268,23 +3704,9 @@ var TabSet = (props) => {
4268
3704
  if (!layout.getEditingTab()) {
4269
3705
  const message = layout.i18nName("Move tabset" /* Move_Tabset */, name);
4270
3706
  if (node.getModel().getMaximizedTabset() !== void 0) {
4271
- layout.dragStart(
4272
- event,
4273
- message,
4274
- node,
4275
- false,
4276
- (event2) => void 0,
4277
- onDoubleClick
4278
- );
3707
+ layout.dragStart(event, message, node, false, (event2) => void 0, onDoubleClick);
4279
3708
  } else {
4280
- layout.dragStart(
4281
- event,
4282
- message,
4283
- node,
4284
- node.isEnableDrag(),
4285
- (event2) => void 0,
4286
- onDoubleClick
4287
- );
3709
+ layout.dragStart(event, message, node, node.isEnableDrag(), (event2) => void 0, onDoubleClick);
4288
3710
  }
4289
3711
  }
4290
3712
  }
@@ -4310,6 +3732,10 @@ var TabSet = (props) => {
4310
3732
  layout.doAction(Actions.deleteTabset(node.getId()));
4311
3733
  event.stopPropagation();
4312
3734
  };
3735
+ const onCloseTab = (event) => {
3736
+ layout.doAction(Actions.deleteTab(node.getChildren()[0].getId()));
3737
+ event.stopPropagation();
3738
+ };
4313
3739
  const onFloatTab = (event) => {
4314
3740
  if (selectedTabNode !== void 0) {
4315
3741
  layout.doAction(Actions.floatTab(selectedTabNode.getId()));
@@ -4335,31 +3761,9 @@ var TabSet = (props) => {
4335
3761
  for (let i = 0; i < node.getChildren().length; i++) {
4336
3762
  const child = node.getChildren()[i];
4337
3763
  let isSelected = node.getSelected() === i;
4338
- tabs.push(
4339
- /* @__PURE__ */ React11.createElement(
4340
- TabButton,
4341
- {
4342
- layout,
4343
- node: child,
4344
- path: path + "/tb" + i,
4345
- key: child.getId(),
4346
- selected: isSelected,
4347
- iconFactory,
4348
- titleFactory,
4349
- icons
4350
- }
4351
- )
4352
- );
3764
+ tabs.push(/* @__PURE__ */ React11.createElement(TabButton, { layout, node: child, path: path + "/tb" + i, key: child.getId(), selected: isSelected, iconFactory, titleFactory, icons }));
4353
3765
  if (i < node.getChildren().length - 1) {
4354
- tabs.push(
4355
- /* @__PURE__ */ React11.createElement(
4356
- "div",
4357
- {
4358
- key: "divider" + i,
4359
- className: cm("flexlayout__tabset_tab_divider" /* FLEXLAYOUT__TABSET_TAB_DIVIDER */)
4360
- }
4361
- )
4362
- );
3766
+ tabs.push(/* @__PURE__ */ React11.createElement("div", { key: "divider" + i, className: cm("flexlayout__tabset_tab_divider" /* FLEXLAYOUT__TABSET_TAB_DIVIDER */) }));
4363
3767
  }
4364
3768
  }
4365
3769
  }
@@ -4367,23 +3771,19 @@ var TabSet = (props) => {
4367
3771
  let stickyButtons = [];
4368
3772
  let buttons = [];
4369
3773
  let headerButtons = [];
4370
- const renderState = {
4371
- headerContent: node.getName(),
4372
- stickyButtons,
4373
- buttons,
4374
- headerButtons,
4375
- overflowPosition: void 0
4376
- };
3774
+ const renderState = { headerContent: node.getName(), stickyButtons, buttons, headerButtons, overflowPosition: void 0 };
4377
3775
  layout.customizeTabSet(node, renderState);
4378
3776
  const headerContent = renderState.headerContent;
4379
3777
  stickyButtons = renderState.stickyButtons;
4380
3778
  buttons = renderState.buttons;
4381
3779
  headerButtons = renderState.headerButtons;
3780
+ const isTabStretch = node.isEnableSingleTabStretch() && node.getChildren().length === 1;
3781
+ const showClose = isTabStretch && node.getChildren()[0].isEnableClose() || node.isEnableClose();
4382
3782
  if (renderState.overflowPosition === void 0) {
4383
3783
  renderState.overflowPosition = stickyButtons.length;
4384
3784
  }
4385
3785
  if (stickyButtons.length > 0) {
4386
- if (tabsTruncated) {
3786
+ if (tabsTruncated || isTabStretch) {
4387
3787
  buttons = [...stickyButtons, ...buttons];
4388
3788
  } else {
4389
3789
  tabs.push(
@@ -4397,9 +3797,7 @@ var TabSet = (props) => {
4397
3797
  onDragStart: (e) => {
4398
3798
  e.preventDefault();
4399
3799
  },
4400
- className: cm(
4401
- "flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */
4402
- )
3800
+ className: cm("flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */)
4403
3801
  },
4404
3802
  stickyButtons
4405
3803
  )
@@ -4412,15 +3810,7 @@ var TabSet = (props) => {
4412
3810
  if (typeof icons.more === "function") {
4413
3811
  overflowContent = icons.more(node, hiddenTabs);
4414
3812
  } else {
4415
- overflowContent = /* @__PURE__ */ React11.createElement(React11.Fragment, null, icons.more, /* @__PURE__ */ React11.createElement(
4416
- "div",
4417
- {
4418
- className: cm(
4419
- "flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */
4420
- )
4421
- },
4422
- hiddenTabs.length
4423
- ));
3813
+ overflowContent = /* @__PURE__ */ React11.createElement(React11.Fragment, null, icons.more, /* @__PURE__ */ React11.createElement("div", { className: cm("flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */) }, hiddenTabs.length));
4424
3814
  }
4425
3815
  buttons.splice(
4426
3816
  Math.min(renderState.overflowPosition, buttons.length),
@@ -4470,9 +3860,7 @@ var TabSet = (props) => {
4470
3860
  key: "max",
4471
3861
  "data-layout-path": path + "/button/max",
4472
3862
  title: node.isMaximized() ? minTitle : maxTitle,
4473
- className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm(
4474
- "flexlayout__tab_toolbar_button-" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ */ + (node.isMaximized() ? "max" : "min")
4475
- ),
3863
+ className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm("flexlayout__tab_toolbar_button-" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ */ + (node.isMaximized() ? "max" : "min")),
4476
3864
  onClick: onMaximizeToggle,
4477
3865
  onMouseDown: onInterceptMouseDown,
4478
3866
  onTouchStart: onInterceptMouseDown
@@ -4481,8 +3869,8 @@ var TabSet = (props) => {
4481
3869
  )
4482
3870
  );
4483
3871
  }
4484
- if (!node.isMaximized() && node.isEnableClose()) {
4485
- const title = layout.i18nName("Close tabset" /* Close_Tabset */);
3872
+ if (!node.isMaximized() && showClose) {
3873
+ const title = isTabStretch ? layout.i18nName("Close" /* Close_Tab */) : layout.i18nName("Close tabset" /* Close_Tabset */);
4486
3874
  const btns = showHeader ? headerButtons : buttons;
4487
3875
  btns.push(
4488
3876
  /* @__PURE__ */ React11.createElement(
@@ -4492,7 +3880,7 @@ var TabSet = (props) => {
4492
3880
  "data-layout-path": path + "/button/close",
4493
3881
  title,
4494
3882
  className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm("flexlayout__tab_toolbar_button-close" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE */),
4495
- onClick: onClose,
3883
+ onClick: isTabStretch ? onCloseTab : onClose,
4496
3884
  onMouseDown: onInterceptMouseDown,
4497
3885
  onTouchStart: onInterceptMouseDown
4498
3886
  },
@@ -4568,9 +3956,7 @@ var TabSet = (props) => {
4568
3956
  headerToolbar
4569
3957
  );
4570
3958
  }
4571
- const tabStripStyle = {
4572
- height: node.getTabStripHeight() + "px"
4573
- };
3959
+ const tabStripStyle = { height: node.getTabStripHeight() + "px" };
4574
3960
  tabStrip = /* @__PURE__ */ React11.createElement(
4575
3961
  "div",
4576
3962
  {
@@ -4583,27 +3969,14 @@ var TabSet = (props) => {
4583
3969
  onAuxClick: onAuxMouseClick,
4584
3970
  onTouchStart: onMouseDown
4585
3971
  },
4586
- /* @__PURE__ */ React11.createElement(
3972
+ /* @__PURE__ */ React11.createElement("div", { ref: tabbarInnerRef, className: cm("flexlayout__tabset_tabbar_inner" /* FLEXLAYOUT__TABSET_TABBAR_INNER */) + " " + cm("flexlayout__tabset_tabbar_inner_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_ */ + node.getTabLocation()) }, /* @__PURE__ */ React11.createElement(
4587
3973
  "div",
4588
3974
  {
4589
- ref: tabbarInnerRef,
4590
- className: cm("flexlayout__tabset_tabbar_inner" /* FLEXLAYOUT__TABSET_TABBAR_INNER */) + " " + cm(
4591
- "flexlayout__tabset_tabbar_inner_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_ */ + node.getTabLocation()
4592
- )
3975
+ style: { left: position, width: isTabStretch ? "100%" : "10000px" },
3976
+ className: cm("flexlayout__tabset_tabbar_inner_tab_container" /* FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER */) + " " + cm("flexlayout__tabset_tabbar_inner_tab_container_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_ */ + node.getTabLocation())
4593
3977
  },
4594
- /* @__PURE__ */ React11.createElement(
4595
- "div",
4596
- {
4597
- style: { left: position },
4598
- className: cm(
4599
- "flexlayout__tabset_tabbar_inner_tab_container" /* FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER */
4600
- ) + " " + cm(
4601
- "flexlayout__tabset_tabbar_inner_tab_container_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_ */ + node.getTabLocation()
4602
- )
4603
- },
4604
- tabs
4605
- )
4606
- ),
3978
+ tabs
3979
+ )),
4607
3980
  toolbar
4608
3981
  );
4609
3982
  style2 = layout.styleFont(style2);
@@ -4621,18 +3994,7 @@ var TabSet = (props) => {
4621
3994
  } else {
4622
3995
  content = /* @__PURE__ */ React11.createElement(React11.Fragment, null, header, center, tabStrip);
4623
3996
  }
4624
- return /* @__PURE__ */ React11.createElement(
4625
- "div",
4626
- {
4627
- ref: selfRef,
4628
- dir: "ltr",
4629
- "data-layout-path": path,
4630
- style: style2,
4631
- className: cm("flexlayout__tabset" /* FLEXLAYOUT__TABSET */),
4632
- onWheel: onMouseWheel
4633
- },
4634
- content
4635
- );
3997
+ return /* @__PURE__ */ React11.createElement("div", { ref: selfRef, dir: "ltr", "data-layout-path": path, style: style2, className: cm("flexlayout__tabset" /* FLEXLAYOUT__TABSET */), onWheel: onMouseWheel }, content);
4636
3998
  };
4637
3999
 
4638
4000
  // src/view/FloatingWindow.tsx
@@ -4642,42 +4004,33 @@ var FloatingWindow = (props) => {
4642
4004
  const { title, id, url, rect, onCloseWindow, onSetWindow, children } = props;
4643
4005
  const popoutWindow = React12.useRef(null);
4644
4006
  const timerId = React12.useRef(null);
4645
- const [content, setContent] = React12.useState(
4646
- void 0
4647
- );
4007
+ const [content, setContent] = React12.useState(void 0);
4648
4008
  React12.useLayoutEffect(() => {
4649
4009
  if (timerId.current) {
4650
4010
  clearTimeout(timerId.current);
4651
4011
  }
4652
4012
  let isMounted = true;
4653
4013
  const r = rect || new Rect(0, 0, 100, 100);
4654
- const styles = Array.from(window.document.styleSheets).reduce(
4655
- (result, styleSheet) => {
4656
- let rules = void 0;
4657
- try {
4658
- rules = styleSheet.cssRules;
4659
- } catch (e) {
4660
- }
4661
- try {
4662
- return [
4663
- ...result,
4664
- {
4665
- href: styleSheet.href,
4666
- type: styleSheet.type,
4667
- rules: rules ? Array.from(rules).map((rule) => rule.cssText) : null
4668
- }
4669
- ];
4670
- } catch (e) {
4671
- return result;
4672
- }
4673
- },
4674
- []
4675
- );
4676
- popoutWindow.current = window.open(
4677
- url,
4678
- id,
4679
- `left=${r.x},top=${r.y},width=${r.width},height=${r.height}`
4680
- );
4014
+ const styles = Array.from(window.document.styleSheets).reduce((result, styleSheet) => {
4015
+ let rules = void 0;
4016
+ try {
4017
+ rules = styleSheet.cssRules;
4018
+ } catch (e) {
4019
+ }
4020
+ try {
4021
+ return [
4022
+ ...result,
4023
+ {
4024
+ href: styleSheet.href,
4025
+ type: styleSheet.type,
4026
+ rules: rules ? Array.from(rules).map((rule) => rule.cssText) : null
4027
+ }
4028
+ ];
4029
+ } catch (e) {
4030
+ return result;
4031
+ }
4032
+ }, []);
4033
+ popoutWindow.current = window.open(url, id, `left=${r.x},top=${r.y},width=${r.width},height=${r.height}`);
4681
4034
  if (popoutWindow.current !== null) {
4682
4035
  onSetWindow(id, popoutWindow.current);
4683
4036
  window.addEventListener("beforeunload", () => {
@@ -4696,12 +4049,9 @@ var FloatingWindow = (props) => {
4696
4049
  copyStyles(popoutDocument, styles).then(() => {
4697
4050
  setContent(popoutContent);
4698
4051
  });
4699
- popoutWindow.current.addEventListener(
4700
- "beforeunload",
4701
- () => {
4702
- onCloseWindow(id);
4703
- }
4704
- );
4052
+ popoutWindow.current.addEventListener("beforeunload", () => {
4053
+ onCloseWindow(id);
4054
+ });
4705
4055
  }
4706
4056
  });
4707
4057
  } else {
@@ -4759,15 +4109,7 @@ var FloatingWindowTab = (props) => {
4759
4109
  const { layout, node, factory } = props;
4760
4110
  const cm = layout.getClassName;
4761
4111
  const child = factory(node);
4762
- return /* @__PURE__ */ React13.createElement("div", { className: cm("flexlayout__floating_window_tab" /* FLEXLAYOUT__FLOATING_WINDOW_TAB */) }, /* @__PURE__ */ React13.createElement(
4763
- ErrorBoundary,
4764
- {
4765
- message: props.layout.i18nName(
4766
- "Error rendering component" /* Error_rendering_component */
4767
- )
4768
- },
4769
- /* @__PURE__ */ React13.createElement(Fragment4, null, child)
4770
- ));
4112
+ return /* @__PURE__ */ React13.createElement("div", { className: cm("flexlayout__floating_window_tab" /* FLEXLAYOUT__FLOATING_WINDOW_TAB */) }, /* @__PURE__ */ React13.createElement(ErrorBoundary, { message: props.layout.i18nName("Error rendering component" /* Error_rendering_component */) }, /* @__PURE__ */ React13.createElement(Fragment4, null, child)));
4771
4113
  };
4772
4114
 
4773
4115
  // src/view/TabFloating.tsx
@@ -4814,89 +4156,23 @@ var TabFloating = (props) => {
4814
4156
  const dockMessage = layout.i18nName("Dock window" /* Floating_Window_Dock_Window */);
4815
4157
  const customRenderCallback = layout.getOnRenderFloatingTabPlaceholder();
4816
4158
  if (customRenderCallback) {
4817
- return /* @__PURE__ */ React14.createElement(
4818
- "div",
4819
- {
4820
- className: cm("flexlayout__tab_floating" /* FLEXLAYOUT__TAB_FLOATING */),
4821
- onMouseDown,
4822
- onTouchStart: onMouseDown,
4823
- style: style2
4824
- },
4825
- customRenderCallback(dockPopout, showPopout)
4826
- );
4159
+ return /* @__PURE__ */ React14.createElement("div", { className: cm("flexlayout__tab_floating" /* FLEXLAYOUT__TAB_FLOATING */), onMouseDown, onTouchStart: onMouseDown, style: style2 }, customRenderCallback(dockPopout, showPopout));
4827
4160
  } else {
4828
- return /* @__PURE__ */ React14.createElement(
4829
- "div",
4830
- {
4831
- className: cm("flexlayout__tab_floating" /* FLEXLAYOUT__TAB_FLOATING */),
4832
- "data-layout-path": path,
4833
- onMouseDown,
4834
- onTouchStart: onMouseDown,
4835
- style: style2
4836
- },
4837
- /* @__PURE__ */ React14.createElement("div", { className: cm("flexlayout__tab_floating_inner" /* FLEXLAYOUT__TAB_FLOATING_INNER */) }, /* @__PURE__ */ React14.createElement("div", null, message), /* @__PURE__ */ React14.createElement("div", null, /* @__PURE__ */ React14.createElement("a", { href: "#", onClick: onClickFocus }, showMessage)), /* @__PURE__ */ React14.createElement("div", null, /* @__PURE__ */ React14.createElement("a", { href: "#", onClick: onClickDock }, dockMessage)))
4838
- );
4161
+ return /* @__PURE__ */ React14.createElement("div", { className: cm("flexlayout__tab_floating" /* FLEXLAYOUT__TAB_FLOATING */), "data-layout-path": path, onMouseDown, onTouchStart: onMouseDown, style: style2 }, /* @__PURE__ */ React14.createElement("div", { className: cm("flexlayout__tab_floating_inner" /* FLEXLAYOUT__TAB_FLOATING_INNER */) }, /* @__PURE__ */ React14.createElement("div", null, message), /* @__PURE__ */ React14.createElement("div", null, /* @__PURE__ */ React14.createElement("a", { href: "#", onClick: onClickFocus }, showMessage)), /* @__PURE__ */ React14.createElement("div", null, /* @__PURE__ */ React14.createElement("a", { href: "#", onClick: onClickDock }, dockMessage))));
4839
4162
  }
4840
4163
  };
4841
4164
 
4842
4165
  // src/view/Icons.tsx
4843
4166
  import * as React15 from "react";
4844
- var style = {
4845
- width: "1em",
4846
- height: "1em",
4847
- display: "flex",
4848
- alignItems: "center"
4849
- };
4167
+ var style = { width: "1em", height: "1em", display: "flex", alignItems: "center" };
4850
4168
  var CloseIcon = () => {
4851
- return /* @__PURE__ */ React15.createElement(
4852
- "svg",
4853
- {
4854
- xmlns: "http://www.w3.org/2000/svg",
4855
- style,
4856
- viewBox: "0 0 24 24"
4857
- },
4858
- /* @__PURE__ */ React15.createElement("path", { fill: "none", d: "M0 0h24v24H0z" }),
4859
- /* @__PURE__ */ React15.createElement(
4860
- "path",
4861
- {
4862
- stroke: "var(--color-icon)",
4863
- fill: "var(--color-icon)",
4864
- d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
4865
- }
4866
- )
4867
- );
4169
+ return /* @__PURE__ */ React15.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24" }, /* @__PURE__ */ React15.createElement("path", { fill: "none", d: "M0 0h24v24H0z" }), /* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", fill: "var(--color-icon)", d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }));
4868
4170
  };
4869
4171
  var MaximizeIcon = () => {
4870
- return /* @__PURE__ */ React15.createElement(
4871
- "svg",
4872
- {
4873
- xmlns: "http://www.w3.org/2000/svg",
4874
- style,
4875
- viewBox: "0 0 24 24",
4876
- fill: "var(--color-icon)"
4877
- },
4878
- /* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
4879
- /* @__PURE__ */ React15.createElement(
4880
- "path",
4881
- {
4882
- stroke: "var(--color-icon)",
4883
- d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"
4884
- }
4885
- )
4886
- );
4172
+ return /* @__PURE__ */ React15.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)" }, /* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), /* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }));
4887
4173
  };
4888
4174
  var OverflowIcon = () => {
4889
- return /* @__PURE__ */ React15.createElement(
4890
- "svg",
4891
- {
4892
- xmlns: "http://www.w3.org/2000/svg",
4893
- style,
4894
- viewBox: "0 0 24 24",
4895
- fill: "var(--color-icon)"
4896
- },
4897
- /* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
4898
- /* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", d: "M7 10l5 5 5-5z" })
4899
- );
4175
+ return /* @__PURE__ */ React15.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)" }, /* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), /* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", d: "M7 10l5 5 5-5z" }));
4900
4176
  };
4901
4177
  var PopoutIcon = () => {
4902
4178
  return (
@@ -4904,37 +4180,11 @@ var PopoutIcon = () => {
4904
4180
  // <svg xmlns="http://www.w3.org/2000/svg" style={style} fill="none" viewBox="0 0 24 24" stroke="var(--color-icon)" stroke-width="2">
4905
4181
  // <path stroke-linecap="round" stroke-linejoin="round" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
4906
4182
  // </svg>
4907
- /* @__PURE__ */ React15.createElement(
4908
- "svg",
4909
- {
4910
- xmlns: "http://www.w3.org/2000/svg",
4911
- style,
4912
- viewBox: "0 0 20 20",
4913
- fill: "var(--color-icon)"
4914
- },
4915
- /* @__PURE__ */ React15.createElement("path", { d: "M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z" }),
4916
- /* @__PURE__ */ React15.createElement("path", { d: "M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z" })
4917
- )
4183
+ /* @__PURE__ */ React15.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 20 20", fill: "var(--color-icon)" }, /* @__PURE__ */ React15.createElement("path", { d: "M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z" }), /* @__PURE__ */ React15.createElement("path", { d: "M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z" }))
4918
4184
  );
4919
4185
  };
4920
4186
  var RestoreIcon = () => {
4921
- return /* @__PURE__ */ React15.createElement(
4922
- "svg",
4923
- {
4924
- xmlns: "http://www.w3.org/2000/svg",
4925
- style,
4926
- viewBox: "0 0 24 24",
4927
- fill: "var(--color-icon)"
4928
- },
4929
- /* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
4930
- /* @__PURE__ */ React15.createElement(
4931
- "path",
4932
- {
4933
- stroke: "var(--color-icon)",
4934
- d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"
4935
- }
4936
- )
4937
- );
4187
+ return /* @__PURE__ */ React15.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)" }, /* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), /* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" }));
4938
4188
  };
4939
4189
 
4940
4190
  // src/view/Layout.tsx
@@ -5082,43 +4332,16 @@ var Layout = class extends React16.Component {
5082
4332
  /** @internal */
5083
4333
  this.onDragDivMouseDown = (event) => {
5084
4334
  event.preventDefault();
5085
- this.dragStart(
5086
- event,
5087
- this.dragDivText,
5088
- TabNode._fromJson(this.newTabJson, this.props.model, false),
5089
- true,
5090
- void 0,
5091
- void 0
5092
- );
4335
+ this.dragStart(event, this.dragDivText, TabNode._fromJson(this.newTabJson, this.props.model, false), true, void 0, void 0);
5093
4336
  };
5094
4337
  /** @internal */
5095
4338
  this.dragStart = (event, dragDivText, node, allowDrag, onClick, onDoubleClick) => {
5096
4339
  if (!allowDrag) {
5097
- DragDrop.instance.startDrag(
5098
- event,
5099
- void 0,
5100
- void 0,
5101
- void 0,
5102
- void 0,
5103
- onClick,
5104
- onDoubleClick,
5105
- this.currentDocument,
5106
- this.selfRef.current ?? void 0
5107
- );
4340
+ DragDrop.instance.startDrag(event, void 0, void 0, void 0, void 0, onClick, onDoubleClick, this.currentDocument, this.selfRef.current ?? void 0);
5108
4341
  } else {
5109
4342
  this.dragNode = node;
5110
4343
  this.dragDivText = dragDivText;
5111
- DragDrop.instance.startDrag(
5112
- event,
5113
- this.onDragStart,
5114
- this.onDragMove,
5115
- this.onDragEnd,
5116
- this.onCancelDrag,
5117
- onClick,
5118
- onDoubleClick,
5119
- this.currentDocument,
5120
- this.selfRef.current ?? void 0
5121
- );
4344
+ DragDrop.instance.startDrag(event, this.onDragStart, this.onDragMove, this.onDragEnd, this.onCancelDrag, onClick, onDoubleClick, this.currentDocument, this.selfRef.current ?? void 0);
5122
4345
  }
5123
4346
  };
5124
4347
  /** @internal */
@@ -5128,23 +4351,11 @@ var Layout = class extends React16.Component {
5128
4351
  content = /* @__PURE__ */ React16.createElement("div", { style: { whiteSpace: "pre" } }, text.replace("<br>", "\n"));
5129
4352
  } else {
5130
4353
  if (node && node instanceof TabNode) {
5131
- content = /* @__PURE__ */ React16.createElement(
5132
- TabButtonStamp,
5133
- {
5134
- node,
5135
- layout: this,
5136
- iconFactory: this.props.iconFactory,
5137
- titleFactory: this.props.titleFactory
5138
- }
5139
- );
4354
+ content = /* @__PURE__ */ React16.createElement(TabButtonStamp, { node, layout: this, iconFactory: this.props.iconFactory, titleFactory: this.props.titleFactory });
5140
4355
  }
5141
4356
  }
5142
4357
  if (this.props.onRenderDragRect !== void 0) {
5143
- const customContent = this.props.onRenderDragRect(
5144
- content,
5145
- node,
5146
- json
5147
- );
4358
+ const customContent = this.props.onRenderDragRect(content, node, json);
5148
4359
  if (customContent !== void 0) {
5149
4360
  content = customContent;
5150
4361
  }
@@ -5183,24 +4394,16 @@ var Layout = class extends React16.Component {
5183
4394
  this.customDrop = void 0;
5184
4395
  const rootdiv = this.selfRef.current;
5185
4396
  this.outlineDiv = this.currentDocument.createElement("div");
5186
- this.outlineDiv.className = this.getClassName(
5187
- "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
5188
- );
4397
+ this.outlineDiv.className = this.getClassName("flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
5189
4398
  this.outlineDiv.style.visibility = "hidden";
5190
4399
  if (rootdiv) {
5191
4400
  rootdiv.appendChild(this.outlineDiv);
5192
4401
  }
5193
4402
  if (this.dragDiv == null) {
5194
4403
  this.dragDiv = this.currentDocument.createElement("div");
5195
- this.dragDiv.className = this.getClassName(
5196
- "flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */
5197
- );
4404
+ this.dragDiv.className = this.getClassName("flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */);
5198
4405
  this.dragDiv.setAttribute("data-layout-path", "/drag-rectangle");
5199
- this.dragRectRender(
5200
- this.dragDivText,
5201
- this.dragNode,
5202
- this.newTabJson
5203
- );
4406
+ this.dragRectRender(this.dragDivText, this.dragNode, this.newTabJson);
5204
4407
  if (rootdiv) {
5205
4408
  rootdiv.appendChild(this.dragDiv);
5206
4409
  }
@@ -5217,9 +4420,7 @@ var Layout = class extends React16.Component {
5217
4420
  /** @internal */
5218
4421
  this.onDragMove = (event) => {
5219
4422
  if (this.firstMove === false) {
5220
- const speed = this.props.model._getAttribute(
5221
- "tabDragSpeed"
5222
- );
4423
+ const speed = this.props.model._getAttribute("tabDragSpeed");
5223
4424
  if (this.outlineDiv) {
5224
4425
  this.outlineDiv.style.transition = `top ${speed}s, left ${speed}s, width ${speed}s, height ${speed}s`;
5225
4426
  }
@@ -5244,20 +4445,14 @@ var Layout = class extends React16.Component {
5244
4445
  this.dragDiv.style.visibility = "visible";
5245
4446
  }
5246
4447
  }
5247
- let dropInfo = this.props.model._findDropTargetNode(
5248
- this.dragNode,
5249
- pos.x,
5250
- pos.y
5251
- );
4448
+ let dropInfo = this.props.model._findDropTargetNode(this.dragNode, pos.x, pos.y);
5252
4449
  if (dropInfo) {
5253
4450
  if (this.props.onTabDrag) {
5254
4451
  this.handleCustomTabDrag(dropInfo, pos, event);
5255
4452
  } else {
5256
4453
  this.dropInfo = dropInfo;
5257
4454
  if (this.outlineDiv) {
5258
- this.outlineDiv.className = this.getClassName(
5259
- dropInfo.className
5260
- );
4455
+ this.outlineDiv.className = this.getClassName(dropInfo.className);
5261
4456
  dropInfo.rect.positionElement(this.outlineDiv);
5262
4457
  this.outlineDiv.style.visibility = "visible";
5263
4458
  }
@@ -5293,28 +4488,14 @@ var Layout = class extends React16.Component {
5293
4488
  console.error(e);
5294
4489
  }
5295
4490
  } else if (this.newTabJson !== void 0) {
5296
- const newNode = this.doAction(
5297
- Actions.addNode(
5298
- this.newTabJson,
5299
- this.dropInfo.node.getId(),
5300
- this.dropInfo.location,
5301
- this.dropInfo.index
5302
- )
5303
- );
4491
+ const newNode = this.doAction(Actions.addNode(this.newTabJson, this.dropInfo.node.getId(), this.dropInfo.location, this.dropInfo.index));
5304
4492
  if (this.fnNewNodeDropped != null) {
5305
4493
  this.fnNewNodeDropped(newNode, event);
5306
4494
  this.fnNewNodeDropped = void 0;
5307
4495
  }
5308
4496
  this.newTabJson = void 0;
5309
4497
  } else if (this.dragNode !== void 0) {
5310
- this.doAction(
5311
- Actions.moveNode(
5312
- this.dragNode.getId(),
5313
- this.dropInfo.node.getId(),
5314
- this.dropInfo.location,
5315
- this.dropInfo.index
5316
- )
5317
- );
4498
+ this.doAction(Actions.moveNode(this.dragNode.getId(), this.dropInfo.node.getId(), this.dropInfo.location, this.dropInfo.index));
5318
4499
  }
5319
4500
  }
5320
4501
  this.setState({ showHiddenBorder: DockLocation.CENTER });
@@ -5344,16 +4525,10 @@ var Layout = class extends React16.Component {
5344
4525
  if (this.props.font) {
5345
4526
  if (this.selfRef.current) {
5346
4527
  if (this.props.font.size) {
5347
- this.selfRef.current.style.setProperty(
5348
- "--font-size",
5349
- this.props.font.size
5350
- );
4528
+ this.selfRef.current.style.setProperty("--font-size", this.props.font.size);
5351
4529
  }
5352
4530
  if (this.props.font.family) {
5353
- this.selfRef.current.style.setProperty(
5354
- "--font-family",
5355
- this.props.font.family
5356
- );
4531
+ this.selfRef.current.style.setProperty("--font-family", this.props.font.family);
5357
4532
  }
5358
4533
  }
5359
4534
  if (this.props.font.style) {
@@ -5448,18 +4623,9 @@ var Layout = class extends React16.Component {
5448
4623
  /** @internal */
5449
4624
  render() {
5450
4625
  if (!this.selfRef.current) {
5451
- return /* @__PURE__ */ React16.createElement(
5452
- "div",
5453
- {
5454
- ref: this.selfRef,
5455
- className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */)
5456
- },
5457
- this.metricsElements()
5458
- );
4626
+ return /* @__PURE__ */ React16.createElement("div", { ref: this.selfRef, className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */) }, this.metricsElements());
5459
4627
  }
5460
- this.props.model._setPointerFine(
5461
- window && window.matchMedia && window.matchMedia("(pointer: fine)").matches
5462
- );
4628
+ this.props.model._setPointerFine(window && window.matchMedia && window.matchMedia("(pointer: fine)").matches);
5463
4629
  const borderComponents = [];
5464
4630
  const tabSetComponents = [];
5465
4631
  const floatingWindows = [];
@@ -5472,21 +4638,8 @@ var Layout = class extends React16.Component {
5472
4638
  };
5473
4639
  this.props.model._setShowHiddenBorder(this.state.showHiddenBorder);
5474
4640
  this.centerRect = this.props.model._layout(this.state.rect, metrics);
5475
- this.renderBorder(
5476
- this.props.model.getBorderSet(),
5477
- borderComponents,
5478
- tabComponents,
5479
- floatingWindows,
5480
- splitterComponents
5481
- );
5482
- this.renderChildren(
5483
- "",
5484
- this.props.model.getRoot(),
5485
- tabSetComponents,
5486
- tabComponents,
5487
- floatingWindows,
5488
- splitterComponents
5489
- );
4641
+ this.renderBorder(this.props.model.getBorderSet(), borderComponents, tabComponents, floatingWindows, splitterComponents);
4642
+ this.renderChildren("", this.props.model.getRoot(), tabSetComponents, tabComponents, floatingWindows, splitterComponents);
5490
4643
  const nextTopIds = [];
5491
4644
  const nextTopIdsMap = {};
5492
4645
  for (const t of this.tabIds) {
@@ -5514,14 +4667,7 @@ var Layout = class extends React16.Component {
5514
4667
  "div",
5515
4668
  {
5516
4669
  key: "North",
5517
- style: {
5518
- top: r.y,
5519
- left: r.x + r.width / 2 - offset,
5520
- width: length,
5521
- height: width,
5522
- borderBottomLeftRadius: radius,
5523
- borderBottomRightRadius: radius
5524
- },
4670
+ style: { top: r.y, left: r.x + r.width / 2 - offset, width: length, height: width, borderBottomLeftRadius: radius, borderBottomRightRadius: radius },
5525
4671
  className: className + " " + this.getClassName("flexlayout__edge_rect_top" /* FLEXLAYOUT__EDGE_RECT_TOP */)
5526
4672
  }
5527
4673
  )
@@ -5531,14 +4677,7 @@ var Layout = class extends React16.Component {
5531
4677
  "div",
5532
4678
  {
5533
4679
  key: "West",
5534
- style: {
5535
- top: r.y + r.height / 2 - offset,
5536
- left: r.x,
5537
- width,
5538
- height: length,
5539
- borderTopRightRadius: radius,
5540
- borderBottomRightRadius: radius
5541
- },
4680
+ style: { top: r.y + r.height / 2 - offset, left: r.x, width, height: length, borderTopRightRadius: radius, borderBottomRightRadius: radius },
5542
4681
  className: className + " " + this.getClassName("flexlayout__edge_rect_left" /* FLEXLAYOUT__EDGE_RECT_LEFT */)
5543
4682
  }
5544
4683
  )
@@ -5548,14 +4687,7 @@ var Layout = class extends React16.Component {
5548
4687
  "div",
5549
4688
  {
5550
4689
  key: "South",
5551
- style: {
5552
- top: r.y + r.height - width,
5553
- left: r.x + r.width / 2 - offset,
5554
- width: length,
5555
- height: width,
5556
- borderTopLeftRadius: radius,
5557
- borderTopRightRadius: radius
5558
- },
4690
+ style: { top: r.y + r.height - width, left: r.x + r.width / 2 - offset, width: length, height: width, borderTopLeftRadius: radius, borderTopRightRadius: radius },
5559
4691
  className: className + " " + this.getClassName("flexlayout__edge_rect_bottom" /* FLEXLAYOUT__EDGE_RECT_BOTTOM */)
5560
4692
  }
5561
4693
  )
@@ -5565,75 +4697,20 @@ var Layout = class extends React16.Component {
5565
4697
  "div",
5566
4698
  {
5567
4699
  key: "East",
5568
- style: {
5569
- top: r.y + r.height / 2 - offset,
5570
- left: r.x + r.width - width,
5571
- width,
5572
- height: length,
5573
- borderTopLeftRadius: radius,
5574
- borderBottomLeftRadius: radius
5575
- },
4700
+ style: { top: r.y + r.height / 2 - offset, left: r.x + r.width - width, width, height: length, borderTopLeftRadius: radius, borderBottomLeftRadius: radius },
5576
4701
  className: className + " " + this.getClassName("flexlayout__edge_rect_right" /* FLEXLAYOUT__EDGE_RECT_RIGHT */)
5577
4702
  }
5578
4703
  )
5579
4704
  );
5580
4705
  }
5581
- return /* @__PURE__ */ React16.createElement(
5582
- "div",
5583
- {
5584
- ref: this.selfRef,
5585
- className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */),
5586
- onDragEnter: this.props.onExternalDrag ? this.onDragEnter : void 0
5587
- },
5588
- tabSetComponents,
5589
- this.tabIds.map((t) => {
5590
- return tabComponents[t];
5591
- }),
5592
- borderComponents,
5593
- splitterComponents,
5594
- edges,
5595
- floatingWindows,
5596
- this.metricsElements(),
5597
- this.state.portal
5598
- );
4706
+ return /* @__PURE__ */ React16.createElement("div", { ref: this.selfRef, className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */), onDragEnter: this.props.onExternalDrag ? this.onDragEnter : void 0 }, tabSetComponents, this.tabIds.map((t) => {
4707
+ return tabComponents[t];
4708
+ }), borderComponents, splitterComponents, edges, floatingWindows, this.metricsElements(), this.state.portal);
5599
4709
  }
5600
4710
  /** @internal */
5601
4711
  metricsElements() {
5602
4712
  const fontStyle = this.styleFont({ visibility: "hidden" });
5603
- return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
5604
- "div",
5605
- {
5606
- key: "findHeaderBarSize",
5607
- ref: this.findHeaderBarSizeRef,
5608
- style: fontStyle,
5609
- className: this.getClassName(
5610
- "flexlayout__tabset_header_sizer" /* FLEXLAYOUT__TABSET_HEADER_SIZER */
5611
- )
5612
- },
5613
- "FindHeaderBarSize"
5614
- ), /* @__PURE__ */ React16.createElement(
5615
- "div",
5616
- {
5617
- key: "findTabBarSize",
5618
- ref: this.findTabBarSizeRef,
5619
- style: fontStyle,
5620
- className: this.getClassName(
5621
- "flexlayout__tabset_sizer" /* FLEXLAYOUT__TABSET_SIZER */
5622
- )
5623
- },
5624
- "FindTabBarSize"
5625
- ), /* @__PURE__ */ React16.createElement(
5626
- "div",
5627
- {
5628
- key: "findBorderBarSize",
5629
- ref: this.findBorderBarSizeRef,
5630
- style: fontStyle,
5631
- className: this.getClassName(
5632
- "flexlayout__border_sizer" /* FLEXLAYOUT__BORDER_SIZER */
5633
- )
5634
- },
5635
- "FindBorderBarSize"
5636
- ));
4713
+ return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement("div", { key: "findHeaderBarSize", ref: this.findHeaderBarSizeRef, style: fontStyle, className: this.getClassName("flexlayout__tabset_header_sizer" /* FLEXLAYOUT__TABSET_HEADER_SIZER */) }, "FindHeaderBarSize"), /* @__PURE__ */ React16.createElement("div", { key: "findTabBarSize", ref: this.findTabBarSizeRef, style: fontStyle, className: this.getClassName("flexlayout__tabset_sizer" /* FLEXLAYOUT__TABSET_SIZER */) }, "FindTabBarSize"), /* @__PURE__ */ React16.createElement("div", { key: "findBorderBarSize", ref: this.findBorderBarSizeRef, style: fontStyle, className: this.getClassName("flexlayout__border_sizer" /* FLEXLAYOUT__BORDER_SIZER */) }, "FindBorderBarSize"));
5637
4714
  }
5638
4715
  /** @internal */
5639
4716
  renderBorder(borderSet, borderComponents, tabComponents, floatingWindows, splitterComponents) {
@@ -5660,17 +4737,7 @@ var Layout = class extends React16.Component {
5660
4737
  for (const child of drawChildren) {
5661
4738
  if (child instanceof SplitterNode) {
5662
4739
  let path = borderPath + "/s";
5663
- splitterComponents.push(
5664
- /* @__PURE__ */ React16.createElement(
5665
- Splitter,
5666
- {
5667
- key: child.getId(),
5668
- layout: this,
5669
- node: child,
5670
- path
5671
- }
5672
- )
5673
- );
4740
+ splitterComponents.push(/* @__PURE__ */ React16.createElement(Splitter, { key: child.getId(), layout: this, node: child, path }));
5674
4741
  } else if (child instanceof TabNode) {
5675
4742
  let path = borderPath + "/t" + tabCount++;
5676
4743
  if (this.supportsPopout && child.isFloating()) {
@@ -5696,38 +4763,12 @@ var Layout = class extends React16.Component {
5696
4763
  onSetWindow: this.onSetWindow,
5697
4764
  onCloseWindow: this.onCloseWindow
5698
4765
  },
5699
- /* @__PURE__ */ React16.createElement(
5700
- FloatingWindowTab,
5701
- {
5702
- layout: this,
5703
- node: child,
5704
- factory: this.props.factory
5705
- }
5706
- )
4766
+ /* @__PURE__ */ React16.createElement(FloatingWindowTab, { layout: this, node: child, factory: this.props.factory })
5707
4767
  )
5708
4768
  );
5709
- tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
5710
- TabFloating,
5711
- {
5712
- key: child.getId(),
5713
- layout: this,
5714
- path,
5715
- node: child,
5716
- selected: i === border.getSelected()
5717
- }
5718
- );
4769
+ tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(TabFloating, { key: child.getId(), layout: this, path, node: child, selected: i === border.getSelected() });
5719
4770
  } else {
5720
- tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
5721
- Tab,
5722
- {
5723
- key: child.getId(),
5724
- layout: this,
5725
- path,
5726
- node: child,
5727
- selected: i === border.getSelected(),
5728
- factory: this.props.factory
5729
- }
5730
- );
4771
+ tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(Tab, { key: child.getId(), layout: this, path, node: child, selected: i === border.getSelected(), factory: this.props.factory });
5731
4772
  }
5732
4773
  }
5733
4774
  i++;
@@ -5744,41 +4785,13 @@ var Layout = class extends React16.Component {
5744
4785
  for (const child of drawChildren) {
5745
4786
  if (child instanceof SplitterNode) {
5746
4787
  const newPath = path + "/s" + splitterCount++;
5747
- splitterComponents.push(
5748
- /* @__PURE__ */ React16.createElement(
5749
- Splitter,
5750
- {
5751
- key: child.getId(),
5752
- layout: this,
5753
- path: newPath,
5754
- node: child
5755
- }
5756
- )
5757
- );
4788
+ splitterComponents.push(/* @__PURE__ */ React16.createElement(Splitter, { key: child.getId(), layout: this, path: newPath, node: child }));
5758
4789
  } else if (child instanceof TabSetNode) {
5759
4790
  const newPath = path + "/ts" + rowCount++;
5760
4791
  tabSetComponents.push(
5761
- /* @__PURE__ */ React16.createElement(
5762
- TabSet,
5763
- {
5764
- key: child.getId(),
5765
- layout: this,
5766
- path: newPath,
5767
- node: child,
5768
- iconFactory: this.props.iconFactory,
5769
- titleFactory: this.props.titleFactory,
5770
- icons: this.icons
5771
- }
5772
- )
5773
- );
5774
- this.renderChildren(
5775
- newPath,
5776
- child,
5777
- tabSetComponents,
5778
- tabComponents,
5779
- floatingWindows,
5780
- splitterComponents
4792
+ /* @__PURE__ */ React16.createElement(TabSet, { key: child.getId(), layout: this, path: newPath, node: child, iconFactory: this.props.iconFactory, titleFactory: this.props.titleFactory, icons: this.icons })
5781
4793
  );
4794
+ this.renderChildren(newPath, child, tabSetComponents, tabComponents, floatingWindows, splitterComponents);
5782
4795
  } else if (child instanceof TabNode) {
5783
4796
  const newPath = path + "/t" + tabCount++;
5784
4797
  const selectedTab = child.getParent().getChildren()[child.getParent().getSelected()];
@@ -5799,49 +4812,16 @@ var Layout = class extends React16.Component {
5799
4812
  onSetWindow: this.onSetWindow,
5800
4813
  onCloseWindow: this.onCloseWindow
5801
4814
  },
5802
- /* @__PURE__ */ React16.createElement(
5803
- FloatingWindowTab,
5804
- {
5805
- layout: this,
5806
- node: child,
5807
- factory: this.props.factory
5808
- }
5809
- )
4815
+ /* @__PURE__ */ React16.createElement(FloatingWindowTab, { layout: this, node: child, factory: this.props.factory })
5810
4816
  )
5811
4817
  );
5812
- tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
5813
- TabFloating,
5814
- {
5815
- key: child.getId(),
5816
- layout: this,
5817
- path: newPath,
5818
- node: child,
5819
- selected: child === selectedTab
5820
- }
5821
- );
4818
+ tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(TabFloating, { key: child.getId(), layout: this, path: newPath, node: child, selected: child === selectedTab });
5822
4819
  } else {
5823
- tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
5824
- Tab,
5825
- {
5826
- key: child.getId(),
5827
- layout: this,
5828
- path: newPath,
5829
- node: child,
5830
- selected: child === selectedTab,
5831
- factory: this.props.factory
5832
- }
5833
- );
4820
+ tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(Tab, { key: child.getId(), layout: this, path: newPath, node: child, selected: child === selectedTab, factory: this.props.factory });
5834
4821
  }
5835
4822
  } else {
5836
4823
  const newPath = path + (child.getOrientation() === Orientation.HORZ ? "/r" : "/c") + rowCount++;
5837
- this.renderChildren(
5838
- newPath,
5839
- child,
5840
- tabSetComponents,
5841
- tabComponents,
5842
- floatingWindows,
5843
- splitterComponents
5844
- );
4824
+ this.renderChildren(newPath, child, tabSetComponents, tabComponents, floatingWindows, splitterComponents);
5845
4825
  }
5846
4826
  }
5847
4827
  }
@@ -5852,14 +4832,8 @@ var Layout = class extends React16.Component {
5852
4832
  if (!bodyRect) {
5853
4833
  return null;
5854
4834
  }
5855
- const navHeight = Math.min(
5856
- 80,
5857
- this.currentWindow.outerHeight - this.currentWindow.innerHeight
5858
- );
5859
- const navWidth = Math.min(
5860
- 80,
5861
- this.currentWindow.outerWidth - this.currentWindow.innerWidth
5862
- );
4835
+ const navHeight = Math.min(80, this.currentWindow.outerHeight - this.currentWindow.innerHeight);
4836
+ const navWidth = Math.min(80, this.currentWindow.outerWidth - this.currentWindow.innerWidth);
5863
4837
  rect.x = rect.x + bodyRect.x + this.currentWindow.screenX + navWidth;
5864
4838
  rect.y = rect.y + bodyRect.y + this.currentWindow.screenY + navHeight;
5865
4839
  return rect;
@@ -5868,31 +4842,28 @@ var Layout = class extends React16.Component {
5868
4842
  * Adds a new tab to the given tabset
5869
4843
  * @param tabsetId the id of the tabset where the new tab will be added
5870
4844
  * @param json the json for the new tab node
4845
+ * @returns the added tab node or undefined
5871
4846
  */
5872
4847
  addTabToTabSet(tabsetId, json) {
5873
4848
  const tabsetNode = this.props.model.getNodeById(tabsetId);
5874
4849
  if (tabsetNode !== void 0) {
5875
- this.doAction(
5876
- Actions.addNode(json, tabsetId, DockLocation.CENTER, -1)
5877
- );
4850
+ const node = this.doAction(Actions.addNode(json, tabsetId, DockLocation.CENTER, -1));
4851
+ return node;
5878
4852
  }
4853
+ return void 0;
5879
4854
  }
5880
4855
  /**
5881
4856
  * Adds a new tab to the active tabset (if there is one)
5882
4857
  * @param json the json for the new tab node
4858
+ * @returns the added tab node or undefined
5883
4859
  */
5884
4860
  addTabToActiveTabSet(json) {
5885
4861
  const tabsetNode = this.props.model.getActiveTabset();
5886
4862
  if (tabsetNode !== void 0) {
5887
- this.doAction(
5888
- Actions.addNode(
5889
- json,
5890
- tabsetNode.getId(),
5891
- DockLocation.CENTER,
5892
- -1
5893
- )
5894
- );
4863
+ const node = this.doAction(Actions.addNode(json, tabsetNode.getId(), DockLocation.CENTER, -1));
4864
+ return node;
5895
4865
  }
4866
+ return void 0;
5896
4867
  }
5897
4868
  /**
5898
4869
  * Adds a new tab by dragging a labeled panel to the drop location, dragging starts immediatelly
@@ -5903,14 +4874,7 @@ var Layout = class extends React16.Component {
5903
4874
  addTabWithDragAndDrop(dragText, json, onDrop) {
5904
4875
  this.fnNewNodeDropped = onDrop;
5905
4876
  this.newTabJson = json;
5906
- this.dragStart(
5907
- void 0,
5908
- dragText,
5909
- TabNode._fromJson(json, this.props.model, false),
5910
- true,
5911
- void 0,
5912
- void 0
5913
- );
4877
+ this.dragStart(void 0, dragText, TabNode._fromJson(json, this.props.model, false), true, void 0, void 0);
5914
4878
  }
5915
4879
  /**
5916
4880
  * Move a tab/tabset using drag and drop
@@ -5934,32 +4898,20 @@ var Layout = class extends React16.Component {
5934
4898
  DragDrop.instance.addGlass(this.onCancelAdd);
5935
4899
  this.dragDivText = dragText;
5936
4900
  this.dragDiv = this.currentDocument.createElement("div");
5937
- this.dragDiv.className = this.getClassName(
5938
- "flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */
5939
- );
4901
+ this.dragDiv.className = this.getClassName("flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */);
5940
4902
  this.dragDiv.addEventListener("mousedown", this.onDragDivMouseDown);
5941
- this.dragDiv.addEventListener("touchstart", this.onDragDivMouseDown, {
5942
- passive: false
5943
- });
5944
- this.dragRectRender(
5945
- this.dragDivText,
5946
- void 0,
5947
- this.newTabJson,
5948
- () => {
5949
- if (this.dragDiv) {
5950
- this.dragDiv.style.visibility = "visible";
5951
- const domRect = this.dragDiv.getBoundingClientRect();
5952
- const r = new Rect(0, 0, domRect?.width, domRect?.height);
5953
- r.centerInRect(this.state.rect);
5954
- this.dragDiv.setAttribute(
5955
- "data-layout-path",
5956
- "/drag-rectangle"
5957
- );
5958
- this.dragDiv.style.left = r.x + "px";
5959
- this.dragDiv.style.top = r.y + "px";
5960
- }
4903
+ this.dragDiv.addEventListener("touchstart", this.onDragDivMouseDown, { passive: false });
4904
+ this.dragRectRender(this.dragDivText, void 0, this.newTabJson, () => {
4905
+ if (this.dragDiv) {
4906
+ this.dragDiv.style.visibility = "visible";
4907
+ const domRect = this.dragDiv.getBoundingClientRect();
4908
+ const r = new Rect(0, 0, domRect?.width, domRect?.height);
4909
+ r.centerInRect(this.state.rect);
4910
+ this.dragDiv.setAttribute("data-layout-path", "/drag-rectangle");
4911
+ this.dragDiv.style.left = r.x + "px";
4912
+ this.dragDiv.style.top = r.y + "px";
5961
4913
  }
5962
- );
4914
+ });
5963
4915
  const rootdiv = this.selfRef.current;
5964
4916
  rootdiv.appendChild(this.dragDiv);
5965
4917
  }
@@ -5975,22 +4927,10 @@ var Layout = class extends React16.Component {
5975
4927
  if (selected && tabRect?.contains(pos.x, pos.y)) {
5976
4928
  let customDrop = void 0;
5977
4929
  try {
5978
- const dest = this.onTabDrag(
5979
- dragging,
5980
- selected,
5981
- pos.x - tabRect.x,
5982
- pos.y - tabRect.y,
5983
- dropInfo.location,
5984
- () => this.onDragMove(event)
5985
- );
4930
+ const dest = this.onTabDrag(dragging, selected, pos.x - tabRect.x, pos.y - tabRect.y, dropInfo.location, () => this.onDragMove(event));
5986
4931
  if (dest) {
5987
4932
  customDrop = {
5988
- rect: new Rect(
5989
- dest.x + tabRect.x,
5990
- dest.y + tabRect.y,
5991
- dest.width,
5992
- dest.height
5993
- ),
4933
+ rect: new Rect(dest.x + tabRect.x, dest.y + tabRect.y, dest.width, dest.height),
5994
4934
  callback: dest.callback,
5995
4935
  invalidated: dest.invalidated,
5996
4936
  dragging,
@@ -6012,9 +4952,7 @@ var Layout = class extends React16.Component {
6012
4952
  }
6013
4953
  this.dropInfo = dropInfo;
6014
4954
  if (this.outlineDiv) {
6015
- this.outlineDiv.className = this.getClassName(
6016
- this.customDrop ? "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */ : dropInfo.className
6017
- );
4955
+ this.outlineDiv.className = this.getClassName(this.customDrop ? "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */ : dropInfo.className);
6018
4956
  if (this.customDrop) {
6019
4957
  this.customDrop.rect.positionElement(this.outlineDiv);
6020
4958
  } else {
@@ -6039,14 +4977,7 @@ var Layout = class extends React16.Component {
6039
4977
  if (drag) {
6040
4978
  this.fnNewNodeDropped = drag.onDrop;
6041
4979
  this.newTabJson = drag.json;
6042
- this.dragStart(
6043
- event,
6044
- drag.dragText,
6045
- TabNode._fromJson(drag.json, this.props.model, false),
6046
- true,
6047
- void 0,
6048
- void 0
6049
- );
4980
+ this.dragStart(event, drag.dragText, TabNode._fromJson(drag.json, this.props.model, false), true, void 0, void 0);
6050
4981
  }
6051
4982
  }
6052
4983
  /** @internal */
@@ -6141,9 +5072,7 @@ var BorderSet = class _BorderSet {
6141
5072
  /** @internal */
6142
5073
  static _fromJson(json, model) {
6143
5074
  const borderSet = new _BorderSet(model);
6144
- borderSet._borders = json.map(
6145
- (borderJson) => BorderNode._fromJson(borderJson, model)
6146
- );
5075
+ borderSet._borders = json.map((borderJson) => BorderNode._fromJson(borderJson, model));
6147
5076
  return borderSet;
6148
5077
  }
6149
5078
  /** @internal */
@@ -6177,9 +5106,7 @@ var BorderSet = class _BorderSet {
6177
5106
  let sumWidth = 0;
6178
5107
  let adjustableHeight = 0;
6179
5108
  let adjustableWidth = 0;
6180
- const showingBorders = this._borders.filter(
6181
- (border) => border.isShowing()
6182
- );
5109
+ const showingBorders = this._borders.filter((border) => border.isShowing());
6183
5110
  for (const border of showingBorders) {
6184
5111
  border._setAdjustedSize(border.getSize());
6185
5112
  const visible = border.getSelected() !== -1;
@@ -6227,17 +5154,11 @@ var BorderSet = class _BorderSet {
6227
5154
  }
6228
5155
  }
6229
5156
  for (const border of showingBorders) {
6230
- outerInnerRects.outer = border._layoutBorderOuter(
6231
- outerInnerRects.outer,
6232
- metrics
6233
- );
5157
+ outerInnerRects.outer = border._layoutBorderOuter(outerInnerRects.outer, metrics);
6234
5158
  }
6235
5159
  outerInnerRects.inner = outerInnerRects.outer;
6236
5160
  for (const border of showingBorders) {
6237
- outerInnerRects.inner = border._layoutBorderInner(
6238
- outerInnerRects.inner,
6239
- metrics
6240
- );
5161
+ outerInnerRects.inner = border._layoutBorderInner(outerInnerRects.inner, metrics);
6241
5162
  }
6242
5163
  return outerInnerRects;
6243
5164
  }
@@ -6263,10 +5184,7 @@ var Model = class _Model {
6263
5184
  */
6264
5185
  constructor() {
6265
5186
  /** @internal */
6266
- this._borderRects = {
6267
- inner: Rect.empty(),
6268
- outer: Rect.empty()
6269
- };
5187
+ this._borderRects = { inner: Rect.empty(), outer: Rect.empty() };
6270
5188
  this._attributes = {};
6271
5189
  this._idMap = {};
6272
5190
  this._borders = new BorderSet(this);
@@ -6321,6 +5239,7 @@ var Model = class _Model {
6321
5239
  attributeDefinitions.add("tabSetEnableDivide", true).setType(Attribute.BOOLEAN);
6322
5240
  attributeDefinitions.add("tabSetEnableMaximize", true).setType(Attribute.BOOLEAN);
6323
5241
  attributeDefinitions.add("tabSetEnableClose", false).setType(Attribute.BOOLEAN);
5242
+ attributeDefinitions.add("tabSetEnableSingleTabStretch", false).setType(Attribute.BOOLEAN);
6324
5243
  attributeDefinitions.add("tabSetAutoSelectTab", true).setType(Attribute.BOOLEAN);
6325
5244
  attributeDefinitions.add("tabSetClassNameTabStrip", void 0).setType(Attribute.STRING);
6326
5245
  attributeDefinitions.add("tabSetClassNameHeader", void 0).setType(Attribute.STRING);
@@ -6454,12 +5373,7 @@ var Model = class _Model {
6454
5373
  const newNode = new TabNode(this, action.data.json, true);
6455
5374
  const toNode = this._idMap[action.data.toNode];
6456
5375
  if (toNode instanceof TabSetNode || toNode instanceof BorderNode || toNode instanceof RowNode) {
6457
- toNode.drop(
6458
- newNode,
6459
- DockLocation.getByName(action.data.location),
6460
- action.data.index,
6461
- action.data.select
6462
- );
5376
+ toNode.drop(newNode, DockLocation.getByName(action.data.location), action.data.index, action.data.select);
6463
5377
  returnVal = newNode;
6464
5378
  }
6465
5379
  break;
@@ -6469,12 +5383,7 @@ var Model = class _Model {
6469
5383
  if (fromNode instanceof TabNode || fromNode instanceof TabSetNode) {
6470
5384
  const toNode = this._idMap[action.data.toNode];
6471
5385
  if (toNode instanceof TabSetNode || toNode instanceof BorderNode || toNode instanceof RowNode) {
6472
- toNode.drop(
6473
- fromNode,
6474
- DockLocation.getByName(action.data.location),
6475
- action.data.index,
6476
- action.data.select
6477
- );
5386
+ toNode.drop(fromNode, DockLocation.getByName(action.data.location), action.data.index, action.data.select);
6478
5387
  }
6479
5388
  }
6480
5389
  break;
@@ -6561,16 +5470,8 @@ var Model = class _Model {
6561
5470
  const node1 = this._idMap[action.data.node1];
6562
5471
  const node2 = this._idMap[action.data.node2];
6563
5472
  if ((node1 instanceof TabSetNode || node1 instanceof RowNode) && (node2 instanceof TabSetNode || node2 instanceof RowNode)) {
6564
- this._adjustSplitSide(
6565
- node1,
6566
- action.data.weight1,
6567
- action.data.pixelWidth1
6568
- );
6569
- this._adjustSplitSide(
6570
- node2,
6571
- action.data.weight2,
6572
- action.data.pixelWidth2
6573
- );
5473
+ this._adjustSplitSide(node1, action.data.weight1, action.data.pixelWidth1);
5474
+ this._adjustSplitSide(node2, action.data.weight2, action.data.pixelWidth2);
6574
5475
  }
6575
5476
  break;
6576
5477
  }
@@ -6635,11 +5536,7 @@ var Model = class _Model {
6635
5536
  this.visitNodes((node) => {
6636
5537
  node._fireEvent("save", void 0);
6637
5538
  });
6638
- return {
6639
- global,
6640
- borders: this._borders._toJson(),
6641
- layout: this._root.toJson()
6642
- };
5539
+ return { global, borders: this._borders._toJson(), layout: this._root.toJson() };
6643
5540
  }
6644
5541
  getSplitterSize() {
6645
5542
  let splitterSize = this._attributes.splitterSize;
@@ -6661,9 +5558,7 @@ var Model = class _Model {
6661
5558
  _addNode(node) {
6662
5559
  const id = node.getId();
6663
5560
  if (this._idMap[id] !== void 0) {
6664
- throw new Error(
6665
- `Error: each node must have a unique id, duplicate id:${node.getId()}`
6666
- );
5561
+ throw new Error(`Error: each node must have a unique id, duplicate id:${node.getId()}`);
6667
5562
  }
6668
5563
  if (node.getType() !== "splitter") {
6669
5564
  this._idMap[id] = node;
@@ -6671,13 +5566,8 @@ var Model = class _Model {
6671
5566
  }
6672
5567
  /** @internal */
6673
5568
  _layout(rect, metrics) {
6674
- this._borderRects = this._borders._layoutBorder(
6675
- { outer: rect, inner: rect },
6676
- metrics
6677
- );
6678
- rect = this._borderRects.inner.removeInsets(
6679
- this._getAttribute("marginInsets")
6680
- );
5569
+ this._borderRects = this._borders._layoutBorder({ outer: rect, inner: rect }, metrics);
5570
+ rect = this._borderRects.inner.removeInsets(this._getAttribute("marginInsets"));
6681
5571
  this._root?.calcMinSize();
6682
5572
  this._root._layout(rect, metrics);
6683
5573
  return rect;
@@ -6731,36 +5621,11 @@ var Model = class _Model {
6731
5621
  return this._onCreateTabSet;
6732
5622
  }
6733
5623
  static toTypescriptInterfaces() {
6734
- console.log(
6735
- _Model._attributeDefinitions.toTypescriptInterface(
6736
- "Global",
6737
- void 0
6738
- )
6739
- );
6740
- console.log(
6741
- RowNode.getAttributeDefinitions().toTypescriptInterface(
6742
- "Row",
6743
- _Model._attributeDefinitions
6744
- )
6745
- );
6746
- console.log(
6747
- TabSetNode.getAttributeDefinitions().toTypescriptInterface(
6748
- "TabSet",
6749
- _Model._attributeDefinitions
6750
- )
6751
- );
6752
- console.log(
6753
- TabNode.getAttributeDefinitions().toTypescriptInterface(
6754
- "Tab",
6755
- _Model._attributeDefinitions
6756
- )
6757
- );
6758
- console.log(
6759
- BorderNode.getAttributeDefinitions().toTypescriptInterface(
6760
- "Border",
6761
- _Model._attributeDefinitions
6762
- )
6763
- );
5624
+ console.log(_Model._attributeDefinitions.toTypescriptInterface("Global", void 0));
5625
+ console.log(RowNode.getAttributeDefinitions().toTypescriptInterface("Row", _Model._attributeDefinitions));
5626
+ console.log(TabSetNode.getAttributeDefinitions().toTypescriptInterface("TabSet", _Model._attributeDefinitions));
5627
+ console.log(TabNode.getAttributeDefinitions().toTypescriptInterface("Tab", _Model._attributeDefinitions));
5628
+ console.log(BorderNode.getAttributeDefinitions().toTypescriptInterface("Border", _Model._attributeDefinitions));
6764
5629
  }
6765
5630
  toString() {
6766
5631
  return JSON.stringify(this.toJson());