@aptre/flex-layout 0.5.13 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +11 -59
  2. package/dist/I18nLabel.d.ts +0 -1
  3. package/dist/Types.d.ts +0 -7
  4. package/dist/index.d.ts +0 -1
  5. package/dist/index.mjs +595 -1208
  6. package/dist/model/Action.d.ts +1 -34
  7. package/dist/model/Actions.d.ts +1 -30
  8. package/dist/model/IJsonModel.d.ts +0 -55
  9. package/dist/model/Model.d.ts +4 -7
  10. package/dist/model/RowNode.d.ts +0 -1
  11. package/dist/model/TabNode.d.ts +0 -6
  12. package/dist/model/TabSetNode.d.ts +1 -1
  13. package/dist/view/BorderTab.d.ts +1 -2
  14. package/dist/view/Icons.d.ts +6 -8
  15. package/dist/view/Layout.d.ts +25 -32
  16. package/dist/view/OptimizedLayout.d.ts +3 -3
  17. package/dist/view/SizeTracker.d.ts +3 -3
  18. package/dist/view/Utils.d.ts +2 -8
  19. package/package.json +31 -31
  20. package/tsconfig.json +1 -1
  21. package/typedoc/assets/hierarchy.js +1 -1
  22. package/typedoc/assets/navigation.js +1 -1
  23. package/typedoc/assets/search.js +1 -1
  24. package/typedoc/classes/Actions.html +4 -21
  25. package/typedoc/classes/BorderNode.html +1 -1
  26. package/typedoc/classes/Layout.html +17 -17
  27. package/typedoc/classes/Model.html +9 -11
  28. package/typedoc/classes/Node.html +1 -1
  29. package/typedoc/classes/RowNode.html +2 -3
  30. package/typedoc/classes/TabNode.html +2 -8
  31. package/typedoc/classes/TabSetNode.html +1 -1
  32. package/typedoc/enums/CLASSES.html +1 -8
  33. package/typedoc/enums/I18nLabel.html +1 -2
  34. package/typedoc/hierarchy.html +1 -1
  35. package/typedoc/index.html +1 -1
  36. package/typedoc/interfaces/ActionDataMap.html +2 -6
  37. package/typedoc/interfaces/IBorderAttributes.html +1 -1
  38. package/typedoc/interfaces/IGlobalAttributes.html +2 -15
  39. package/typedoc/interfaces/IIcons.html +2 -3
  40. package/typedoc/interfaces/IJsonBorderNode.html +1 -1
  41. package/typedoc/interfaces/IJsonModel.html +2 -3
  42. package/typedoc/interfaces/IJsonRowNode.html +1 -1
  43. package/typedoc/interfaces/IJsonTabNode.html +4 -17
  44. package/typedoc/interfaces/IJsonTabSetNode.html +1 -1
  45. package/typedoc/interfaces/ILayoutProps.html +3 -9
  46. package/typedoc/interfaces/IOptimizedLayoutProps.html +4 -10
  47. package/typedoc/interfaces/IRowAttributes.html +1 -1
  48. package/typedoc/interfaces/ITabAttributes.html +2 -15
  49. package/typedoc/interfaces/ITabSetAttributes.html +1 -1
  50. package/typedoc/types/Action.html +1 -1
  51. package/typedoc/types/DragRectRenderCallback.html +1 -1
  52. package/typedoc/types/NodeMouseEvent.html +1 -1
  53. package/typedoc/types/ShowOverflowMenuCallback.html +1 -1
  54. package/typedoc/types/TabSetPlaceHolderCallback.html +1 -1
  55. package/typedoc/variables/ActionType.html +2 -2
  56. package/dist/model/LayoutWindow.d.ts +0 -28
  57. package/dist/view/PopoutWindow.d.ts +0 -1
  58. package/typedoc/classes/LayoutWindow.html +0 -12
  59. package/typedoc/interfaces/CloseWindowData.html +0 -2
  60. package/typedoc/interfaces/CreateWindowData.html +0 -3
  61. package/typedoc/interfaces/IJsonPopout.html +0 -3
  62. package/typedoc/interfaces/PopoutTabData.html +0 -2
  63. package/typedoc/interfaces/PopoutTabsetData.html +0 -2
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/view/Layout.tsx
2
- import * as React19 from "react";
3
- import { createPortal as createPortal3 } from "react-dom";
2
+ import { Component as Component2, createRef } from "react";
3
+ import { createPortal as createPortal2 } from "react-dom";
4
4
  import { createRoot } from "react-dom/client";
5
5
 
6
6
  // src/Orientation.ts
@@ -245,7 +245,6 @@ var I18nLabel = /* @__PURE__ */ ((I18nLabel2) => {
245
245
  I18nLabel2["Move_Tabs"] = "Move tabs(?)";
246
246
  I18nLabel2["Maximize"] = "Maximize tab set";
247
247
  I18nLabel2["Restore"] = "Restore tab set";
248
- I18nLabel2["Popout_Tab"] = "Popout selected tab";
249
248
  I18nLabel2["Overflow_Menu_Tooltip"] = "Hidden tabs";
250
249
  I18nLabel2["Error_rendering_component"] = "Error rendering component";
251
250
  return I18nLabel2;
@@ -274,7 +273,6 @@ var CLASSES = /* @__PURE__ */ ((CLASSES2) => {
274
273
  CLASSES2["FLEXLAYOUT__BORDER_TOOLBAR"] = "flexlayout__border_toolbar";
275
274
  CLASSES2["FLEXLAYOUT__BORDER_TOOLBAR_"] = "flexlayout__border_toolbar_";
276
275
  CLASSES2["FLEXLAYOUT__BORDER_TOOLBAR_BUTTON"] = "flexlayout__border_toolbar_button";
277
- CLASSES2["FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT"] = "flexlayout__border_toolbar_button-float";
278
276
  CLASSES2["FLEXLAYOUT__DRAG_RECT"] = "flexlayout__drag_rect";
279
277
  CLASSES2["FLEXLAYOUT__EDGE_RECT"] = "flexlayout__edge_rect";
280
278
  CLASSES2["FLEXLAYOUT__EDGE_RECT_TOP"] = "flexlayout__edge_rect_top";
@@ -283,8 +281,6 @@ var CLASSES = /* @__PURE__ */ ((CLASSES2) => {
283
281
  CLASSES2["FLEXLAYOUT__EDGE_RECT_RIGHT"] = "flexlayout__edge_rect_right";
284
282
  CLASSES2["FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER"] = "flexlayout__error_boundary_container";
285
283
  CLASSES2["FLEXLAYOUT__ERROR_BOUNDARY_CONTENT"] = "flexlayout__error_boundary_content";
286
- CLASSES2["FLEXLAYOUT__FLOATING_WINDOW_CONTENT"] = "flexlayout__floating_window_content";
287
- CLASSES2["FLEXLAYOUT__FLOATING_WINDOW_TAB"] = "flexlayout__floating_window_tab";
288
284
  CLASSES2["FLEXLAYOUT__LAYOUT"] = "flexlayout__layout";
289
285
  CLASSES2["FLEXLAYOUT__LAYOUT_MOVEABLES"] = "flexlayout__layout_moveables";
290
286
  CLASSES2["FLEXLAYOUT__LAYOUT_OVERLAY"] = "flexlayout__layout_overlay";
@@ -306,7 +302,6 @@ var CLASSES = /* @__PURE__ */ ((CLASSES2) => {
306
302
  CLASSES2["FLEXLAYOUT__TAB"] = "flexlayout__tab";
307
303
  CLASSES2["FLEXLAYOUT__TAB_POSITION"] = "flexlayout__tab_position";
308
304
  CLASSES2["FLEXLAYOUT__TAB_MOVEABLE"] = "flexlayout__tab_moveable";
309
- CLASSES2["FLEXLAYOUT__TAB_OVERLAY"] = "flexlayout__tab_overlay";
310
305
  CLASSES2["FLEXLAYOUT__TABSET"] = "flexlayout__tabset";
311
306
  CLASSES2["FLEXLAYOUT__TABSET_CONTAINER"] = "flexlayout__tabset_container";
312
307
  CLASSES2["FLEXLAYOUT__TABSET_HEADER"] = "flexlayout__tabset_header";
@@ -334,13 +329,10 @@ var CLASSES = /* @__PURE__ */ ((CLASSES2) => {
334
329
  CLASSES2["FLEXLAYOUT__TAB_BUTTON_TEXTBOX"] = "flexlayout__tab_button_textbox";
335
330
  CLASSES2["FLEXLAYOUT__TAB_BUTTON_TRAILING"] = "flexlayout__tab_button_trailing";
336
331
  CLASSES2["FLEXLAYOUT__TAB_BUTTON_STAMP"] = "flexlayout__tab_button_stamp";
337
- CLASSES2["FLEXLAYOUT__TAB_FLOATING"] = "flexlayout__tab_floating";
338
- CLASSES2["FLEXLAYOUT__TAB_FLOATING_INNER"] = "flexlayout__tab_floating_inner";
339
332
  CLASSES2["FLEXLAYOUT__TAB_TOOLBAR"] = "flexlayout__tab_toolbar";
340
333
  CLASSES2["FLEXLAYOUT__TAB_TOOLBAR_BUTTON"] = "flexlayout__tab_toolbar_button";
341
334
  CLASSES2["FLEXLAYOUT__TAB_TOOLBAR_ICON"] = "flexlayout__tab_toolbar_icon";
342
335
  CLASSES2["FLEXLAYOUT__TAB_TOOLBAR_BUTTON_"] = "flexlayout__tab_toolbar_button-";
343
- CLASSES2["FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT"] = "flexlayout__tab_toolbar_button-float";
344
336
  CLASSES2["FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER"] = "flexlayout__tab_toolbar_sticky_buttons_container";
345
337
  CLASSES2["FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE"] = "flexlayout__tab_toolbar_button-close";
346
338
  CLASSES2["FLEXLAYOUT__POPUP_MENU_CONTAINER"] = "flexlayout__popup_menu_container";
@@ -362,11 +354,7 @@ var ActionType = {
362
354
  ADJUST_BORDER_SPLIT: "FlexLayout_AdjustBorderSplit",
363
355
  MAXIMIZE_TOGGLE: "FlexLayout_MaximizeToggle",
364
356
  UPDATE_MODEL_ATTRIBUTES: "FlexLayout_UpdateModelAttributes",
365
- UPDATE_NODE_ATTRIBUTES: "FlexLayout_UpdateNodeAttributes",
366
- POPOUT_TAB: "FlexLayout_PopoutTab",
367
- POPOUT_TABSET: "FlexLayout_PopoutTabset",
368
- CLOSE_WINDOW: "FlexLayout_CloseWindow",
369
- CREATE_WINDOW: "FlexLayout_CreateWindow"
357
+ UPDATE_NODE_ATTRIBUTES: "FlexLayout_UpdateNodeAttributes"
370
358
  };
371
359
  function createAction(type, data) {
372
360
  return { type, data };
@@ -386,10 +374,6 @@ var Actions = class {
386
374
  static MAXIMIZE_TOGGLE = ActionType.MAXIMIZE_TOGGLE;
387
375
  static UPDATE_MODEL_ATTRIBUTES = ActionType.UPDATE_MODEL_ATTRIBUTES;
388
376
  static UPDATE_NODE_ATTRIBUTES = ActionType.UPDATE_NODE_ATTRIBUTES;
389
- static POPOUT_TAB = ActionType.POPOUT_TAB;
390
- static POPOUT_TABSET = ActionType.POPOUT_TABSET;
391
- static CLOSE_WINDOW = ActionType.CLOSE_WINDOW;
392
- static CREATE_WINDOW = ActionType.CREATE_WINDOW;
393
377
  /**
394
378
  * Adds a tab node to the given tabset node
395
379
  * @param json the json for the new tab node e.g {type:"tab", component:"table"}
@@ -504,39 +488,6 @@ var Actions = class {
504
488
  static updateNodeAttributes(nodeId, attributes) {
505
489
  return createAction(ActionType.UPDATE_NODE_ATTRIBUTES, { node: nodeId, json: attributes });
506
490
  }
507
- /**
508
- * Pops out the given tab node into a new browser window
509
- * @param nodeId the tab node to popout
510
- * @returns
511
- */
512
- static popoutTab(nodeId) {
513
- return createAction(ActionType.POPOUT_TAB, { node: nodeId });
514
- }
515
- /**
516
- * Pops out the given tab set node into a new browser window
517
- * @param nodeId the tab set node to popout
518
- * @returns
519
- */
520
- static popoutTabset(nodeId) {
521
- return createAction(ActionType.POPOUT_TABSET, { node: nodeId });
522
- }
523
- /**
524
- * Closes the popout window
525
- * @param windowId the id of the popout window to close
526
- * @returns
527
- */
528
- static closeWindow(windowId) {
529
- return createAction(ActionType.CLOSE_WINDOW, { windowId });
530
- }
531
- /**
532
- * Creates a new empty popout window with the given layout
533
- * @param layout the json layout for the new window
534
- * @param rect the window rectangle in screen coordinates
535
- * @returns
536
- */
537
- static createWindow(layout, rect) {
538
- return createAction(ActionType.CREATE_WINDOW, { layout, rect });
539
- }
540
491
  };
541
492
 
542
493
  // src/Attribute.ts
@@ -1025,9 +976,6 @@ var Node = class {
1025
976
  }
1026
977
  };
1027
978
 
1028
- // src/view/Utils.tsx
1029
- import * as React from "react";
1030
-
1031
979
  // src/model/TabNode.ts
1032
980
  var TabNode = class _TabNode extends Node {
1033
981
  static TYPE = "tab";
@@ -1077,18 +1025,8 @@ var TabNode = class _TabNode extends Node {
1077
1025
  return this.getAttr("component");
1078
1026
  }
1079
1027
  getWindowId() {
1080
- if (this.parent instanceof TabSetNode) {
1081
- return this.parent.getWindowId();
1082
- }
1083
1028
  return Model.MAIN_WINDOW_ID;
1084
1029
  }
1085
- getWindow() {
1086
- const layoutWindow = this.model.getwindowsMap().get(this.getWindowId());
1087
- if (layoutWindow) {
1088
- return layoutWindow.window;
1089
- }
1090
- return void 0;
1091
- }
1092
1030
  /**
1093
1031
  * Returns the config attribute that can be used to store node specific data that
1094
1032
  * WILL be saved to the json. The config attribute should be changed via the action Actions.updateNodeAttributes rather
@@ -1106,9 +1044,6 @@ var TabNode = class _TabNode extends Node {
1106
1044
  getExtraData() {
1107
1045
  return this.extra;
1108
1046
  }
1109
- isPoppedOut() {
1110
- return this.getWindowId() !== Model.MAIN_WINDOW_ID;
1111
- }
1112
1047
  isSelected() {
1113
1048
  return this.getParent().getSelectedNode() === this;
1114
1049
  }
@@ -1121,24 +1056,12 @@ var TabNode = class _TabNode extends Node {
1121
1056
  getCloseType() {
1122
1057
  return this.getAttr("closeType");
1123
1058
  }
1124
- isEnablePopout() {
1125
- return this.getAttr("enablePopout");
1126
- }
1127
- isEnablePopoutIcon() {
1128
- return this.getAttr("enablePopoutIcon");
1129
- }
1130
- isEnablePopoutOverlay() {
1131
- return this.getAttr("enablePopoutOverlay");
1132
- }
1133
1059
  isEnableDrag() {
1134
1060
  return this.getAttr("enableDrag");
1135
1061
  }
1136
1062
  isEnableRename() {
1137
1063
  return this.getAttr("enableRename");
1138
1064
  }
1139
- isEnableWindowReMount() {
1140
- return this.getAttr("enableWindowReMount");
1141
- }
1142
1065
  getClassName() {
1143
1066
  return this.getAttr("className");
1144
1067
  }
@@ -1304,7 +1227,6 @@ var TabNode = class _TabNode extends Node {
1304
1227
  attributeDefinitions.add("component", void 0).setType(Attribute.STRING).setDescription(`string identifying which component to run (for factory)`);
1305
1228
  attributeDefinitions.add("config", void 0).setType("any").setDescription(`a place to hold json config for the hosted component`);
1306
1229
  attributeDefinitions.add("tabsetClassName", void 0).setType(Attribute.STRING).setDescription(`class applied to parent tabset when this is the only tab and it is stretched to fill the tabset`);
1307
- attributeDefinitions.add("enableWindowReMount", false).setType(Attribute.BOOLEAN).setDescription(`if enabled the tab will re-mount when popped out/in`);
1308
1230
  attributeDefinitions.addInherited("enableClose", "tabEnableClose").setType(Attribute.BOOLEAN).setDescription(`allow user to close tab via close button`);
1309
1231
  attributeDefinitions.addInherited("closeType", "tabCloseType").setType("ICloseType").setDescription(`see values in ICloseType`);
1310
1232
  attributeDefinitions.addInherited("enableDrag", "tabEnableDrag").setType(Attribute.BOOLEAN).setDescription(`allow user to drag tab to new location`);
@@ -1313,12 +1235,6 @@ var TabNode = class _TabNode extends Node {
1313
1235
  attributeDefinitions.addInherited("contentClassName", "tabContentClassName").setType(Attribute.STRING).setDescription(`class applied to tab content`);
1314
1236
  attributeDefinitions.addInherited("icon", "tabIcon").setType(Attribute.STRING).setDescription(`the tab icon`);
1315
1237
  attributeDefinitions.addInherited("enableRenderOnDemand", "tabEnableRenderOnDemand").setType(Attribute.BOOLEAN).setDescription(`whether to avoid rendering component until tab is visible`);
1316
- attributeDefinitions.addInherited("enablePopout", "tabEnablePopout").setType(Attribute.BOOLEAN).setAlias("enableFloat").setDescription(`enable popout (in popout capable browser)`);
1317
- attributeDefinitions.addInherited("enablePopoutIcon", "tabEnablePopoutIcon").setType(Attribute.BOOLEAN).setDescription(`whether to show the popout icon in the tabset header if this tab enables popouts`);
1318
- attributeDefinitions.addInherited("enablePopoutOverlay", "tabEnablePopoutOverlay").setType(Attribute.BOOLEAN).setDescription(
1319
- `if this tab will not work correctly in a popout window when the main window is backgrounded (inactive)
1320
- then enabling this option will gray out this tab`
1321
- );
1322
1238
  attributeDefinitions.addInherited("borderWidth", "tabBorderWidth").setType(Attribute.NUMBER).setDescription(`width when added to border, -1 will use border size`);
1323
1239
  attributeDefinitions.addInherited("borderHeight", "tabBorderHeight").setType(Attribute.NUMBER).setDescription(`height when added to border, -1 will use border size`);
1324
1240
  attributeDefinitions.addInherited("minWidth", "tabMinWidth").setType(Attribute.NUMBER).setDescription(`the min width of this tab`);
@@ -1329,133 +1245,6 @@ var TabNode = class _TabNode extends Node {
1329
1245
  }
1330
1246
  };
1331
1247
 
1332
- // src/model/ICloseType.ts
1333
- var ICloseType = /* @__PURE__ */ ((ICloseType2) => {
1334
- ICloseType2[ICloseType2["Visible"] = 1] = "Visible";
1335
- ICloseType2[ICloseType2["Always"] = 2] = "Always";
1336
- ICloseType2[ICloseType2["Selected"] = 3] = "Selected";
1337
- return ICloseType2;
1338
- })(ICloseType || {});
1339
-
1340
- // src/view/Utils.tsx
1341
- function isDesktop() {
1342
- const desktop = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(hover: hover) and (pointer: fine)").matches;
1343
- return desktop;
1344
- }
1345
- function getRenderStateEx(layout, node, iconAngle) {
1346
- let leadingContent = void 0;
1347
- const titleContent = node.getName();
1348
- const name = node.getName();
1349
- if (iconAngle === void 0) {
1350
- iconAngle = 0;
1351
- }
1352
- if (leadingContent === void 0 && node.getIcon() !== void 0) {
1353
- if (iconAngle !== 0) {
1354
- leadingContent = /* @__PURE__ */ React.createElement("img", { style: { width: "1em", height: "1em", transform: "rotate(" + iconAngle + "deg)" }, src: node.getIcon(), alt: "leadingContent" });
1355
- } else {
1356
- leadingContent = /* @__PURE__ */ React.createElement("img", { style: { width: "1em", height: "1em" }, src: node.getIcon(), alt: "leadingContent" });
1357
- }
1358
- }
1359
- const buttons = [];
1360
- const renderState = { leading: leadingContent, content: titleContent, name, buttons };
1361
- layout.customizeTab(node, renderState);
1362
- node.setRenderedName(renderState.name);
1363
- return renderState;
1364
- }
1365
- function isAuxMouseEvent(event) {
1366
- let auxEvent = false;
1367
- if (event.nativeEvent instanceof MouseEvent) {
1368
- if (event.nativeEvent.button !== 0 || event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) {
1369
- auxEvent = true;
1370
- }
1371
- }
1372
- return auxEvent;
1373
- }
1374
- function enablePointerOnIFrames(enable, currentDocument) {
1375
- const iframes = [...getElementsByTagName("iframe", currentDocument), ...getElementsByTagName("webview", currentDocument)];
1376
- for (const iframe of iframes) {
1377
- iframe.style.pointerEvents = enable ? "auto" : "none";
1378
- }
1379
- }
1380
- function getElementsByTagName(tag, currentDocument) {
1381
- return [...currentDocument.getElementsByTagName(tag)];
1382
- }
1383
- function startDrag(doc, event, drag, dragEnd, dragCancel) {
1384
- event.preventDefault();
1385
- const pointerMove = (ev) => {
1386
- ev.preventDefault();
1387
- drag(ev.clientX, ev.clientY);
1388
- };
1389
- const pointerCancel = (ev) => {
1390
- ev.preventDefault();
1391
- dragCancel();
1392
- };
1393
- const pointerUp = () => {
1394
- doc.removeEventListener("pointermove", pointerMove);
1395
- doc.removeEventListener("pointerup", pointerUp);
1396
- doc.removeEventListener("pointercancel", pointerCancel);
1397
- dragEnd();
1398
- };
1399
- doc.addEventListener("pointermove", pointerMove);
1400
- doc.addEventListener("pointerup", pointerUp);
1401
- doc.addEventListener("pointercancel", pointerCancel);
1402
- }
1403
- function canDockToWindow(node) {
1404
- if (node instanceof TabNode) {
1405
- return node.isEnablePopout();
1406
- } else if (node instanceof TabSetNode) {
1407
- for (const child of node.getChildren()) {
1408
- if (child.isEnablePopout() === false) {
1409
- return false;
1410
- }
1411
- }
1412
- return true;
1413
- }
1414
- return false;
1415
- }
1416
- function keepOnScreen(rect) {
1417
- rect.snap(10);
1418
- const availableScreenWidth = window.screen.availWidth;
1419
- const availableScreenHeight = window.screen.availHeight;
1420
- if (rect.x + rect.width > availableScreenWidth || rect.y + rect.height > availableScreenHeight) {
1421
- rect.x = Math.max(0, Math.min(rect.x, availableScreenWidth - rect.width));
1422
- rect.y = Math.max(0, Math.min(rect.y, availableScreenHeight - rect.height));
1423
- }
1424
- return rect;
1425
- }
1426
- function isOnScreen(rect) {
1427
- const availableScreenWidth = window.screen.availWidth;
1428
- const availableScreenHeight = window.screen.availHeight;
1429
- return rect.x >= 0 && rect.getRight() <= availableScreenWidth && rect.y >= 0 || rect.getBottom() <= availableScreenHeight;
1430
- }
1431
- function copyInlineStyles(source, target) {
1432
- const sourceStyle = source.getAttribute("style");
1433
- const targetStyle = target.getAttribute("style");
1434
- if (sourceStyle === targetStyle) return false;
1435
- if (sourceStyle) {
1436
- target.setAttribute("style", sourceStyle);
1437
- } else {
1438
- target.removeAttribute("style");
1439
- }
1440
- return true;
1441
- }
1442
- function isSafari() {
1443
- const userAgent = navigator.userAgent;
1444
- return userAgent.includes("Safari") && !userAgent.includes("Chrome") && !userAgent.includes("Chromium");
1445
- }
1446
- function isTabClosable(node, selected) {
1447
- const closeType = node.getCloseType();
1448
- if (selected || closeType === 2 /* Always */) {
1449
- return true;
1450
- }
1451
- if (closeType === 1 /* Visible */) {
1452
- if (window.matchMedia && window.matchMedia("(hover: hover) and (pointer: fine)").matches) {
1453
- return true;
1454
- }
1455
- }
1456
- return false;
1457
- }
1458
-
1459
1248
  // src/model/Utils.ts
1460
1249
  function adjustSelectedIndex(parent, removedIndex) {
1461
1250
  if (parent !== void 0 && (parent instanceof TabSetNode || parent instanceof BorderNode)) {
@@ -1483,7 +1272,7 @@ function randomUUID() {
1483
1272
  var TabSetNode = class _TabSetNode extends Node {
1484
1273
  static TYPE = "tabset";
1485
1274
  /** @internal */
1486
- static fromJson(json, model, layoutWindow) {
1275
+ static fromJson(json, model) {
1487
1276
  const newLayoutNode = new _TabSetNode(model, json);
1488
1277
  if (json.children != null) {
1489
1278
  for (const jsonChild of json.children) {
@@ -1495,10 +1284,10 @@ var TabSetNode = class _TabSetNode extends Node {
1495
1284
  newLayoutNode.setSelected(-1);
1496
1285
  }
1497
1286
  if (json.maximized && json.maximized === true) {
1498
- layoutWindow.maximizedTabSet = newLayoutNode;
1287
+ model.setMaximizedTabset(newLayoutNode);
1499
1288
  }
1500
1289
  if (json.active && json.active === true) {
1501
- layoutWindow.activeTabSet = newLayoutNode;
1290
+ model.setActiveTabset(newLayoutNode);
1502
1291
  }
1503
1292
  return newLayoutNode;
1504
1293
  }
@@ -1565,9 +1354,8 @@ var TabSetNode = class _TabSetNode extends Node {
1565
1354
  getMinSize(orientation) {
1566
1355
  if (orientation === Orientation.HORZ) {
1567
1356
  return this.getMinWidth();
1568
- } else {
1569
- return this.getMinHeight();
1570
1357
  }
1358
+ return this.getMinHeight();
1571
1359
  }
1572
1360
  getAttrMaxWidth() {
1573
1361
  return this.getAttr("maxWidth");
@@ -1585,9 +1373,8 @@ var TabSetNode = class _TabSetNode extends Node {
1585
1373
  getMaxSize(orientation) {
1586
1374
  if (orientation === Orientation.HORZ) {
1587
1375
  return this.getMaxWidth();
1588
- } else {
1589
- return this.getMaxHeight();
1590
1376
  }
1377
+ return this.getMaxHeight();
1591
1378
  }
1592
1379
  /**
1593
1380
  * Returns the config attribute that can be used to store node specific data that
@@ -1600,10 +1387,10 @@ var TabSetNode = class _TabSetNode extends Node {
1600
1387
  return this.attributes.config;
1601
1388
  }
1602
1389
  isMaximized() {
1603
- return this.model.getMaximizedTabset(this.getWindowId()) === this;
1390
+ return this.model.getMaximizedTabset() === this;
1604
1391
  }
1605
1392
  isActive() {
1606
- return this.model.getActiveTabset(this.getWindowId()) === this;
1393
+ return this.model.getActiveTabset() === this;
1607
1394
  }
1608
1395
  isEnableDeleteWhenEmpty() {
1609
1396
  return this.getAttr("enableDeleteWhenEmpty");
@@ -1641,6 +1428,9 @@ var TabSetNode = class _TabSetNode extends Node {
1641
1428
  getTabLocation() {
1642
1429
  return this.getAttr("tabLocation");
1643
1430
  }
1431
+ getWindowId() {
1432
+ return Model.MAIN_WINDOW_ID;
1433
+ }
1644
1434
  toJson() {
1645
1435
  const json = {};
1646
1436
  _TabSetNode.attributeDefinitions.toJson(json, this.attributes);
@@ -1672,10 +1462,10 @@ var TabSetNode = class _TabSetNode extends Node {
1672
1462
  /** @internal */
1673
1463
  canMaximize() {
1674
1464
  if (this.isEnableMaximize()) {
1675
- if (this.getModel().getMaximizedTabset(this.getWindowId()) === this) {
1465
+ if (this.getModel().getMaximizedTabset() === this) {
1676
1466
  return true;
1677
1467
  }
1678
- if (this.getParent() === this.getModel().getRoot(this.getWindowId()) && this.getModel().getRoot(this.getWindowId()).getChildren().length === 1) {
1468
+ if (this.getParent() === this.getModel().getRoot() && this.getModel().getRoot().getChildren().length === 1) {
1679
1469
  return false;
1680
1470
  }
1681
1471
  return true;
@@ -1710,9 +1500,6 @@ var TabSetNode = class _TabSetNode extends Node {
1710
1500
  setSelected(index) {
1711
1501
  this.attributes.selected = index;
1712
1502
  }
1713
- getWindowId() {
1714
- return this.parent.getWindowId();
1715
- }
1716
1503
  /** @internal */
1717
1504
  canDrop(dragNode, x, y) {
1718
1505
  let dropInfo;
@@ -1720,11 +1507,9 @@ var TabSetNode = class _TabSetNode extends Node {
1720
1507
  const dockLocation = DockLocation.CENTER;
1721
1508
  const outlineRect = this.tabStripRect;
1722
1509
  dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
1723
- } else if (this.getWindowId() !== Model.MAIN_WINDOW_ID && !canDockToWindow(dragNode)) {
1724
- return void 0;
1725
1510
  } else if (this.contentRect.contains(x, y)) {
1726
1511
  let dockLocation = DockLocation.CENTER;
1727
- if (this.model.getMaximizedTabset(this.parent.getWindowId()) === void 0) {
1512
+ if (this.model.getMaximizedTabset() === void 0) {
1728
1513
  dockLocation = DockLocation.getLocation(this.contentRect, x, y);
1729
1514
  }
1730
1515
  const outlineRect = dockLocation.getDockRect(this.rect);
@@ -1744,7 +1529,7 @@ var TabSetNode = class _TabSetNode extends Node {
1744
1529
  yy = r.y;
1745
1530
  h = r.height;
1746
1531
  let p = this.tabStripRect.x;
1747
- let childCenter = 0;
1532
+ let childCenter;
1748
1533
  for (let i = 0; i < this.children.length; i++) {
1749
1534
  child = this.children[i];
1750
1535
  r = child.getTabRect();
@@ -1789,7 +1574,7 @@ var TabSetNode = class _TabSetNode extends Node {
1789
1574
  if (this === dragNode) {
1790
1575
  return;
1791
1576
  }
1792
- let dragParent = dragNode.getParent();
1577
+ const dragParent = dragNode.getParent();
1793
1578
  let fromIndex = 0;
1794
1579
  if (dragParent !== void 0) {
1795
1580
  fromIndex = dragParent.removeChild(dragNode);
@@ -1829,7 +1614,7 @@ var TabSetNode = class _TabSetNode extends Node {
1829
1614
  this.setSelected(0);
1830
1615
  }
1831
1616
  }
1832
- this.model.setActiveTabset(this, this.parent.getWindowId());
1617
+ this.model.setActiveTabset(this);
1833
1618
  } else {
1834
1619
  let moveNode = dragNode;
1835
1620
  if (dragNode instanceof TabNode) {
@@ -1837,11 +1622,10 @@ var TabSetNode = class _TabSetNode extends Node {
1837
1622
  const attrs = callback ? callback(dragNode) : {};
1838
1623
  moveNode = new _TabSetNode(this.model, attrs);
1839
1624
  moveNode.addChild(dragNode);
1840
- dragParent = moveNode;
1841
1625
  } else if (dragNode instanceof RowNode) {
1842
1626
  const parent = this.getParent();
1843
1627
  if (dragNode.getOrientation() === parent.getOrientation() && (location.getOrientation() === parent.getOrientation() || location === DockLocation.CENTER)) {
1844
- const node = new RowNode(this.model, this.getWindowId(), {});
1628
+ const node = new RowNode(this.model, {});
1845
1629
  node.addChild(dragNode);
1846
1630
  moveNode = node;
1847
1631
  }
@@ -1855,7 +1639,7 @@ var TabSetNode = class _TabSetNode extends Node {
1855
1639
  this.setWeight(this.getWeight() / 2);
1856
1640
  parentRow.addChild(moveNode, pos + dockLocation.indexPlus);
1857
1641
  } else {
1858
- const newRow = new RowNode(this.model, this.getWindowId(), {});
1642
+ const newRow = new RowNode(this.model, {});
1859
1643
  newRow.setWeight(this.getWeight());
1860
1644
  newRow.addChild(this);
1861
1645
  this.setWeight(50);
@@ -1865,7 +1649,7 @@ var TabSetNode = class _TabSetNode extends Node {
1865
1649
  parentRow.addChild(newRow, pos);
1866
1650
  }
1867
1651
  if (moveNode instanceof _TabSetNode) {
1868
- this.model.setActiveTabset(moveNode, this.getWindowId());
1652
+ this.model.setActiveTabset(moveNode);
1869
1653
  }
1870
1654
  }
1871
1655
  this.model.tidy();
@@ -1916,15 +1700,15 @@ var TabSetNode = class _TabSetNode extends Node {
1916
1700
  var RowNode = class _RowNode extends Node {
1917
1701
  static TYPE = "row";
1918
1702
  /** @internal */
1919
- static fromJson(json, model, layoutWindow) {
1920
- const newLayoutNode = new _RowNode(model, layoutWindow.windowId, json);
1703
+ static fromJson(json, model) {
1704
+ const newLayoutNode = new _RowNode(model, json);
1921
1705
  if (json.children != null) {
1922
1706
  for (const jsonChild of json.children) {
1923
1707
  if (jsonChild.type === TabSetNode.TYPE) {
1924
- const child = TabSetNode.fromJson(jsonChild, model, layoutWindow);
1708
+ const child = TabSetNode.fromJson(jsonChild, model);
1925
1709
  newLayoutNode.addChild(child);
1926
1710
  } else {
1927
- const child = _RowNode.fromJson(jsonChild, model, layoutWindow);
1711
+ const child = _RowNode.fromJson(jsonChild, model);
1928
1712
  newLayoutNode.addChild(child);
1929
1713
  }
1930
1714
  }
@@ -1934,8 +1718,6 @@ var RowNode = class _RowNode extends Node {
1934
1718
  /** @internal */
1935
1719
  static attributeDefinitions = _RowNode.createAttributeDefinitions();
1936
1720
  /** @internal */
1937
- windowId;
1938
- /** @internal */
1939
1721
  minHeight;
1940
1722
  /** @internal */
1941
1723
  minWidth;
@@ -1944,9 +1726,8 @@ var RowNode = class _RowNode extends Node {
1944
1726
  /** @internal */
1945
1727
  maxWidth;
1946
1728
  /** @internal */
1947
- constructor(model, windowId, json) {
1729
+ constructor(model, json) {
1948
1730
  super(model);
1949
- this.windowId = windowId;
1950
1731
  this.minHeight = DefaultMin;
1951
1732
  this.minWidth = DefaultMin;
1952
1733
  this.maxHeight = DefaultMax;
@@ -1969,10 +1750,7 @@ var RowNode = class _RowNode extends Node {
1969
1750
  }
1970
1751
  /** @internal */
1971
1752
  getWindowId() {
1972
- return this.windowId;
1973
- }
1974
- setWindowId(windowId) {
1975
- this.windowId = windowId;
1753
+ return Model.MAIN_WINDOW_ID;
1976
1754
  }
1977
1755
  /** @internal */
1978
1756
  setWeight(weight) {
@@ -2099,9 +1877,8 @@ var RowNode = class _RowNode extends Node {
2099
1877
  getMinSize(orientation) {
2100
1878
  if (orientation === Orientation.HORZ) {
2101
1879
  return this.getMinWidth();
2102
- } else {
2103
- return this.getMinHeight();
2104
1880
  }
1881
+ return this.getMinHeight();
2105
1882
  }
2106
1883
  /** @internal */
2107
1884
  getMinWidth() {
@@ -2115,9 +1892,8 @@ var RowNode = class _RowNode extends Node {
2115
1892
  getMaxSize(orientation) {
2116
1893
  if (orientation === Orientation.HORZ) {
2117
1894
  return this.getMaxWidth();
2118
- } else {
2119
- return this.getMaxHeight();
2120
1895
  }
1896
+ return this.getMaxHeight();
2121
1897
  }
2122
1898
  /** @internal */
2123
1899
  getMaxWidth() {
@@ -2194,8 +1970,8 @@ var RowNode = class _RowNode extends Node {
2194
1970
  } else if (child instanceof TabSetNode && child.getChildren().length === 0) {
2195
1971
  if (child.isEnableDeleteWhenEmpty()) {
2196
1972
  this.removeChild(child);
2197
- if (child === this.model.getMaximizedTabset(this.windowId)) {
2198
- this.model.setMaximizedTabset(void 0, this.windowId);
1973
+ if (child === this.model.getMaximizedTabset()) {
1974
+ this.model.setMaximizedTabset(void 0);
2199
1975
  }
2200
1976
  } else {
2201
1977
  i++;
@@ -2204,12 +1980,12 @@ var RowNode = class _RowNode extends Node {
2204
1980
  i++;
2205
1981
  }
2206
1982
  }
2207
- if (this === this.model.getRoot(this.windowId) && this.children.length === 0) {
1983
+ if (this === this.model.getRoot() && this.children.length === 0) {
2208
1984
  const callback = this.model.getOnCreateTabSet();
2209
1985
  const baseAttrs = callback ? callback() : {};
2210
1986
  const attrs = { ...baseAttrs, selected: -1 };
2211
1987
  const child = new TabSetNode(this.model, attrs);
2212
- this.model.setActiveTabset(child, this.windowId);
1988
+ this.model.setActiveTabset(child);
2213
1989
  this.addChild(child);
2214
1990
  }
2215
1991
  }
@@ -2222,9 +1998,6 @@ var RowNode = class _RowNode extends Node {
2222
1998
  const margin = 10;
2223
1999
  const half = 50;
2224
2000
  let dropInfo;
2225
- if (this.getWindowId() !== Model.MAIN_WINDOW_ID && !canDockToWindow(dragNode)) {
2226
- return void 0;
2227
- }
2228
2001
  if (this.model.isEnableEdgeDock() && this.parent === void 0) {
2229
2002
  if (x < this.rect.x + margin && yy > h / 2 - half && yy < h / 2 + half) {
2230
2003
  const dockLocation = DockLocation.LEFT;
@@ -2274,7 +2047,7 @@ var RowNode = class _RowNode extends Node {
2274
2047
  if (dragNode instanceof TabSetNode || dragNode instanceof _RowNode) {
2275
2048
  node = dragNode;
2276
2049
  if (node instanceof _RowNode && node.getOrientation() === this.getOrientation() && (location.getOrientation() === this.getOrientation() || location === DockLocation.CENTER)) {
2277
- node = new _RowNode(this.model, this.windowId, {});
2050
+ node = new _RowNode(this.model, {});
2278
2051
  node.addChild(dragNode);
2279
2052
  }
2280
2053
  } else {
@@ -2302,8 +2075,8 @@ var RowNode = class _RowNode extends Node {
2302
2075
  } else if (horz && dockLocation === DockLocation.RIGHT || !horz && dockLocation === DockLocation.BOTTOM) {
2303
2076
  this.addChild(node);
2304
2077
  } else if (horz && dockLocation === DockLocation.TOP || !horz && dockLocation === DockLocation.LEFT) {
2305
- const vrow = new _RowNode(this.model, this.windowId, {});
2306
- const hrow = new _RowNode(this.model, this.windowId, {});
2078
+ const vrow = new _RowNode(this.model, {});
2079
+ const hrow = new _RowNode(this.model, {});
2307
2080
  hrow.setWeight(75);
2308
2081
  node.setWeight(25);
2309
2082
  for (const child of this.children) {
@@ -2314,8 +2087,8 @@ var RowNode = class _RowNode extends Node {
2314
2087
  vrow.addChild(hrow);
2315
2088
  this.addChild(vrow);
2316
2089
  } else if (horz && dockLocation === DockLocation.BOTTOM || !horz && dockLocation === DockLocation.RIGHT) {
2317
- const vrow = new _RowNode(this.model, this.windowId, {});
2318
- const hrow = new _RowNode(this.model, this.windowId, {});
2090
+ const vrow = new _RowNode(this.model, {});
2091
+ const hrow = new _RowNode(this.model, {});
2319
2092
  hrow.setWeight(75);
2320
2093
  node.setWeight(25);
2321
2094
  for (const child of this.children) {
@@ -2327,7 +2100,7 @@ var RowNode = class _RowNode extends Node {
2327
2100
  this.addChild(vrow);
2328
2101
  }
2329
2102
  if (node instanceof TabSetNode) {
2330
- this.model.setActiveTabset(node, this.windowId);
2103
+ this.model.setActiveTabset(node);
2331
2104
  }
2332
2105
  this.model.tidy();
2333
2106
  }
@@ -2372,93 +2145,6 @@ var RowNode = class _RowNode extends Node {
2372
2145
  }
2373
2146
  };
2374
2147
 
2375
- // src/model/LayoutWindow.ts
2376
- var LayoutWindow = class _LayoutWindow {
2377
- _windowId;
2378
- _layout;
2379
- _rect;
2380
- _window;
2381
- _root;
2382
- _maximizedTabSet;
2383
- _activeTabSet;
2384
- _toScreenRectFunction;
2385
- constructor(windowId, rect) {
2386
- this._windowId = windowId;
2387
- this._rect = rect;
2388
- this._toScreenRectFunction = (r) => r;
2389
- }
2390
- visitNodes(fn) {
2391
- this.root.forEachNode(fn, 0);
2392
- }
2393
- get windowId() {
2394
- return this._windowId;
2395
- }
2396
- get rect() {
2397
- return this._rect;
2398
- }
2399
- get layout() {
2400
- return this._layout;
2401
- }
2402
- get window() {
2403
- return this._window;
2404
- }
2405
- get root() {
2406
- return this._root;
2407
- }
2408
- get maximizedTabSet() {
2409
- return this._maximizedTabSet;
2410
- }
2411
- get activeTabSet() {
2412
- return this._activeTabSet;
2413
- }
2414
- /** @internal */
2415
- set rect(value) {
2416
- this._rect = value;
2417
- }
2418
- /** @internal */
2419
- set layout(value) {
2420
- this._layout = value;
2421
- }
2422
- /** @internal */
2423
- set window(value) {
2424
- this._window = value;
2425
- }
2426
- /** @internal */
2427
- set root(value) {
2428
- this._root = value;
2429
- }
2430
- /** @internal */
2431
- set maximizedTabSet(value) {
2432
- this._maximizedTabSet = value;
2433
- }
2434
- /** @internal */
2435
- set activeTabSet(value) {
2436
- this._activeTabSet = value;
2437
- }
2438
- /** @internal */
2439
- get toScreenRectFunction() {
2440
- return this._toScreenRectFunction;
2441
- }
2442
- /** @internal */
2443
- set toScreenRectFunction(value) {
2444
- this._toScreenRectFunction = value;
2445
- }
2446
- toJson() {
2447
- if (this._window && this._window.screenTop > -1e4) {
2448
- this.rect = new Rect(this._window.screenLeft, this._window.screenTop, this._window.outerWidth, this._window.outerHeight);
2449
- }
2450
- return { layout: this.root.toJson(), rect: this.rect.toJson() };
2451
- }
2452
- static fromJson(windowJson, model, windowId) {
2453
- const count = model.getwindowsMap().size;
2454
- let rect = windowJson.rect ? Rect.fromJson(windowJson.rect) : new Rect(50 + 50 * count, 50 + 50 * count, 600, 400);
2455
- rect = keepOnScreen(rect);
2456
- const layoutWindow = new _LayoutWindow(windowId, rect);
2457
- layoutWindow.root = RowNode.fromJson(windowJson.layout, model, layoutWindow);
2458
- return layoutWindow;
2459
- }
2460
- };
2461
-
2462
2148
  // src/model/Model.ts
2463
2149
  var DefaultMin = 0;
2464
2150
  var DefaultMax = 99999;
@@ -2479,9 +2165,13 @@ var Model = class _Model {
2479
2165
  /** @internal */
2480
2166
  onCreateTabSet;
2481
2167
  /** @internal */
2482
- windows;
2168
+ _root;
2169
+ /** @internal */
2170
+ _maximizedTabSet;
2171
+ /** @internal */
2172
+ _activeTabSet;
2483
2173
  /** @internal */
2484
- rootWindow;
2174
+ _layout;
2485
2175
  /**
2486
2176
  * 'private' constructor. Use the static method Model.fromJson(json) to create a model
2487
2177
  * @internal
@@ -2490,16 +2180,13 @@ var Model = class _Model {
2490
2180
  this.attributes = {};
2491
2181
  this.idMap = /* @__PURE__ */ new Map();
2492
2182
  this.borders = new BorderSet(this);
2493
- this.windows = /* @__PURE__ */ new Map();
2494
- this.rootWindow = new LayoutWindow(_Model.MAIN_WINDOW_ID, Rect.empty());
2495
- this.windows.set(_Model.MAIN_WINDOW_ID, this.rootWindow);
2496
2183
  this.changeListeners = [];
2497
2184
  }
2498
2185
  /**
2499
2186
  * Update the node tree by performing the given action,
2500
2187
  * Actions should be generated via static methods on the Actions class
2501
2188
  * @param action the action to perform
2502
- * @returns added Node for Actions.addNode, windowId for createWindow
2189
+ * @returns added Node for Actions.addNode
2503
2190
  */
2504
2191
  doAction(action) {
2505
2192
  let returnVal = void 0;
@@ -2516,16 +2203,14 @@ var Model = class _Model {
2516
2203
  case Actions.MOVE_NODE: {
2517
2204
  const fromNode = this.idMap.get(action.data.fromNode);
2518
2205
  if (fromNode instanceof TabNode || fromNode instanceof TabSetNode || fromNode instanceof RowNode) {
2519
- if (fromNode === this.getMaximizedTabset(fromNode.getWindowId())) {
2520
- const fromWindow = this.windows.get(fromNode.getWindowId());
2521
- fromWindow.maximizedTabSet = void 0;
2206
+ if (fromNode === this.getMaximizedTabset()) {
2207
+ this._maximizedTabSet = void 0;
2522
2208
  }
2523
2209
  const toNode = this.idMap.get(action.data.toNode);
2524
2210
  if (toNode instanceof TabSetNode || toNode instanceof BorderNode || toNode instanceof RowNode) {
2525
2211
  toNode.drop(fromNode, DockLocation.getByName(action.data.location), action.data.index, action.data.select);
2526
2212
  }
2527
2213
  }
2528
- this.removeEmptyWindows();
2529
2214
  break;
2530
2215
  }
2531
2216
  case Actions.DELETE_TAB: {
@@ -2533,7 +2218,6 @@ var Model = class _Model {
2533
2218
  if (node instanceof TabNode) {
2534
2219
  node.delete();
2535
2220
  }
2536
- this.removeEmptyWindows();
2537
2221
  break;
2538
2222
  }
2539
2223
  case Actions.DELETE_TABSET: {
@@ -2551,77 +2235,6 @@ var Model = class _Model {
2551
2235
  }
2552
2236
  this.tidy();
2553
2237
  }
2554
- this.removeEmptyWindows();
2555
- break;
2556
- }
2557
- case Actions.POPOUT_TABSET: {
2558
- const node = this.idMap.get(action.data.node);
2559
- if (node instanceof TabSetNode) {
2560
- const isMaximized = node.isMaximized();
2561
- const oldLayoutWindow = this.windows.get(node.getWindowId());
2562
- const windowId = randomUUID();
2563
- const layoutWindow = new LayoutWindow(windowId, oldLayoutWindow.toScreenRectFunction(node.getRect()));
2564
- const json = {
2565
- type: "row",
2566
- children: []
2567
- };
2568
- const row = RowNode.fromJson(json, this, layoutWindow);
2569
- layoutWindow.root = row;
2570
- this.windows.set(windowId, layoutWindow);
2571
- row.drop(node, DockLocation.CENTER, 0);
2572
- if (isMaximized) {
2573
- this.rootWindow.maximizedTabSet = void 0;
2574
- }
2575
- }
2576
- this.removeEmptyWindows();
2577
- break;
2578
- }
2579
- case Actions.POPOUT_TAB: {
2580
- const node = this.idMap.get(action.data.node);
2581
- if (node instanceof TabNode) {
2582
- const windowId = randomUUID();
2583
- let r = Rect.empty();
2584
- if (node.getParent() instanceof TabSetNode) {
2585
- r = node.getParent().getRect();
2586
- } else {
2587
- r = node.getParent().getContentRect();
2588
- }
2589
- const oldLayoutWindow = this.windows.get(node.getWindowId());
2590
- const layoutWindow = new LayoutWindow(windowId, oldLayoutWindow.toScreenRectFunction(r));
2591
- const tabsetId = randomUUID();
2592
- const json = {
2593
- type: "row",
2594
- children: [{ type: "tabset", id: tabsetId, children: [] }]
2595
- };
2596
- const row = RowNode.fromJson(json, this, layoutWindow);
2597
- layoutWindow.root = row;
2598
- this.windows.set(windowId, layoutWindow);
2599
- const tabset = this.idMap.get(tabsetId);
2600
- tabset.drop(node, DockLocation.CENTER, 0, true);
2601
- }
2602
- this.removeEmptyWindows();
2603
- break;
2604
- }
2605
- case Actions.CLOSE_WINDOW: {
2606
- const window2 = this.windows.get(action.data.windowId);
2607
- if (window2) {
2608
- this.rootWindow.root?.drop(window2.root, DockLocation.CENTER, -1);
2609
- this.rootWindow.visitNodes((node, _level) => {
2610
- if (node instanceof RowNode) {
2611
- node.setWindowId(_Model.MAIN_WINDOW_ID);
2612
- }
2613
- });
2614
- this.windows.delete(action.data.windowId);
2615
- }
2616
- break;
2617
- }
2618
- case Actions.CREATE_WINDOW: {
2619
- const windowId = randomUUID();
2620
- const layoutWindow = new LayoutWindow(windowId, Rect.fromJson(action.data.rect));
2621
- const row = RowNode.fromJson(action.data.layout, this, layoutWindow);
2622
- layoutWindow.root = row;
2623
- this.windows.set(windowId, layoutWindow);
2624
- returnVal = windowId;
2625
2238
  break;
2626
2239
  }
2627
2240
  case Actions.RENAME_TAB: {
@@ -2633,8 +2246,6 @@ var Model = class _Model {
2633
2246
  }
2634
2247
  case Actions.SELECT_TAB: {
2635
2248
  const tabNode = this.idMap.get(action.data.tabNode);
2636
- const windowId = action.data.windowId ? action.data.windowId : _Model.MAIN_WINDOW_ID;
2637
- const window2 = this.windows.get(windowId);
2638
2249
  if (tabNode instanceof TabNode) {
2639
2250
  const parent = tabNode.getParent();
2640
2251
  const pos = parent.getChildren().indexOf(tabNode);
@@ -2648,20 +2259,18 @@ var Model = class _Model {
2648
2259
  if (parent.getSelected() !== pos) {
2649
2260
  parent.setSelected(pos);
2650
2261
  }
2651
- window2.activeTabSet = parent;
2262
+ this._activeTabSet = parent;
2652
2263
  }
2653
2264
  }
2654
2265
  break;
2655
2266
  }
2656
2267
  case Actions.SET_ACTIVE_TABSET: {
2657
- const windowId = action.data.windowId ? action.data.windowId : _Model.MAIN_WINDOW_ID;
2658
- const window2 = this.windows.get(windowId);
2659
2268
  if (action.data.tabsetNode === void 0) {
2660
- window2.activeTabSet = void 0;
2269
+ this._activeTabSet = void 0;
2661
2270
  } else {
2662
2271
  const tabsetNode = this.idMap.get(action.data.tabsetNode);
2663
2272
  if (tabsetNode instanceof TabSetNode) {
2664
- window2.activeTabSet = tabsetNode;
2273
+ this._activeTabSet = tabsetNode;
2665
2274
  }
2666
2275
  }
2667
2276
  break;
@@ -2683,15 +2292,13 @@ var Model = class _Model {
2683
2292
  break;
2684
2293
  }
2685
2294
  case Actions.MAXIMIZE_TOGGLE: {
2686
- const windowId = action.data.windowId ? action.data.windowId : _Model.MAIN_WINDOW_ID;
2687
- const window2 = this.windows.get(windowId);
2688
2295
  const node = this.idMap.get(action.data.node);
2689
2296
  if (node instanceof TabSetNode) {
2690
- if (node === window2.maximizedTabSet) {
2691
- window2.maximizedTabSet = void 0;
2297
+ if (node === this._maximizedTabSet) {
2298
+ this._maximizedTabSet = void 0;
2692
2299
  } else {
2693
- window2.maximizedTabSet = node;
2694
- window2.activeTabSet = node;
2300
+ this._maximizedTabSet = node;
2301
+ this._activeTabSet = node;
2695
2302
  }
2696
2303
  }
2697
2304
  break;
@@ -2717,26 +2324,24 @@ var Model = class _Model {
2717
2324
  /**
2718
2325
  * Get the currently active tabset node
2719
2326
  */
2720
- getActiveTabset(windowId = _Model.MAIN_WINDOW_ID) {
2721
- const window2 = this.windows.get(windowId);
2722
- if (window2 && window2.activeTabSet && this.getNodeById(window2.activeTabSet.getId())) {
2723
- return window2.activeTabSet;
2724
- } else {
2725
- return void 0;
2327
+ getActiveTabset(_windowId) {
2328
+ if (this._activeTabSet && this.getNodeById(this._activeTabSet.getId())) {
2329
+ return this._activeTabSet;
2726
2330
  }
2331
+ return void 0;
2727
2332
  }
2728
2333
  /**
2729
2334
  * Get the currently maximized tabset node
2730
2335
  */
2731
- getMaximizedTabset(windowId = _Model.MAIN_WINDOW_ID) {
2732
- return this.windows.get(windowId).maximizedTabSet;
2336
+ getMaximizedTabset(_windowId) {
2337
+ return this._maximizedTabSet;
2733
2338
  }
2734
2339
  /**
2735
2340
  * Gets the root RowNode of the model
2736
2341
  * @returns {RowNode}
2737
2342
  */
2738
- getRoot(windowId = _Model.MAIN_WINDOW_ID) {
2739
- return this.windows.get(windowId).root;
2343
+ getRoot(_windowId) {
2344
+ return this._root;
2740
2345
  }
2741
2346
  isRootOrientationVertical() {
2742
2347
  return this.attributes.rootOrientationVertical;
@@ -2751,8 +2356,13 @@ var Model = class _Model {
2751
2356
  getBorderSet() {
2752
2357
  return this.borders;
2753
2358
  }
2754
- getwindowsMap() {
2755
- return this.windows;
2359
+ /** @internal */
2360
+ get layout() {
2361
+ return this._layout;
2362
+ }
2363
+ /** @internal */
2364
+ set layout(value) {
2365
+ this._layout = value;
2756
2366
  }
2757
2367
  /**
2758
2368
  * Visits all the nodes in the model and calls the given function for each
@@ -2760,17 +2370,7 @@ var Model = class _Model {
2760
2370
  */
2761
2371
  visitNodes(fn) {
2762
2372
  this.borders.forEachNode(fn);
2763
- for (const [_, w] of this.windows) {
2764
- w.root.forEachNode(fn, 0);
2765
- }
2766
- }
2767
- visitWindowNodes(windowId, fn) {
2768
- if (this.windows.has(windowId)) {
2769
- if (windowId === _Model.MAIN_WINDOW_ID) {
2770
- this.borders.forEachNode(fn);
2771
- }
2772
- this.windows.get(windowId).visitNodes(fn);
2773
- }
2373
+ this._root.forEachNode(fn, 0);
2774
2374
  }
2775
2375
  /**
2776
2376
  * Gets a node by its id
@@ -2784,13 +2384,12 @@ var Model = class _Model {
2784
2384
  * @param node The top node you want to begin searching from, deafults to the root node
2785
2385
  * @returns The first Tab Set
2786
2386
  */
2787
- getFirstTabSet(node = this.windows.get(_Model.MAIN_WINDOW_ID).root) {
2387
+ getFirstTabSet(node = this._root) {
2788
2388
  const child = node.getChildren()[0];
2789
2389
  if (child instanceof TabSetNode) {
2790
2390
  return child;
2791
- } else {
2792
- return this.getFirstTabSet(child);
2793
2391
  }
2392
+ return this.getFirstTabSet(child);
2794
2393
  }
2795
2394
  /**
2796
2395
  * Loads the model from the given json object
@@ -2803,21 +2402,7 @@ var Model = class _Model {
2803
2402
  if (json.borders) {
2804
2403
  model.borders = BorderSet.fromJson(json.borders, model);
2805
2404
  }
2806
- if (json.popouts) {
2807
- let i = 0;
2808
- const top = 100;
2809
- const left = 100;
2810
- for (const windowId in json.popouts) {
2811
- const windowJson = json.popouts[windowId];
2812
- const layoutWindow = LayoutWindow.fromJson(windowJson, model, windowId);
2813
- model.windows.set(windowId, layoutWindow);
2814
- if (!isOnScreen(layoutWindow.rect)) {
2815
- layoutWindow.rect = new Rect(top + i * 50, left + i * 50, 600, 400);
2816
- i++;
2817
- }
2818
- }
2819
- }
2820
- model.rootWindow.root = RowNode.fromJson(json.layout, model, model.getwindowsMap().get(_Model.MAIN_WINDOW_ID));
2405
+ model._root = RowNode.fromJson(json.layout, model);
2821
2406
  model.tidy();
2822
2407
  return model;
2823
2408
  }
@@ -2831,17 +2416,10 @@ var Model = class _Model {
2831
2416
  this.visitNodes((node) => {
2832
2417
  node.fireEvent("save", {});
2833
2418
  });
2834
- const windows = {};
2835
- for (const [id, window2] of this.windows) {
2836
- if (id !== _Model.MAIN_WINDOW_ID) {
2837
- windows[id] = window2.toJson();
2838
- }
2839
- }
2840
2419
  return {
2841
2420
  global,
2842
2421
  borders: this.borders.toJson(),
2843
- layout: this.rootWindow.root.toJson(),
2844
- popouts: windows
2422
+ layout: this._root.toJson()
2845
2423
  };
2846
2424
  }
2847
2425
  getSplitterSize() {
@@ -2886,46 +2464,12 @@ var Model = class _Model {
2886
2464
  }
2887
2465
  /***********************internal ********************************/
2888
2466
  /** @internal */
2889
- removeEmptyWindows() {
2890
- const emptyWindows = /* @__PURE__ */ new Set();
2891
- for (const [windowId] of this.windows) {
2892
- if (windowId !== _Model.MAIN_WINDOW_ID) {
2893
- let count = 0;
2894
- this.visitWindowNodes(windowId, (node) => {
2895
- if (node instanceof TabNode) {
2896
- count++;
2897
- }
2898
- });
2899
- if (count === 0) {
2900
- emptyWindows.add(windowId);
2901
- }
2902
- }
2903
- }
2904
- for (const windowId of emptyWindows) {
2905
- this.windows.delete(windowId);
2906
- }
2907
- }
2908
- /** @internal */
2909
- setActiveTabset(tabsetNode, windowId) {
2910
- const window2 = this.windows.get(windowId);
2911
- if (window2) {
2912
- if (tabsetNode) {
2913
- window2.activeTabSet = tabsetNode;
2914
- } else {
2915
- window2.activeTabSet = void 0;
2916
- }
2917
- }
2467
+ setActiveTabset(tabsetNode) {
2468
+ this._activeTabSet = tabsetNode;
2918
2469
  }
2919
2470
  /** @internal */
2920
- setMaximizedTabset(tabsetNode, windowId) {
2921
- const window2 = this.windows.get(windowId);
2922
- if (window2) {
2923
- if (tabsetNode) {
2924
- window2.maximizedTabSet = tabsetNode;
2925
- } else {
2926
- window2.maximizedTabSet = void 0;
2927
- }
2928
- }
2471
+ setMaximizedTabset(tabsetNode) {
2472
+ this._maximizedTabSet = tabsetNode;
2929
2473
  }
2930
2474
  /** @internal */
2931
2475
  updateIdMap() {
@@ -2943,18 +2487,16 @@ var Model = class _Model {
2943
2487
  this.idMap.set(id, node);
2944
2488
  }
2945
2489
  /** @internal */
2946
- findDropTargetNode(windowId, dragNode, x, y) {
2947
- let node = this.windows.get(windowId).root.findDropTargetNode(windowId, dragNode, x, y);
2948
- if (node === void 0 && windowId === _Model.MAIN_WINDOW_ID) {
2490
+ findDropTargetNode(_windowId, dragNode, x, y) {
2491
+ let node = this._root.findDropTargetNode(_windowId, dragNode, x, y);
2492
+ if (node === void 0) {
2949
2493
  node = this.borders.findDropTargetNode(dragNode, x, y);
2950
2494
  }
2951
2495
  return node;
2952
2496
  }
2953
2497
  /** @internal */
2954
2498
  tidy() {
2955
- for (const [_, window2] of this.windows) {
2956
- window2.root.tidy();
2957
- }
2499
+ this._root.tidy();
2958
2500
  }
2959
2501
  /** @internal */
2960
2502
  updateAttrs(json) {
@@ -3000,9 +2542,6 @@ var Model = class _Model {
3000
2542
  attributeDefinitions.add("splitterEnableHandle", false).setType(Attribute.BOOLEAN).setDescription(`enable a small centralized handle on all splitters`);
3001
2543
  attributeDefinitions.add("tabEnableClose", true).setType(Attribute.BOOLEAN);
3002
2544
  attributeDefinitions.add("tabCloseType", 1).setType("ICloseType");
3003
- attributeDefinitions.add("tabEnablePopout", false).setType(Attribute.BOOLEAN).setAlias("tabEnableFloat");
3004
- attributeDefinitions.add("tabEnablePopoutIcon", true).setType(Attribute.BOOLEAN);
3005
- attributeDefinitions.add("tabEnablePopoutOverlay", false).setType(Attribute.BOOLEAN);
3006
2545
  attributeDefinitions.add("tabEnableDrag", true).setType(Attribute.BOOLEAN);
3007
2546
  attributeDefinitions.add("tabEnableRename", true).setType(Attribute.BOOLEAN);
3008
2547
  attributeDefinitions.add("tabContentClassName", void 0).setType(Attribute.STRING);
@@ -3259,7 +2798,7 @@ var BorderNode = class _BorderNode extends Node {
3259
2798
  const childY = childRect.y;
3260
2799
  const childHeight = childRect.height;
3261
2800
  let pos = this.tabHeaderRect.x;
3262
- let childCenter = 0;
2801
+ let childCenter;
3263
2802
  for (let i = 0; i < this.children.length; i++) {
3264
2803
  child = this.children[i];
3265
2804
  childRect = child.getTabRect();
@@ -3286,7 +2825,7 @@ var BorderNode = class _BorderNode extends Node {
3286
2825
  const childX = childRect.x;
3287
2826
  const childWidth = childRect.width;
3288
2827
  let pos = this.tabHeaderRect.y;
3289
- let childCenter = 0;
2828
+ let childCenter;
3290
2829
  for (let i = 0; i < this.children.length; i++) {
3291
2830
  child = this.children[i];
3292
2831
  childRect = child.getTabRect();
@@ -3414,27 +2953,119 @@ var BorderNode = class _BorderNode extends Node {
3414
2953
  };
3415
2954
 
3416
2955
  // src/view/BorderTab.tsx
3417
- import * as React3 from "react";
2956
+ import { useLayoutEffect, useRef as useRef2 } from "react";
2957
+
2958
+ // src/view/Splitter.tsx
2959
+ import { useEffect, useRef, useState } from "react";
2960
+
2961
+ // src/model/ICloseType.ts
2962
+ var ICloseType = /* @__PURE__ */ ((ICloseType2) => {
2963
+ ICloseType2[ICloseType2["Visible"] = 1] = "Visible";
2964
+ ICloseType2[ICloseType2["Always"] = 2] = "Always";
2965
+ ICloseType2[ICloseType2["Selected"] = 3] = "Selected";
2966
+ return ICloseType2;
2967
+ })(ICloseType || {});
2968
+
2969
+ // src/view/Utils.tsx
2970
+ import { jsx } from "react/jsx-runtime";
2971
+ function isDesktop() {
2972
+ const desktop = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(hover: hover) and (pointer: fine)").matches;
2973
+ return desktop;
2974
+ }
2975
+ function getRenderStateEx(layout, node, iconAngle) {
2976
+ let leadingContent = void 0;
2977
+ const titleContent = node.getName();
2978
+ const name = node.getName();
2979
+ if (iconAngle === void 0) {
2980
+ iconAngle = 0;
2981
+ }
2982
+ if (leadingContent === void 0 && node.getIcon() !== void 0) {
2983
+ if (iconAngle !== 0) {
2984
+ leadingContent = /* @__PURE__ */ jsx("img", { style: { width: "1em", height: "1em", transform: "rotate(" + iconAngle + "deg)" }, src: node.getIcon(), alt: "leadingContent" });
2985
+ } else {
2986
+ leadingContent = /* @__PURE__ */ jsx("img", { style: { width: "1em", height: "1em" }, src: node.getIcon(), alt: "leadingContent" });
2987
+ }
2988
+ }
2989
+ const buttons = [];
2990
+ const renderState = { leading: leadingContent, content: titleContent, name, buttons };
2991
+ layout.customizeTab(node, renderState);
2992
+ node.setRenderedName(renderState.name);
2993
+ return renderState;
2994
+ }
2995
+ function isAuxMouseEvent(event) {
2996
+ let auxEvent = false;
2997
+ if (event.nativeEvent instanceof MouseEvent) {
2998
+ if (event.nativeEvent.button !== 0 || event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) {
2999
+ auxEvent = true;
3000
+ }
3001
+ }
3002
+ return auxEvent;
3003
+ }
3004
+ function enablePointerOnIFrames(enable, currentDocument) {
3005
+ const iframes = [...getElementsByTagName("iframe", currentDocument), ...getElementsByTagName("webview", currentDocument)];
3006
+ for (const iframe of iframes) {
3007
+ iframe.style.pointerEvents = enable ? "auto" : "none";
3008
+ }
3009
+ }
3010
+ function getElementsByTagName(tag, currentDocument) {
3011
+ return [...currentDocument.getElementsByTagName(tag)];
3012
+ }
3013
+ function startDrag(doc, event, drag, dragEnd, dragCancel) {
3014
+ event.preventDefault();
3015
+ const pointerMove = (ev) => {
3016
+ ev.preventDefault();
3017
+ drag(ev.clientX, ev.clientY);
3018
+ };
3019
+ const pointerCancel = (ev) => {
3020
+ ev.preventDefault();
3021
+ dragCancel();
3022
+ };
3023
+ const pointerUp = () => {
3024
+ doc.removeEventListener("pointermove", pointerMove);
3025
+ doc.removeEventListener("pointerup", pointerUp);
3026
+ doc.removeEventListener("pointercancel", pointerCancel);
3027
+ dragEnd();
3028
+ };
3029
+ doc.addEventListener("pointermove", pointerMove);
3030
+ doc.addEventListener("pointerup", pointerUp);
3031
+ doc.addEventListener("pointercancel", pointerCancel);
3032
+ }
3033
+ function isSafari() {
3034
+ const userAgent = navigator.userAgent;
3035
+ return userAgent.includes("Safari") && !userAgent.includes("Chrome") && !userAgent.includes("Chromium");
3036
+ }
3037
+ function isTabClosable(node, selected) {
3038
+ const closeType = node.getCloseType();
3039
+ if (selected || closeType === 2 /* Always */) {
3040
+ return true;
3041
+ }
3042
+ if (closeType === 1 /* Visible */) {
3043
+ if (window.matchMedia && window.matchMedia("(hover: hover) and (pointer: fine)").matches) {
3044
+ return true;
3045
+ }
3046
+ }
3047
+ return false;
3048
+ }
3418
3049
 
3419
3050
  // src/view/Splitter.tsx
3420
- import * as React2 from "react";
3051
+ import { jsx as jsx2 } from "react/jsx-runtime";
3421
3052
  var Splitter = (props) => {
3422
3053
  const { layout, node, index, horizontal } = props;
3423
- const [dragging, setDragging] = React2.useState(false);
3424
- const selfRef = React2.useRef(null);
3425
- const extendedRef = React2.useRef(null);
3426
- const pBounds = React2.useRef([]);
3427
- const outlineDiv = React2.useRef(void 0);
3428
- const handleDiv = React2.useRef(void 0);
3429
- const dragStartX = React2.useRef(0);
3430
- const dragStartY = React2.useRef(0);
3431
- const initalSizes = React2.useRef({ initialSizes: [], sum: 0, startPosition: 0 });
3054
+ const [dragging, setDragging] = useState(false);
3055
+ const selfRef = useRef(null);
3056
+ const extendedRef = useRef(null);
3057
+ const pBounds = useRef([]);
3058
+ const outlineDiv = useRef(void 0);
3059
+ const handleDiv = useRef(void 0);
3060
+ const dragStartX = useRef(0);
3061
+ const dragStartY = useRef(0);
3062
+ const initalSizes = useRef({ initialSizes: [], sum: 0, startPosition: 0 });
3432
3063
  const size = node.getModel().getSplitterSize();
3433
3064
  let extra = node.getModel().getSplitterExtra();
3434
3065
  if (!isDesktop()) {
3435
3066
  extra = Math.max(30, extra + size) - size;
3436
3067
  }
3437
- React2.useEffect(() => {
3068
+ useEffect(() => {
3438
3069
  selfRef.current?.addEventListener("touchstart", onTouchStart, { passive: false });
3439
3070
  extendedRef.current?.addEventListener("touchstart", onTouchStart, { passive: false });
3440
3071
  return () => {
@@ -3517,7 +3148,7 @@ var Splitter = (props) => {
3517
3148
  void _realtime;
3518
3149
  const redraw = () => {
3519
3150
  if (outlineDiv.current) {
3520
- let value = 0;
3151
+ let value;
3521
3152
  if (node.getOrientation() === Orientation.VERT) {
3522
3153
  value = outlineDiv.current.offsetTop;
3523
3154
  } else {
@@ -3568,10 +3199,10 @@ var Splitter = (props) => {
3568
3199
  }
3569
3200
  let handle;
3570
3201
  if (!dragging && node.getModel().isSplitterEnableHandle()) {
3571
- handle = /* @__PURE__ */ React2.createElement("div", { className: cm("flexlayout__splitter_handle" /* FLEXLAYOUT__SPLITTER_HANDLE */) + " " + (horizontal ? cm("flexlayout__splitter_handle_horz" /* FLEXLAYOUT__SPLITTER_HANDLE_HORZ */) : cm("flexlayout__splitter_handle_vert" /* FLEXLAYOUT__SPLITTER_HANDLE_VERT */)) });
3202
+ handle = /* @__PURE__ */ jsx2("div", { className: cm("flexlayout__splitter_handle" /* FLEXLAYOUT__SPLITTER_HANDLE */) + " " + (horizontal ? cm("flexlayout__splitter_handle_horz" /* FLEXLAYOUT__SPLITTER_HANDLE_HORZ */) : cm("flexlayout__splitter_handle_vert" /* FLEXLAYOUT__SPLITTER_HANDLE_VERT */)) });
3572
3203
  }
3573
3204
  if (extra === 0) {
3574
- return /* @__PURE__ */ React2.createElement("div", { className, style: style2, ref: selfRef, "data-layout-path": node.getPath() + "/s" + (index - 1), onPointerDown }, handle);
3205
+ return /* @__PURE__ */ jsx2("div", { className, style: style2, ref: selfRef, "data-layout-path": node.getPath() + "/s" + (index - 1), onPointerDown, children: handle });
3575
3206
  } else {
3576
3207
  const style22 = {};
3577
3208
  if (node.getOrientation() === Orientation.HORZ) {
@@ -3584,16 +3215,17 @@ var Splitter = (props) => {
3584
3215
  style22.cursor = "ns-resize";
3585
3216
  }
3586
3217
  const className2 = cm("flexlayout__splitter_extra" /* FLEXLAYOUT__SPLITTER_EXTRA */);
3587
- return /* @__PURE__ */ React2.createElement("div", { className, style: style2, ref: selfRef, "data-layout-path": node.getPath() + "/s" + (index - 1), onPointerDown }, /* @__PURE__ */ React2.createElement("div", { style: style22, ref: extendedRef, className: className2, onPointerDown }));
3218
+ return /* @__PURE__ */ jsx2("div", { className, style: style2, ref: selfRef, "data-layout-path": node.getPath() + "/s" + (index - 1), onPointerDown, children: /* @__PURE__ */ jsx2("div", { style: style22, ref: extendedRef, className: className2, onPointerDown }) });
3588
3219
  }
3589
3220
  };
3590
3221
 
3591
3222
  // src/view/BorderTab.tsx
3223
+ import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
3592
3224
  function BorderTab(props) {
3593
3225
  const { layout, border, show } = props;
3594
- const selfRef = React3.useRef(null);
3595
- const isFirstRender = React3.useRef(true);
3596
- React3.useLayoutEffect(() => {
3226
+ const selfRef = useRef2(null);
3227
+ const isFirstRender = useRef2(true);
3228
+ useLayoutEffect(() => {
3597
3229
  const outerRect = layout.getBoundingClientRect(selfRef.current);
3598
3230
  const contentRect = Rect.getContentRect(selfRef.current).relativeTo(layout.getDomRect());
3599
3231
  if (outerRect.width > 0) {
@@ -3622,21 +3254,28 @@ function BorderTab(props) {
3622
3254
  style2.display = show ? "flex" : "none";
3623
3255
  const className = layout.getClassName("flexlayout__border_tab_contents" /* FLEXLAYOUT__BORDER_TAB_CONTENTS */);
3624
3256
  if (border.getLocation() === DockLocation.LEFT || border.getLocation() === DockLocation.TOP) {
3625
- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("div", { ref: selfRef, style: style2, className }), show && /* @__PURE__ */ React3.createElement(Splitter, { layout, node: border, index: 0, horizontal }));
3257
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3258
+ /* @__PURE__ */ jsx3("div", { ref: selfRef, style: style2, className }),
3259
+ show && /* @__PURE__ */ jsx3(Splitter, { layout, node: border, index: 0, horizontal })
3260
+ ] });
3626
3261
  } else {
3627
- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, show && /* @__PURE__ */ React3.createElement(Splitter, { layout, node: border, index: 0, horizontal }), /* @__PURE__ */ React3.createElement("div", { ref: selfRef, style: style2, className }));
3262
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3263
+ show && /* @__PURE__ */ jsx3(Splitter, { layout, node: border, index: 0, horizontal }),
3264
+ /* @__PURE__ */ jsx3("div", { ref: selfRef, style: style2, className })
3265
+ ] });
3628
3266
  }
3629
3267
  }
3630
3268
 
3631
3269
  // src/view/BorderTabSet.tsx
3632
- import * as React8 from "react";
3270
+ import { useLayoutEffect as useLayoutEffect4, useRef as useRef5 } from "react";
3633
3271
 
3634
3272
  // src/view/BorderButton.tsx
3635
- import * as React4 from "react";
3273
+ import { useLayoutEffect as useLayoutEffect2, useRef as useRef3 } from "react";
3274
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
3636
3275
  var BorderButton = (props) => {
3637
3276
  const { layout, node, selected, border, icons, path } = props;
3638
- const selfRef = React4.useRef(null);
3639
- const contentRef = React4.useRef(null);
3277
+ const selfRef = useRef3(null);
3278
+ const contentRef = useRef3(null);
3640
3279
  const onDragStart = (event) => {
3641
3280
  if (node.isEnableDrag()) {
3642
3281
  event.stopPropagation();
@@ -3676,7 +3315,7 @@ var BorderButton = (props) => {
3676
3315
  const onClosePointerDown = (event) => {
3677
3316
  event.stopPropagation();
3678
3317
  };
3679
- React4.useLayoutEffect(() => {
3318
+ useLayoutEffect2(() => {
3680
3319
  node.setTabRect(layout.getBoundingClientRect(selfRef.current));
3681
3320
  if (layout.getEditingTab() === node) {
3682
3321
  contentRef.current.select();
@@ -3712,10 +3351,10 @@ var BorderButton = (props) => {
3712
3351
  }
3713
3352
  }
3714
3353
  const renderState = getRenderStateEx(layout, node, iconAngle);
3715
- let content = renderState.content ? /* @__PURE__ */ React4.createElement("div", { className: cm("flexlayout__border_button_content" /* FLEXLAYOUT__BORDER_BUTTON_CONTENT */) }, renderState.content) : null;
3716
- const leading = renderState.leading ? /* @__PURE__ */ React4.createElement("div", { className: cm("flexlayout__border_button_leading" /* FLEXLAYOUT__BORDER_BUTTON_LEADING */) }, renderState.leading) : null;
3354
+ let content = renderState.content ? /* @__PURE__ */ jsx4("div", { className: cm("flexlayout__border_button_content" /* FLEXLAYOUT__BORDER_BUTTON_CONTENT */), children: renderState.content }) : null;
3355
+ const leading = renderState.leading ? /* @__PURE__ */ jsx4("div", { className: cm("flexlayout__border_button_leading" /* FLEXLAYOUT__BORDER_BUTTON_LEADING */), children: renderState.leading }) : null;
3717
3356
  if (layout.getEditingTab() === node) {
3718
- content = /* @__PURE__ */ React4.createElement(
3357
+ content = /* @__PURE__ */ jsx4(
3719
3358
  "input",
3720
3359
  {
3721
3360
  ref: contentRef,
@@ -3732,21 +3371,21 @@ var BorderButton = (props) => {
3732
3371
  if (node.isEnableClose()) {
3733
3372
  const closeTitle = layout.i18nName("Close" /* Close_Tab */);
3734
3373
  renderState.buttons.push(
3735
- /* @__PURE__ */ React4.createElement(
3374
+ /* @__PURE__ */ jsx4(
3736
3375
  "div",
3737
3376
  {
3738
- key: "close",
3739
3377
  "data-layout-path": path + "/button/close",
3740
3378
  title: closeTitle,
3741
3379
  className: cm("flexlayout__border_button_trailing" /* FLEXLAYOUT__BORDER_BUTTON_TRAILING */),
3742
3380
  onPointerDown: onClosePointerDown,
3743
- onClick: onClose
3381
+ onClick: onClose,
3382
+ children: typeof icons.close === "function" ? icons.close(node) : icons.close
3744
3383
  },
3745
- typeof icons.close === "function" ? icons.close(node) : icons.close
3384
+ "close"
3746
3385
  )
3747
3386
  );
3748
3387
  }
3749
- return /* @__PURE__ */ React4.createElement(
3388
+ return /* @__PURE__ */ jsxs2(
3750
3389
  "div",
3751
3390
  {
3752
3391
  ref: selfRef,
@@ -3758,30 +3397,33 @@ var BorderButton = (props) => {
3758
3397
  title: node.getHelpText(),
3759
3398
  draggable: true,
3760
3399
  onDragStart,
3761
- onDragEnd
3762
- },
3763
- leading,
3764
- content,
3765
- renderState.buttons
3400
+ onDragEnd,
3401
+ children: [
3402
+ leading,
3403
+ content,
3404
+ renderState.buttons
3405
+ ]
3406
+ }
3766
3407
  );
3767
3408
  };
3768
3409
 
3769
- // src/view/PopupMenu.tsx
3770
- import * as React6 from "react";
3771
-
3772
3410
  // src/view/TabButtonStamp.tsx
3773
- import * as React5 from "react";
3411
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
3774
3412
  var TabButtonStamp = (props) => {
3775
3413
  const { layout, node } = props;
3776
3414
  const cm = layout.getClassName;
3777
3415
  const classNames = cm("flexlayout__tab_button_stamp" /* FLEXLAYOUT__TAB_BUTTON_STAMP */);
3778
3416
  const renderState = getRenderStateEx(layout, node);
3779
- const content = renderState.content ? /* @__PURE__ */ React5.createElement("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */) }, renderState.content) : node.getNameForOverflowMenu();
3780
- const leading = renderState.leading ? /* @__PURE__ */ React5.createElement("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */) }, renderState.leading) : null;
3781
- return /* @__PURE__ */ React5.createElement("div", { className: classNames, title: node.getHelpText() }, leading, content);
3417
+ const content = renderState.content ? /* @__PURE__ */ jsx5("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */), children: renderState.content }) : node.getNameForOverflowMenu();
3418
+ const leading = renderState.leading ? /* @__PURE__ */ jsx5("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */), children: renderState.leading }) : null;
3419
+ return /* @__PURE__ */ jsxs3("div", { className: classNames, title: node.getHelpText(), children: [
3420
+ leading,
3421
+ content
3422
+ ] });
3782
3423
  };
3783
3424
 
3784
3425
  // src/view/PopupMenu.tsx
3426
+ import { jsx as jsx6 } from "react/jsx-runtime";
3785
3427
  function showPopup(triggerElement, items, onSelect, layout) {
3786
3428
  const layoutDiv = layout.getRootDiv();
3787
3429
  const classNameMapper = layout.getClassName;
@@ -3821,7 +3463,7 @@ function showPopup(triggerElement, items, onSelect, layout) {
3821
3463
  };
3822
3464
  elm.addEventListener("pointerdown", onElementPointerDown);
3823
3465
  currentDocument.addEventListener("pointerdown", onDocPointerDown);
3824
- layout.showControlInPortal(/* @__PURE__ */ React6.createElement(PopupMenu, { currentDocument, onSelect, onHide, items, classNameMapper, layout }), elm);
3466
+ layout.showControlInPortal(/* @__PURE__ */ jsx6(PopupMenu, { currentDocument, onSelect, onHide, items, classNameMapper, layout }), elm);
3825
3467
  }
3826
3468
  var PopupMenu = (props) => {
3827
3469
  const { items, onHide, onSelect, classNameMapper, layout } = props;
@@ -3840,45 +3482,45 @@ var PopupMenu = (props) => {
3840
3482
  const onDragEnd = (_event) => {
3841
3483
  layout.clearDragMain();
3842
3484
  };
3843
- const itemElements = items.map((item, i) => /* @__PURE__ */ React6.createElement(
3485
+ const itemElements = items.map((item, i) => /* @__PURE__ */ jsx6(
3844
3486
  "div",
3845
3487
  {
3846
- key: item.index,
3847
3488
  className: classNameMapper("flexlayout__popup_menu_item" /* FLEXLAYOUT__POPUP_MENU_ITEM */),
3848
3489
  "data-layout-path": "/popup-menu/tb" + i,
3849
3490
  onClick: (event) => onItemClick(item, event),
3850
3491
  draggable: true,
3851
3492
  onDragStart: (e) => onDragStart(e, item.node),
3852
3493
  onDragEnd,
3853
- title: item.node.getHelpText()
3494
+ title: item.node.getHelpText(),
3495
+ children: /* @__PURE__ */ jsx6(TabButtonStamp, { node: item.node, layout })
3854
3496
  },
3855
- /* @__PURE__ */ React6.createElement(TabButtonStamp, { node: item.node, layout })
3497
+ item.index
3856
3498
  ));
3857
- return /* @__PURE__ */ React6.createElement("div", { className: classNameMapper("flexlayout__popup_menu" /* FLEXLAYOUT__POPUP_MENU */), "data-layout-path": "/popup-menu" }, itemElements);
3499
+ return /* @__PURE__ */ jsx6("div", { className: classNameMapper("flexlayout__popup_menu" /* FLEXLAYOUT__POPUP_MENU */), "data-layout-path": "/popup-menu", children: itemElements });
3858
3500
  };
3859
3501
 
3860
3502
  // src/view/TabOverflowHook.tsx
3861
- import * as React7 from "react";
3503
+ import { useEffect as useEffect2, useLayoutEffect as useLayoutEffect3, useRef as useRef4, useState as useState2 } from "react";
3862
3504
  var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
3863
- const firstRender = React7.useRef(true);
3864
- const tabsTruncated = React7.useRef(false);
3865
- const lastRect = React7.useRef(Rect.empty());
3866
- const selfRef = React7.useRef(null);
3867
- const [position, setPosition] = React7.useState(0);
3868
- const userControlledLeft = React7.useRef(false);
3869
- const [hiddenTabs, setHiddenTabs] = React7.useState([]);
3870
- const lastHiddenCount = React7.useRef(0);
3871
- React7.useLayoutEffect(() => {
3505
+ const firstRender = useRef4(true);
3506
+ const tabsTruncated = useRef4(false);
3507
+ const lastRect = useRef4(Rect.empty());
3508
+ const selfRef = useRef4(null);
3509
+ const [position, setPosition] = useState2(0);
3510
+ const userControlledLeft = useRef4(false);
3511
+ const [hiddenTabs, setHiddenTabs] = useState2([]);
3512
+ const lastHiddenCount = useRef4(0);
3513
+ useLayoutEffect3(() => {
3872
3514
  userControlledLeft.current = false;
3873
3515
  }, [node.getSelectedNode(), node.getRect().width, node.getRect().height]);
3874
3516
  const nodeRect = node instanceof TabSetNode ? node.getRect() : node.getTabHeaderRect();
3875
- React7.useLayoutEffect(() => {
3517
+ useLayoutEffect3(() => {
3876
3518
  if (nodeRect.width > 0 && nodeRect.height > 0) {
3877
3519
  updateVisibleTabs();
3878
3520
  }
3879
3521
  }, [nodeRect.width, nodeRect.height]);
3880
3522
  const instance = toolbarRef.current;
3881
- React7.useEffect(() => {
3523
+ useEffect2(() => {
3882
3524
  if (!instance) {
3883
3525
  return;
3884
3526
  }
@@ -3971,7 +3613,7 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
3971
3613
  }
3972
3614
  };
3973
3615
  const onMouseWheel = (event) => {
3974
- let delta = 0;
3616
+ let delta;
3975
3617
  if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
3976
3618
  delta = -event.deltaX;
3977
3619
  } else {
@@ -3988,13 +3630,14 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
3988
3630
  };
3989
3631
 
3990
3632
  // src/view/BorderTabSet.tsx
3633
+ import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
3991
3634
  var BorderTabSet = (props) => {
3992
3635
  const { border, layout, size } = props;
3993
- const toolbarRef = React8.useRef(null);
3994
- const overflowbuttonRef = React8.useRef(null);
3995
- const stickyButtonsRef = React8.useRef(null);
3636
+ const toolbarRef = useRef5(null);
3637
+ const overflowbuttonRef = useRef5(null);
3638
+ const stickyButtonsRef = useRef5(null);
3996
3639
  const icons = layout.getIcons();
3997
- React8.useLayoutEffect(() => {
3640
+ useLayoutEffect4(() => {
3998
3641
  border.setTabHeaderRect(Rect.getBoundingClientRect(selfRef.current).relativeTo(layout.getDomRect()));
3999
3642
  });
4000
3643
  const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated } = useTabOverflow(border, Orientation.flip(border.getOrientation()), toolbarRef, stickyButtonsRef);
@@ -4023,23 +3666,16 @@ var BorderTabSet = (props) => {
4023
3666
  layout.doAction(Actions.selectTab(item.node.getId()));
4024
3667
  userControlledLeft.current = false;
4025
3668
  };
4026
- const onPopoutTab = (event) => {
4027
- const selectedTabNode = border.getChildren()[border.getSelected()];
4028
- if (selectedTabNode !== void 0) {
4029
- layout.doAction(Actions.popoutTab(selectedTabNode.getId()));
4030
- }
4031
- event.stopPropagation();
4032
- };
4033
3669
  const cm = layout.getClassName;
4034
3670
  const tabButtons = [];
4035
3671
  const layoutTab = (i) => {
4036
3672
  const isSelected = border.getSelected() === i;
4037
3673
  const child = border.getChildren()[i];
4038
3674
  tabButtons.push(
4039
- /* @__PURE__ */ React8.createElement(BorderButton, { layout, border: border.getLocation().getName(), node: child, path: border.getPath() + "/tb" + i, key: child.getId(), selected: isSelected, icons })
3675
+ /* @__PURE__ */ jsx7(BorderButton, { layout, border: border.getLocation().getName(), node: child, path: border.getPath() + "/tb" + i, selected: isSelected, icons }, child.getId())
4040
3676
  );
4041
3677
  if (i < border.getChildren().length - 1) {
4042
- tabButtons.push(/* @__PURE__ */ React8.createElement("div", { key: "divider" + i, className: cm("flexlayout__border_tab_divider" /* FLEXLAYOUT__BORDER_TAB_DIVIDER */) }));
3678
+ tabButtons.push(/* @__PURE__ */ jsx7("div", { className: cm("flexlayout__border_tab_divider" /* FLEXLAYOUT__BORDER_TAB_DIVIDER */) }, "divider" + i));
4043
3679
  }
4044
3680
  };
4045
3681
  for (let i = 0; i < border.getChildren().length; i++) {
@@ -4062,18 +3698,18 @@ var BorderTabSet = (props) => {
4062
3698
  buttons = [...stickyButtons, ...buttons];
4063
3699
  } else {
4064
3700
  tabButtons.push(
4065
- /* @__PURE__ */ React8.createElement(
3701
+ /* @__PURE__ */ jsx7(
4066
3702
  "div",
4067
3703
  {
4068
3704
  ref: stickyButtonsRef,
4069
- key: "sticky_buttons_container",
4070
3705
  onPointerDown: onInterceptPointerDown,
4071
3706
  onDragStart: (e) => {
4072
3707
  e.preventDefault();
4073
3708
  },
4074
- className: cm("flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */)
3709
+ className: cm("flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */),
3710
+ children: stickyButtons
4075
3711
  },
4076
- stickyButtons
3712
+ "sticky_buttons_container"
4077
3713
  )
4078
3714
  );
4079
3715
  }
@@ -4084,48 +3720,31 @@ var BorderTabSet = (props) => {
4084
3720
  if (typeof icons.more === "function") {
4085
3721
  overflowContent = icons.more(border, hiddenTabs);
4086
3722
  } else {
4087
- overflowContent = /* @__PURE__ */ React8.createElement(React8.Fragment, null, icons.more, /* @__PURE__ */ React8.createElement("div", { className: cm("flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */) }, hiddenTabs.length));
3723
+ overflowContent = /* @__PURE__ */ jsxs4(Fragment2, { children: [
3724
+ icons.more,
3725
+ /* @__PURE__ */ jsx7("div", { className: cm("flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */), children: hiddenTabs.length })
3726
+ ] });
4088
3727
  }
4089
3728
  void buttons.splice(
4090
3729
  Math.min(renderState.overflowPosition, buttons.length),
4091
3730
  0,
4092
- /* @__PURE__ */ React8.createElement(
3731
+ /* @__PURE__ */ jsx7(
4093
3732
  "button",
4094
3733
  {
4095
- key: "overflowbutton",
4096
3734
  ref: overflowbuttonRef,
4097
3735
  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()),
4098
3736
  title: overflowTitle,
4099
3737
  onClick: onOverflowClick,
4100
- onPointerDown: onInterceptPointerDown
3738
+ onPointerDown: onInterceptPointerDown,
3739
+ children: overflowContent
4101
3740
  },
4102
- overflowContent
3741
+ "overflowbutton"
4103
3742
  )
4104
3743
  );
4105
3744
  }
4106
- const selectedIndex = border.getSelected();
4107
- if (selectedIndex !== -1) {
4108
- const selectedTabNode = border.getChildren()[selectedIndex];
4109
- if (selectedTabNode !== void 0 && layout.isSupportsPopout() && selectedTabNode.isEnablePopout()) {
4110
- const popoutTitle = layout.i18nName("Popout selected tab" /* Popout_Tab */);
4111
- buttons.push(
4112
- /* @__PURE__ */ React8.createElement(
4113
- "button",
4114
- {
4115
- key: "popout",
4116
- title: popoutTitle,
4117
- className: cm("flexlayout__border_toolbar_button" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON */) + " " + cm("flexlayout__border_toolbar_button-float" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT */),
4118
- onClick: onPopoutTab,
4119
- onPointerDown: onInterceptPointerDown
4120
- },
4121
- typeof icons.popout === "function" ? icons.popout(selectedTabNode) : icons.popout
4122
- )
4123
- );
4124
- }
4125
- }
4126
- const toolbar = /* @__PURE__ */ React8.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);
4127
- let innerStyle = {};
4128
- let outerStyle = {};
3745
+ const toolbar = /* @__PURE__ */ jsx7("div", { ref: toolbarRef, className: cm("flexlayout__border_toolbar" /* FLEXLAYOUT__BORDER_TOOLBAR */) + " " + cm("flexlayout__border_toolbar_" /* FLEXLAYOUT__BORDER_TOOLBAR_ */ + border.getLocation().getName()), children: buttons }, "toolbar");
3746
+ let innerStyle;
3747
+ let outerStyle;
4129
3748
  const borderHeight = size - 1;
4130
3749
  if (border.getLocation() === DockLocation.LEFT) {
4131
3750
  innerStyle = { right: "100%", top: position };
@@ -4137,7 +3756,7 @@ var BorderTabSet = (props) => {
4137
3756
  innerStyle = { left: position };
4138
3757
  outerStyle = { height: borderHeight };
4139
3758
  }
4140
- return /* @__PURE__ */ React8.createElement(
3759
+ return /* @__PURE__ */ jsxs4(
4141
3760
  "div",
4142
3761
  {
4143
3762
  ref: selfRef,
@@ -4150,29 +3769,33 @@ var BorderTabSet = (props) => {
4150
3769
  onClick: onAuxMouseClick,
4151
3770
  onAuxClick: onAuxMouseClick,
4152
3771
  onContextMenu,
4153
- onWheel: onMouseWheel
4154
- },
4155
- /* @__PURE__ */ React8.createElement("div", { style: outerStyle, className: cm("flexlayout__border_inner" /* FLEXLAYOUT__BORDER_INNER */) + " " + cm("flexlayout__border_inner_" /* FLEXLAYOUT__BORDER_INNER_ */ + border.getLocation().getName()) }, /* @__PURE__ */ React8.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()) }, tabButtons)),
4156
- toolbar
3772
+ onWheel: onMouseWheel,
3773
+ children: [
3774
+ /* @__PURE__ */ jsx7("div", { style: outerStyle, className: cm("flexlayout__border_inner" /* FLEXLAYOUT__BORDER_INNER */) + " " + cm("flexlayout__border_inner_" /* FLEXLAYOUT__BORDER_INNER_ */ + border.getLocation().getName()), children: /* @__PURE__ */ jsx7("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()), children: tabButtons }) }),
3775
+ toolbar
3776
+ ]
3777
+ }
4157
3778
  );
4158
3779
  };
4159
3780
 
4160
3781
  // src/view/DragContainer.tsx
4161
- import * as React9 from "react";
3782
+ import { useEffect as useEffect3, useRef as useRef6 } from "react";
3783
+ import { jsx as jsx8 } from "react/jsx-runtime";
4162
3784
  var DragContainer = (props) => {
4163
3785
  const { layout, node } = props;
4164
- const selfRef = React9.useRef(null);
4165
- React9.useEffect(() => {
3786
+ const selfRef = useRef6(null);
3787
+ useEffect3(() => {
4166
3788
  node.setTabStamp(selfRef.current);
4167
3789
  }, [node, selfRef.current]);
4168
3790
  const cm = layout.getClassName;
4169
3791
  const classNames = cm("flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */);
4170
- return /* @__PURE__ */ React9.createElement("div", { ref: selfRef, className: classNames }, /* @__PURE__ */ React9.createElement(TabButtonStamp, { key: node.getId(), layout, node }));
3792
+ return /* @__PURE__ */ jsx8("div", { ref: selfRef, className: classNames, children: /* @__PURE__ */ jsx8(TabButtonStamp, { layout, node }, node.getId()) });
4171
3793
  };
4172
3794
 
4173
3795
  // src/view/ErrorBoundary.tsx
4174
- import * as React10 from "react";
4175
- var ErrorBoundary = class extends React10.Component {
3796
+ import { Component } from "react";
3797
+ import { jsx as jsx9 } from "react/jsx-runtime";
3798
+ var ErrorBoundary = class extends Component {
4176
3799
  constructor(props) {
4177
3800
  super(props);
4178
3801
  this.state = { hasError: false };
@@ -4186,187 +3809,75 @@ var ErrorBoundary = class extends React10.Component {
4186
3809
  }
4187
3810
  render() {
4188
3811
  if (this.state.hasError) {
4189
- return /* @__PURE__ */ React10.createElement("div", { className: "flexlayout__error_boundary_container" /* FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER */ }, /* @__PURE__ */ React10.createElement("div", { className: "flexlayout__error_boundary_content" /* FLEXLAYOUT__ERROR_BOUNDARY_CONTENT */ }, this.props.message));
3812
+ return /* @__PURE__ */ jsx9("div", { className: "flexlayout__error_boundary_container" /* FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER */, children: /* @__PURE__ */ jsx9("div", { className: "flexlayout__error_boundary_content" /* FLEXLAYOUT__ERROR_BOUNDARY_CONTENT */, children: this.props.message }) });
4190
3813
  }
4191
3814
  return this.props.children;
4192
3815
  }
4193
3816
  };
4194
3817
 
4195
- // src/view/PopoutWindow.tsx
4196
- import * as React11 from "react";
4197
- import { createPortal } from "react-dom";
4198
- var PopoutWindow = (props) => {
4199
- const { title, layout, layoutWindow, url, onCloseWindow, onSetWindow, children } = props;
4200
- const popoutWindow = React11.useRef(null);
4201
- const [content, setContent] = React11.useState(void 0);
4202
- const styleMap = /* @__PURE__ */ new Map();
4203
- React11.useLayoutEffect(() => {
4204
- if (!popoutWindow.current) {
4205
- const windowId = layoutWindow.windowId;
4206
- const rect = layoutWindow.rect;
4207
- popoutWindow.current = window.open(url, windowId, `left=${rect.x},top=${rect.y},width=${rect.width},height=${rect.height}`);
4208
- if (popoutWindow.current) {
4209
- layoutWindow.window = popoutWindow.current;
4210
- onSetWindow(layoutWindow, popoutWindow.current);
4211
- window.addEventListener("beforeunload", () => {
4212
- if (popoutWindow.current) {
4213
- const closedWindow = popoutWindow.current;
4214
- popoutWindow.current = null;
4215
- closedWindow.close();
4216
- }
4217
- });
4218
- popoutWindow.current.addEventListener("load", () => {
4219
- if (popoutWindow.current) {
4220
- popoutWindow.current.focus();
4221
- popoutWindow.current.resizeTo(rect.width, rect.height);
4222
- popoutWindow.current.moveTo(rect.x, rect.y);
4223
- const popoutDocument = popoutWindow.current.document;
4224
- popoutDocument.title = title;
4225
- const popoutContent = popoutDocument.createElement("div");
4226
- popoutContent.className = "flexlayout__floating_window_content" /* FLEXLAYOUT__FLOATING_WINDOW_CONTENT */;
4227
- popoutDocument.body.appendChild(popoutContent);
4228
- void copyStyles(popoutDocument, styleMap).then(() => {
4229
- setContent(popoutContent);
4230
- });
4231
- const observer = new MutationObserver((mutationsList) => handleStyleMutations(mutationsList, popoutDocument, styleMap));
4232
- observer.observe(document.head, { childList: true });
4233
- popoutWindow.current.addEventListener("beforeunload", () => {
4234
- if (popoutWindow.current) {
4235
- onCloseWindow(layoutWindow);
4236
- popoutWindow.current = null;
4237
- observer.disconnect();
4238
- }
4239
- });
4240
- }
4241
- });
4242
- } else {
4243
- console.warn(`Unable to open window ${url}`);
4244
- onCloseWindow(layoutWindow);
4245
- }
4246
- }
4247
- return () => {
4248
- if (!layout.getModel().getwindowsMap().has(layoutWindow.windowId)) {
4249
- popoutWindow.current?.close();
4250
- popoutWindow.current = null;
4251
- }
4252
- };
4253
- }, []);
4254
- if (content !== void 0) {
4255
- return createPortal(children, content);
4256
- } else {
4257
- return null;
4258
- }
4259
- };
4260
- function handleStyleMutations(mutationsList, popoutDocument, styleMap) {
4261
- for (const mutation of mutationsList) {
4262
- if (mutation.type === "childList") {
4263
- for (const addition of mutation.addedNodes) {
4264
- if (addition instanceof HTMLLinkElement || addition instanceof HTMLStyleElement) {
4265
- copyStyle(popoutDocument, addition, styleMap);
4266
- }
4267
- }
4268
- for (const removal of mutation.removedNodes) {
4269
- if (removal instanceof HTMLLinkElement || removal instanceof HTMLStyleElement) {
4270
- const popoutStyle = styleMap.get(removal);
4271
- if (popoutStyle) {
4272
- popoutDocument.head.removeChild(popoutStyle);
4273
- }
4274
- }
4275
- }
4276
- }
4277
- }
4278
- }
4279
- function copyStyles(popoutDoc, styleMap) {
4280
- const promises = [];
4281
- const styleElements = document.querySelectorAll('style, link[rel="stylesheet"]');
4282
- for (const element of styleElements) {
4283
- if (element instanceof HTMLElement) {
4284
- copyStyle(popoutDoc, element, styleMap, promises);
4285
- }
4286
- }
4287
- return Promise.all(promises);
4288
- }
4289
- function copyStyle(popoutDoc, element, styleMap, promises) {
4290
- if (element instanceof HTMLLinkElement) {
4291
- const linkElement = element.cloneNode(true);
4292
- popoutDoc.head.appendChild(linkElement);
4293
- styleMap.set(element, linkElement);
4294
- if (promises) {
4295
- promises.push(
4296
- new Promise((resolve) => {
4297
- linkElement.onload = () => resolve(true);
4298
- })
4299
- );
4300
- }
4301
- } else if (element instanceof HTMLStyleElement) {
4302
- try {
4303
- const styleElement = element.cloneNode(true);
4304
- popoutDoc.head.appendChild(styleElement);
4305
- styleMap.set(element, styleElement);
4306
- } catch {
4307
- }
4308
- }
4309
- }
4310
-
4311
3818
  // src/view/Icons.tsx
4312
- import * as React12 from "react";
3819
+ import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
4313
3820
  var style = { width: "1em", height: "1em", display: "flex", alignItems: "center" };
4314
3821
  var CloseIcon = () => {
4315
- return /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24" }, /* @__PURE__ */ React12.createElement("path", { fill: "none", d: "M0 0h24v24H0z" }), /* @__PURE__ */ React12.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" }));
3822
+ return /* @__PURE__ */ jsxs5("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", children: [
3823
+ /* @__PURE__ */ jsx10("path", { fill: "none", d: "M0 0h24v24H0z" }),
3824
+ /* @__PURE__ */ jsx10("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" })
3825
+ ] });
4316
3826
  };
4317
3827
  var MaximizeIcon = () => {
4318
- return /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)" }, /* @__PURE__ */ React12.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), /* @__PURE__ */ React12.createElement("path", { stroke: "var(--color-icon)", d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }));
3828
+ return /* @__PURE__ */ jsxs5("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)", children: [
3829
+ /* @__PURE__ */ jsx10("path", { d: "M0 0h24v24H0z", fill: "none" }),
3830
+ /* @__PURE__ */ jsx10("path", { stroke: "var(--color-icon)", d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" })
3831
+ ] });
4319
3832
  };
4320
3833
  var OverflowIcon = () => {
4321
- return /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)" }, /* @__PURE__ */ React12.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), /* @__PURE__ */ React12.createElement("path", { stroke: "var(--color-icon)", d: "M7 10l5 5 5-5z" }));
3834
+ return /* @__PURE__ */ jsxs5("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)", children: [
3835
+ /* @__PURE__ */ jsx10("path", { d: "M0 0h24v24H0z", fill: "none" }),
3836
+ /* @__PURE__ */ jsx10("path", { stroke: "var(--color-icon)", d: "M7 10l5 5 5-5z" })
3837
+ ] });
4322
3838
  };
4323
3839
  var EdgeIcon = () => {
4324
- return /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style: { display: "block", width: 10, height: 10 }, preserveAspectRatio: "none", viewBox: "0 0 100 100" }, /* @__PURE__ */ React12.createElement("path", { fill: "var(--color-edge-icon)", stroke: "var(--color-edge-icon)", d: "M10 30 L90 30 l-40 40 Z" }));
4325
- };
4326
- var PopoutIcon = () => {
4327
- return (
4328
- // <svg xmlns="http://www.w3.org/2000/svg" style={style} viewBox="0 0 24 24" fill="var(--color-icon)"><path d="M0 0h24v24H0z" fill="none"/><path stroke="var(--color-icon)" d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5z"/></svg>
4329
- // <svg xmlns="http://www.w3.org/2000/svg" style={style} fill="none" viewBox="0 0 24 24" stroke="var(--color-icon)" stroke-width="2">
4330
- // <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" />
4331
- // </svg>
4332
- /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 20 20", fill: "var(--color-icon)" }, /* @__PURE__ */ React12.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__ */ React12.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" }))
4333
- );
3840
+ return /* @__PURE__ */ jsx10("svg", { xmlns: "http://www.w3.org/2000/svg", style: { display: "block", width: 10, height: 10 }, preserveAspectRatio: "none", viewBox: "0 0 100 100", children: /* @__PURE__ */ jsx10("path", { fill: "var(--color-edge-icon)", stroke: "var(--color-edge-icon)", d: "M10 30 L90 30 l-40 40 Z" }) });
4334
3841
  };
4335
3842
  var RestoreIcon = () => {
4336
- return /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)" }, /* @__PURE__ */ React12.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), /* @__PURE__ */ React12.createElement("path", { stroke: "var(--color-icon)", d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" }));
3843
+ return /* @__PURE__ */ jsxs5("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)", children: [
3844
+ /* @__PURE__ */ jsx10("path", { d: "M0 0h24v24H0z", fill: "none" }),
3845
+ /* @__PURE__ */ jsx10("path", { stroke: "var(--color-icon)", d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" })
3846
+ ] });
4337
3847
  };
4338
3848
  var AsterickIcon = () => {
4339
- return /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, height: "24px", viewBox: "0 -960 960 960", width: "24px" }, /* @__PURE__ */ React12.createElement(
3849
+ return /* @__PURE__ */ jsx10("svg", { xmlns: "http://www.w3.org/2000/svg", style, height: "24px", viewBox: "0 -960 960 960", width: "24px", children: /* @__PURE__ */ jsx10(
4340
3850
  "path",
4341
3851
  {
4342
3852
  fill: "var(--color-icon)",
4343
3853
  stroke: "var(--color-icon)",
4344
3854
  d: "M440-120v-264L254-197l-57-57 187-186H120v-80h264L197-706l57-57 186 187v-264h80v264l186-187 57 57-187 186h264v80H576l187 186-57 57-186-187v264h-80Z"
4345
3855
  }
4346
- ));
3856
+ ) });
4347
3857
  };
4348
3858
 
4349
3859
  // src/view/Overlay.tsx
4350
- import * as React13 from "react";
3860
+ import { jsx as jsx11 } from "react/jsx-runtime";
4351
3861
  var Overlay = (props) => {
4352
3862
  const { layout, show } = props;
4353
- return /* @__PURE__ */ React13.createElement("div", { className: layout.getClassName("flexlayout__layout_overlay" /* FLEXLAYOUT__LAYOUT_OVERLAY */), style: { display: show ? "flex" : "none" } });
3863
+ return /* @__PURE__ */ jsx11("div", { className: layout.getClassName("flexlayout__layout_overlay" /* FLEXLAYOUT__LAYOUT_OVERLAY */), style: { display: show ? "flex" : "none" } });
4354
3864
  };
4355
3865
 
4356
3866
  // src/view/Row.tsx
4357
- import * as React16 from "react";
3867
+ import { useLayoutEffect as useLayoutEffect6, useRef as useRef9 } from "react";
4358
3868
 
4359
3869
  // src/view/TabSet.tsx
4360
- import * as React15 from "react";
3870
+ import { useEffect as useEffect4, useRef as useRef8 } from "react";
4361
3871
 
4362
3872
  // src/view/TabButton.tsx
4363
- import * as React14 from "react";
3873
+ import { useLayoutEffect as useLayoutEffect5, useRef as useRef7 } from "react";
3874
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
4364
3875
  var TabButton = (props) => {
4365
3876
  const { layout, node, selected, path } = props;
4366
- const selfRef = React14.useRef(null);
4367
- const contentRef = React14.useRef(null);
3877
+ const selfRef = useRef7(null);
3878
+ const contentRef = useRef7(null);
4368
3879
  const icons = layout.getIcons();
4369
- React14.useLayoutEffect(() => {
3880
+ useLayoutEffect5(() => {
4370
3881
  node.setTabRect(layout.getBoundingClientRect(selfRef.current));
4371
3882
  if (layout.getEditingTab() === node) {
4372
3883
  contentRef.current.select();
@@ -4452,10 +3963,10 @@ var TabButton = (props) => {
4452
3963
  classNames += " " + node.getClassName();
4453
3964
  }
4454
3965
  const renderState = getRenderStateEx(layout, node);
4455
- let content = renderState.content ? /* @__PURE__ */ React14.createElement("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */) }, renderState.content) : null;
4456
- const leading = renderState.leading ? /* @__PURE__ */ React14.createElement("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */) }, renderState.leading) : null;
3966
+ let content = renderState.content ? /* @__PURE__ */ jsx12("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */), children: renderState.content }) : null;
3967
+ const leading = renderState.leading ? /* @__PURE__ */ jsx12("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */), children: renderState.leading }) : null;
4457
3968
  if (layout.getEditingTab() === node) {
4458
- content = /* @__PURE__ */ React14.createElement(
3969
+ content = /* @__PURE__ */ jsx12(
4459
3970
  "input",
4460
3971
  {
4461
3972
  ref: contentRef,
@@ -4472,18 +3983,18 @@ var TabButton = (props) => {
4472
3983
  if (node.isEnableClose() && !isStretch) {
4473
3984
  const closeTitle = layout.i18nName("Close" /* Close_Tab */);
4474
3985
  renderState.buttons.push(
4475
- /* @__PURE__ */ React14.createElement(
3986
+ /* @__PURE__ */ jsx12(
4476
3987
  "button",
4477
3988
  {
4478
- key: "close",
4479
3989
  "data-layout-path": path + "/button/close",
4480
3990
  title: closeTitle,
4481
3991
  className: cm("flexlayout__tab_button_trailing" /* FLEXLAYOUT__TAB_BUTTON_TRAILING */),
4482
3992
  onPointerDown: onClosePointerDown,
4483
3993
  onClick: onClose,
4484
- onKeyDown: onCloseKeyDown
3994
+ onKeyDown: onCloseKeyDown,
3995
+ children: typeof icons.close === "function" ? icons.close(node) : icons.close
4485
3996
  },
4486
- typeof icons.close === "function" ? icons.close(node) : icons.close
3997
+ "close"
4487
3998
  )
4488
3999
  );
4489
4000
  }
@@ -4493,7 +4004,7 @@ var TabButton = (props) => {
4493
4004
  onClick();
4494
4005
  }
4495
4006
  };
4496
- return /* @__PURE__ */ React14.createElement(
4007
+ return /* @__PURE__ */ jsxs6(
4497
4008
  "div",
4498
4009
  {
4499
4010
  ref: selfRef,
@@ -4510,27 +4021,30 @@ var TabButton = (props) => {
4510
4021
  draggable: true,
4511
4022
  onDragStart,
4512
4023
  onDragEnd,
4513
- onDoubleClick
4514
- },
4515
- leading,
4516
- content,
4517
- renderState.buttons
4024
+ onDoubleClick,
4025
+ children: [
4026
+ leading,
4027
+ content,
4028
+ renderState.buttons
4029
+ ]
4030
+ }
4518
4031
  );
4519
4032
  };
4520
4033
 
4521
4034
  // src/view/TabSet.tsx
4522
- import { createPortal as createPortal2 } from "react-dom";
4035
+ import { createPortal } from "react-dom";
4036
+ import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
4523
4037
  var TabSet = (props) => {
4524
4038
  const { node, layout } = props;
4525
- const tabStripRef = React15.useRef(null);
4526
- const tabStripInnerRef = React15.useRef(null);
4527
- const contentRef = React15.useRef(null);
4528
- const buttonBarRef = React15.useRef(null);
4529
- const overflowbuttonRef = React15.useRef(null);
4530
- const stickyButtonsRef = React15.useRef(null);
4039
+ const tabStripRef = useRef8(null);
4040
+ const tabStripInnerRef = useRef8(null);
4041
+ const contentRef = useRef8(null);
4042
+ const buttonBarRef = useRef8(null);
4043
+ const overflowbuttonRef = useRef8(null);
4044
+ const stickyButtonsRef = useRef8(null);
4531
4045
  const icons = layout.getIcons();
4532
- const isFirstRender = React15.useRef(true);
4533
- React15.useEffect(() => {
4046
+ const isFirstRender = useRef8(true);
4047
+ useEffect4(() => {
4534
4048
  node.setRect(layout.getBoundingClientRect(selfRef.current));
4535
4049
  if (tabStripRef.current) {
4536
4050
  node.setTabStripRect(layout.getBoundingClientRect(tabStripRef.current));
@@ -4576,12 +4090,6 @@ var TabSet = (props) => {
4576
4090
  };
4577
4091
  const onPointerDown = (event) => {
4578
4092
  if (!isAuxMouseEvent(event)) {
4579
- let name = node.getName();
4580
- if (name === void 0) {
4581
- name = "";
4582
- } else {
4583
- name = ": " + name;
4584
- }
4585
4093
  layout.doAction(Actions.setActiveTabset(node.getId(), layout.getWindowId()));
4586
4094
  }
4587
4095
  };
@@ -4610,12 +4118,6 @@ var TabSet = (props) => {
4610
4118
  layout.doAction(Actions.deleteTab(node.getChildren()[0].getId()));
4611
4119
  event.stopPropagation();
4612
4120
  };
4613
- const onPopoutTab = (event) => {
4614
- if (selectedTabNode !== void 0) {
4615
- layout.doAction(Actions.popoutTab(selectedTabNode.getId()));
4616
- }
4617
- event.stopPropagation();
4618
- };
4619
4121
  const onDoubleClick = (_event) => {
4620
4122
  if (node.canMaximize()) {
4621
4123
  layout.maximize(node);
@@ -4625,16 +4127,15 @@ var TabSet = (props) => {
4625
4127
  if (tabStripInnerRef.current !== null && tabStripInnerRef.current.scrollLeft !== 0) {
4626
4128
  tabStripInnerRef.current.scrollLeft = 0;
4627
4129
  }
4628
- const selectedTabNode = node.getSelectedNode();
4629
4130
  const path = node.getPath();
4630
4131
  const tabs = [];
4631
4132
  if (node.isEnableTabStrip()) {
4632
4133
  for (let i = 0; i < node.getChildren().length; i++) {
4633
4134
  const child = node.getChildren()[i];
4634
4135
  const isSelected = node.getSelected() === i;
4635
- tabs.push(/* @__PURE__ */ React15.createElement(TabButton, { layout, node: child, path: path + "/tb" + i, key: child.getId(), selected: isSelected }));
4136
+ tabs.push(/* @__PURE__ */ jsx13(TabButton, { layout, node: child, path: path + "/tb" + i, selected: isSelected }, child.getId()));
4636
4137
  if (i < node.getChildren().length - 1) {
4637
- tabs.push(/* @__PURE__ */ React15.createElement("div", { key: "divider" + i, className: cm("flexlayout__tabset_tab_divider" /* FLEXLAYOUT__TABSET_TAB_DIVIDER */) }));
4138
+ tabs.push(/* @__PURE__ */ jsx13("div", { className: cm("flexlayout__tabset_tab_divider" /* FLEXLAYOUT__TABSET_TAB_DIVIDER */) }, "divider" + i));
4638
4139
  }
4639
4140
  }
4640
4141
  }
@@ -4654,18 +4155,18 @@ var TabSet = (props) => {
4654
4155
  buttons = [...stickyButtons, ...buttons];
4655
4156
  } else {
4656
4157
  tabs.push(
4657
- /* @__PURE__ */ React15.createElement(
4158
+ /* @__PURE__ */ jsx13(
4658
4159
  "div",
4659
4160
  {
4660
4161
  ref: stickyButtonsRef,
4661
- key: "sticky_buttons_container",
4662
4162
  onPointerDown: onInterceptPointerDown,
4663
4163
  onDragStart: (e) => {
4664
4164
  e.preventDefault();
4665
4165
  },
4666
- className: cm("flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */)
4166
+ className: cm("flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */),
4167
+ children: stickyButtons
4667
4168
  },
4668
- stickyButtons
4169
+ "sticky_buttons_container"
4669
4170
  )
4670
4171
  );
4671
4172
  }
@@ -4677,97 +4178,83 @@ var TabSet = (props) => {
4677
4178
  if (typeof icons.more === "function") {
4678
4179
  overflowContent = icons.more(node, hiddenTabs);
4679
4180
  } else {
4680
- overflowContent = /* @__PURE__ */ React15.createElement(React15.Fragment, null, icons.more, /* @__PURE__ */ React15.createElement("div", { className: cm("flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */) }, hiddenTabs.length));
4181
+ overflowContent = /* @__PURE__ */ jsxs7(Fragment3, { children: [
4182
+ icons.more,
4183
+ /* @__PURE__ */ jsx13("div", { className: cm("flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */), children: hiddenTabs.length })
4184
+ ] });
4681
4185
  }
4682
4186
  void buttons.splice(
4683
4187
  Math.min(renderState.overflowPosition, buttons.length),
4684
4188
  0,
4685
- /* @__PURE__ */ React15.createElement(
4189
+ /* @__PURE__ */ jsx13(
4686
4190
  "button",
4687
4191
  {
4688
- key: "overflowbutton",
4689
4192
  "data-layout-path": path + "/button/overflow",
4690
4193
  ref: overflowbuttonRef,
4691
4194
  className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm("flexlayout__tab_button_overflow" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW */),
4692
4195
  title: overflowTitle,
4693
4196
  onClick: onOverflowClick,
4694
- onPointerDown: onInterceptPointerDown
4197
+ onPointerDown: onInterceptPointerDown,
4198
+ children: overflowContent
4695
4199
  },
4696
- overflowContent
4200
+ "overflowbutton"
4697
4201
  )
4698
4202
  );
4699
4203
  }
4700
4204
  }
4701
- if (selectedTabNode !== void 0 && layout.isSupportsPopout() && selectedTabNode.isEnablePopout() && selectedTabNode.isEnablePopoutIcon()) {
4702
- const popoutTitle = layout.i18nName("Popout selected tab" /* Popout_Tab */);
4703
- buttons.push(
4704
- /* @__PURE__ */ React15.createElement(
4705
- "button",
4706
- {
4707
- key: "popout",
4708
- "data-layout-path": path + "/button/popout",
4709
- title: popoutTitle,
4710
- className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm("flexlayout__tab_toolbar_button-float" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT */),
4711
- onClick: onPopoutTab,
4712
- onPointerDown: onInterceptPointerDown
4713
- },
4714
- typeof icons.popout === "function" ? icons.popout(selectedTabNode) : icons.popout
4715
- )
4716
- );
4717
- }
4718
4205
  if (node.canMaximize()) {
4719
4206
  const minTitle = layout.i18nName("Restore tab set" /* Restore */);
4720
4207
  const maxTitle = layout.i18nName("Maximize tab set" /* Maximize */);
4721
4208
  buttons.push(
4722
- /* @__PURE__ */ React15.createElement(
4209
+ /* @__PURE__ */ jsx13(
4723
4210
  "button",
4724
4211
  {
4725
- key: "max",
4726
4212
  "data-layout-path": path + "/button/max",
4727
4213
  title: node.isMaximized() ? minTitle : maxTitle,
4728
4214
  className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm("flexlayout__tab_toolbar_button-" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ */ + (node.isMaximized() ? "max" : "min")),
4729
4215
  onClick: onMaximizeToggle,
4730
- onPointerDown: onInterceptPointerDown
4216
+ onPointerDown: onInterceptPointerDown,
4217
+ children: node.isMaximized() ? typeof icons.restore === "function" ? icons.restore(node) : icons.restore : typeof icons.maximize === "function" ? icons.maximize(node) : icons.maximize
4731
4218
  },
4732
- node.isMaximized() ? typeof icons.restore === "function" ? icons.restore(node) : icons.restore : typeof icons.maximize === "function" ? icons.maximize(node) : icons.maximize
4219
+ "max"
4733
4220
  )
4734
4221
  );
4735
4222
  }
4736
4223
  if (!node.isMaximized() && showClose) {
4737
4224
  const title = isTabStretch ? layout.i18nName("Close" /* Close_Tab */) : layout.i18nName("Close tab set" /* Close_Tabset */);
4738
4225
  buttons.push(
4739
- /* @__PURE__ */ React15.createElement(
4226
+ /* @__PURE__ */ jsx13(
4740
4227
  "button",
4741
4228
  {
4742
- key: "close",
4743
4229
  "data-layout-path": path + "/button/close",
4744
4230
  title,
4745
4231
  className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm("flexlayout__tab_toolbar_button-close" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE */),
4746
4232
  onClick: isTabStretch ? onCloseTab : onClose,
4747
- onPointerDown: onInterceptPointerDown
4233
+ onPointerDown: onInterceptPointerDown,
4234
+ children: typeof icons.closeTabset === "function" ? icons.closeTabset(node) : icons.closeTabset
4748
4235
  },
4749
- typeof icons.closeTabset === "function" ? icons.closeTabset(node) : icons.closeTabset
4236
+ "close"
4750
4237
  )
4751
4238
  );
4752
4239
  }
4753
4240
  if (node.isActive() && node.isEnableActiveIcon()) {
4754
4241
  const title = layout.i18nName("Active tab set" /* Active_Tabset */);
4755
4242
  buttons.push(
4756
- /* @__PURE__ */ React15.createElement("div", { key: "active", "data-layout-path": path + "/button/active", title, className: cm("flexlayout__tab_toolbar_icon" /* FLEXLAYOUT__TAB_TOOLBAR_ICON */) }, typeof icons.activeTabset === "function" ? icons.activeTabset(node) : icons.activeTabset)
4243
+ /* @__PURE__ */ jsx13("div", { "data-layout-path": path + "/button/active", title, className: cm("flexlayout__tab_toolbar_icon" /* FLEXLAYOUT__TAB_TOOLBAR_ICON */), children: typeof icons.activeTabset === "function" ? icons.activeTabset(node) : icons.activeTabset }, "active")
4757
4244
  );
4758
4245
  }
4759
- const buttonbar = /* @__PURE__ */ React15.createElement(
4246
+ const buttonbar = /* @__PURE__ */ jsx13(
4760
4247
  "div",
4761
4248
  {
4762
- key: "buttonbar",
4763
4249
  ref: buttonBarRef,
4764
4250
  className: cm("flexlayout__tab_toolbar" /* FLEXLAYOUT__TAB_TOOLBAR */),
4765
4251
  onPointerDown: onInterceptPointerDown,
4766
4252
  onDragStart: (e) => {
4767
4253
  e.preventDefault();
4768
- }
4254
+ },
4255
+ children: buttons
4769
4256
  },
4770
- buttons
4257
+ "buttonbar"
4771
4258
  );
4772
4259
  let tabStrip;
4773
4260
  let tabStripClasses = cm("flexlayout__tabset_tabbar_outer" /* FLEXLAYOUT__TABSET_TABBAR_OUTER */);
@@ -4789,7 +4276,7 @@ var TabSet = (props) => {
4789
4276
  }
4790
4277
  if (node.isEnableTabWrap()) {
4791
4278
  if (node.isEnableTabStrip()) {
4792
- tabStrip = /* @__PURE__ */ React15.createElement(
4279
+ tabStrip = /* @__PURE__ */ jsxs7(
4793
4280
  "div",
4794
4281
  {
4795
4282
  className: tabStripClasses,
@@ -4802,16 +4289,18 @@ var TabSet = (props) => {
4802
4289
  onClick: onAuxMouseClick,
4803
4290
  onAuxClick: onAuxMouseClick,
4804
4291
  draggable: true,
4805
- onDragStart
4806
- },
4807
- tabs,
4808
- /* @__PURE__ */ React15.createElement("div", { style: { flexGrow: 1 } }),
4809
- buttonbar
4292
+ onDragStart,
4293
+ children: [
4294
+ tabs,
4295
+ /* @__PURE__ */ jsx13("div", { style: { flexGrow: 1 } }),
4296
+ buttonbar
4297
+ ]
4298
+ }
4810
4299
  );
4811
4300
  }
4812
4301
  } else {
4813
4302
  if (node.isEnableTabStrip()) {
4814
- tabStrip = /* @__PURE__ */ React15.createElement(
4303
+ tabStrip = /* @__PURE__ */ jsxs7(
4815
4304
  "div",
4816
4305
  {
4817
4306
  className: tabStripClasses,
@@ -4824,17 +4313,19 @@ var TabSet = (props) => {
4824
4313
  onAuxClick: onAuxMouseClick,
4825
4314
  draggable: true,
4826
4315
  onWheel: onMouseWheel,
4827
- onDragStart
4828
- },
4829
- /* @__PURE__ */ React15.createElement("div", { ref: tabStripInnerRef, className: cm("flexlayout__tabset_tabbar_inner" /* FLEXLAYOUT__TABSET_TABBAR_INNER */) + " " + cm("flexlayout__tabset_tabbar_inner_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_ */ + node.getTabLocation()) }, /* @__PURE__ */ React15.createElement(
4830
- "div",
4831
- {
4832
- style: { left: position, width: isTabStretch ? "100%" : "10000px" },
4833
- 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())
4834
- },
4835
- tabs
4836
- )),
4837
- buttonbar
4316
+ onDragStart,
4317
+ children: [
4318
+ /* @__PURE__ */ jsx13("div", { ref: tabStripInnerRef, className: cm("flexlayout__tabset_tabbar_inner" /* FLEXLAYOUT__TABSET_TABBAR_INNER */) + " " + cm("flexlayout__tabset_tabbar_inner_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_ */ + node.getTabLocation()), children: /* @__PURE__ */ jsx13(
4319
+ "div",
4320
+ {
4321
+ style: { left: position, width: isTabStretch ? "100%" : "10000px" },
4322
+ 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()),
4323
+ children: tabs
4324
+ }
4325
+ ) }),
4326
+ buttonbar
4327
+ ]
4328
+ }
4838
4329
  );
4839
4330
  }
4840
4331
  }
@@ -4845,11 +4336,17 @@ var TabSet = (props) => {
4845
4336
  emptyTabset = placeHolderCallback(node);
4846
4337
  }
4847
4338
  }
4848
- let content = /* @__PURE__ */ React15.createElement("div", { ref: contentRef, className: cm("flexlayout__tabset_content" /* FLEXLAYOUT__TABSET_CONTENT */) }, emptyTabset);
4339
+ let content = /* @__PURE__ */ jsx13("div", { ref: contentRef, className: cm("flexlayout__tabset_content" /* FLEXLAYOUT__TABSET_CONTENT */), children: emptyTabset });
4849
4340
  if (node.getTabLocation() === "top") {
4850
- content = /* @__PURE__ */ React15.createElement(React15.Fragment, null, tabStrip, content);
4341
+ content = /* @__PURE__ */ jsxs7(Fragment3, { children: [
4342
+ tabStrip,
4343
+ content
4344
+ ] });
4851
4345
  } else {
4852
- content = /* @__PURE__ */ React15.createElement(React15.Fragment, null, content, tabStrip);
4346
+ content = /* @__PURE__ */ jsxs7(Fragment3, { children: [
4347
+ content,
4348
+ tabStrip
4349
+ ] });
4853
4350
  }
4854
4351
  const style2 = {
4855
4352
  flexGrow: Math.max(1, node.getWeight() * 1e3),
@@ -4861,11 +4358,11 @@ var TabSet = (props) => {
4861
4358
  if (node.getModel().getMaximizedTabset(layout.getWindowId()) !== void 0 && !node.isMaximized()) {
4862
4359
  style2.display = "none";
4863
4360
  }
4864
- const tabset = /* @__PURE__ */ React15.createElement("div", { ref: selfRef, className: cm("flexlayout__tabset_container" /* FLEXLAYOUT__TABSET_CONTAINER */), style: style2 }, /* @__PURE__ */ React15.createElement("div", { className: cm("flexlayout__tabset" /* FLEXLAYOUT__TABSET */), "data-layout-path": path }, content));
4361
+ const tabset = /* @__PURE__ */ jsx13("div", { ref: selfRef, className: cm("flexlayout__tabset_container" /* FLEXLAYOUT__TABSET_CONTAINER */), style: style2, children: /* @__PURE__ */ jsx13("div", { className: cm("flexlayout__tabset" /* FLEXLAYOUT__TABSET */), "data-layout-path": path, children: content }) });
4865
4362
  if (node.isMaximized()) {
4866
4363
  if (layout.getMainElement()) {
4867
- return createPortal2(
4868
- /* @__PURE__ */ React15.createElement(
4364
+ return createPortal(
4365
+ /* @__PURE__ */ jsx13(
4869
4366
  "div",
4870
4367
  {
4871
4368
  style: {
@@ -4875,9 +4372,9 @@ var TabSet = (props) => {
4875
4372
  left: 0,
4876
4373
  bottom: 0,
4877
4374
  right: 0
4878
- }
4879
- },
4880
- tabset
4375
+ },
4376
+ children: tabset
4377
+ }
4881
4378
  ),
4882
4379
  layout.getMainElement()
4883
4380
  );
@@ -4890,23 +4387,24 @@ var TabSet = (props) => {
4890
4387
  };
4891
4388
 
4892
4389
  // src/view/Row.tsx
4390
+ import { jsx as jsx14 } from "react/jsx-runtime";
4893
4391
  var Row = (props) => {
4894
4392
  const { layout, node } = props;
4895
- const selfRef = React16.useRef(null);
4393
+ const selfRef = useRef9(null);
4896
4394
  const horizontal = node.getOrientation() === Orientation.HORZ;
4897
- React16.useLayoutEffect(() => {
4395
+ useLayoutEffect6(() => {
4898
4396
  node.setRect(layout.getBoundingClientRect(selfRef.current));
4899
4397
  });
4900
4398
  const items = [];
4901
4399
  let i = 0;
4902
4400
  for (const child of node.getChildren()) {
4903
4401
  if (i > 0) {
4904
- items.push(/* @__PURE__ */ React16.createElement(Splitter, { key: "splitter" + i, layout, node, index: i, horizontal }));
4402
+ items.push(/* @__PURE__ */ jsx14(Splitter, { layout, node, index: i, horizontal }, "splitter" + i));
4905
4403
  }
4906
4404
  if (child instanceof RowNode) {
4907
- items.push(/* @__PURE__ */ React16.createElement(Row, { key: child.getId(), layout, node: child }));
4405
+ items.push(/* @__PURE__ */ jsx14(Row, { layout, node: child }, child.getId()));
4908
4406
  } else if (child instanceof TabSetNode) {
4909
- items.push(/* @__PURE__ */ React16.createElement(TabSet, { key: child.getId(), layout, node: child }));
4407
+ items.push(/* @__PURE__ */ jsx14(TabSet, { layout, node: child }, child.getId()));
4910
4408
  }
4911
4409
  i++;
4912
4410
  }
@@ -4923,18 +4421,19 @@ var Row = (props) => {
4923
4421
  } else {
4924
4422
  style2.flexDirection = "column";
4925
4423
  }
4926
- return /* @__PURE__ */ React16.createElement("div", { ref: selfRef, className: layout.getClassName("flexlayout__row" /* FLEXLAYOUT__ROW */), style: style2 }, items);
4424
+ return /* @__PURE__ */ jsx14("div", { ref: selfRef, className: layout.getClassName("flexlayout__row" /* FLEXLAYOUT__ROW */), style: style2, children: items });
4927
4425
  };
4928
4426
 
4929
4427
  // src/view/Tab.tsx
4930
- import * as React17 from "react";
4428
+ import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect7, useRef as useRef10 } from "react";
4429
+ import { jsx as jsx15 } from "react/jsx-runtime";
4931
4430
  var Tab = (props) => {
4932
4431
  const { layout, selected, node, path } = props;
4933
- const selfRef = React17.useRef(null);
4934
- const firstSelect = React17.useRef(true);
4432
+ const selfRef = useRef10(null);
4433
+ const firstSelect = useRef10(true);
4935
4434
  const parentNode = node.getParent();
4936
4435
  const rect = parentNode.getContentRect();
4937
- React17.useLayoutEffect(() => {
4436
+ useLayoutEffect7(() => {
4938
4437
  const element = node.getMoveableElement();
4939
4438
  selfRef.current.appendChild(element);
4940
4439
  node.setMoveableElement(element);
@@ -4951,7 +4450,7 @@ var Tab = (props) => {
4951
4450
  node.setVisible(false);
4952
4451
  };
4953
4452
  }, []);
4954
- React17.useEffect(() => {
4453
+ useEffect5(() => {
4955
4454
  if (node.isSelected()) {
4956
4455
  if (firstSelect.current) {
4957
4456
  node.restoreScrollPosition();
@@ -4959,10 +4458,10 @@ var Tab = (props) => {
4959
4458
  }
4960
4459
  }
4961
4460
  }, [selected]);
4962
- React17.useLayoutEffect(() => {
4461
+ useLayoutEffect7(() => {
4963
4462
  node.setRect(rect);
4964
4463
  }, [rect, node]);
4965
- React17.useLayoutEffect(() => {
4464
+ useLayoutEffect7(() => {
4966
4465
  node.setVisible(selected);
4967
4466
  }, [selected, node]);
4968
4467
  const onPointerDown = () => {
@@ -4976,14 +4475,7 @@ var Tab = (props) => {
4976
4475
  const cm = layout.getClassName;
4977
4476
  const style2 = {};
4978
4477
  rect.styleWithPosition(style2);
4979
- let overlay = null;
4980
- if (selected) {
4981
- if (document.hidden && node.isEnablePopoutOverlay()) {
4982
- const overlayStyle = {};
4983
- rect.styleWithPosition(overlayStyle);
4984
- overlay = /* @__PURE__ */ React17.createElement("div", { style: overlayStyle, className: cm("flexlayout__tab_overlay" /* FLEXLAYOUT__TAB_OVERLAY */) });
4985
- }
4986
- } else {
4478
+ if (!selected) {
4987
4479
  style2.display = "none";
4988
4480
  }
4989
4481
  if (parentNode instanceof TabSetNode) {
@@ -5003,14 +4495,15 @@ var Tab = (props) => {
5003
4495
  if (node.getContentClassName() !== void 0) {
5004
4496
  className += " " + node.getContentClassName();
5005
4497
  }
5006
- return /* @__PURE__ */ React17.createElement(React17.Fragment, null, overlay, /* @__PURE__ */ React17.createElement("div", { ref: selfRef, style: style2, className, "data-layout-path": path }));
4498
+ return /* @__PURE__ */ jsx15("div", { ref: selfRef, style: style2, className, "data-layout-path": path });
5007
4499
  };
5008
4500
 
5009
4501
  // src/view/SizeTracker.tsx
5010
- import * as React18 from "react";
5011
- var SizeTracker = React18.memo(
4502
+ import { memo } from "react";
4503
+ import { Fragment as Fragment4, jsx as jsx16 } from "react/jsx-runtime";
4504
+ var SizeTracker = memo(
5012
4505
  ({ children }) => {
5013
- return /* @__PURE__ */ React18.createElement(React18.Fragment, null, children);
4506
+ return /* @__PURE__ */ jsx16(Fragment4, { children });
5014
4507
  },
5015
4508
  (prevProps, nextProps) => {
5016
4509
  return prevProps.rect.equalSize(nextProps.rect) && prevProps.selected === nextProps.selected && prevProps.forceRevision === nextProps.forceRevision && prevProps.tabsRevision === nextProps.tabsRevision;
@@ -5019,7 +4512,8 @@ var SizeTracker = React18.memo(
5019
4512
  SizeTracker.displayName = "SizeTracker";
5020
4513
 
5021
4514
  // src/view/Layout.tsx
5022
- var Layout = class extends React19.Component {
4515
+ import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
4516
+ var Layout = class extends Component2 {
5023
4517
  /** @internal */
5024
4518
  selfRef;
5025
4519
  /** @internal */
@@ -5028,7 +4522,7 @@ var Layout = class extends React19.Component {
5028
4522
  /** @internal */
5029
4523
  constructor(props) {
5030
4524
  super(props);
5031
- this.selfRef = React19.createRef();
4525
+ this.selfRef = createRef();
5032
4526
  this.revision = 0;
5033
4527
  }
5034
4528
  /** re-render the layout */
@@ -5088,10 +4582,10 @@ var Layout = class extends React19.Component {
5088
4582
  }
5089
4583
  /** @internal */
5090
4584
  render() {
5091
- return /* @__PURE__ */ React19.createElement(LayoutInternal, { ref: this.selfRef, ...this.props, renderRevision: this.revision++ });
4585
+ return /* @__PURE__ */ jsx17(LayoutInternal, { ref: this.selfRef, ...this.props, renderRevision: this.revision++ });
5092
4586
  }
5093
4587
  };
5094
- var LayoutInternal = class _LayoutInternal extends React19.Component {
4588
+ var LayoutInternal = class _LayoutInternal extends Component2 {
5095
4589
  static dragState = void 0;
5096
4590
  selfRef;
5097
4591
  moveablesRef;
@@ -5103,37 +4597,19 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5103
4597
  dropInfo;
5104
4598
  outlineDiv;
5105
4599
  currentDocument;
5106
- currentWindow;
5107
- supportsPopout;
5108
- popoutURL;
5109
4600
  icons;
5110
4601
  resizeObserver;
5111
4602
  dragEnterCount = 0;
5112
4603
  dragging = false;
5113
- windowId;
5114
- layoutWindow;
5115
- mainLayout;
5116
- isMainWindow;
5117
- isDraggingOverWindow;
5118
- styleObserver;
5119
- popoutWindowName;
5120
4604
  // private renderCount: any;
5121
4605
  constructor(props) {
5122
4606
  super(props);
5123
4607
  this.orderedIds = [];
5124
- this.selfRef = React19.createRef();
5125
- this.moveablesRef = React19.createRef();
5126
- this.mainRef = React19.createRef();
5127
- this.findBorderBarSizeRef = React19.createRef();
5128
- this.supportsPopout = props.supportsPopout !== void 0 ? props.supportsPopout : defaultSupportsPopout;
5129
- this.popoutURL = props.popoutURL ? props.popoutURL : "popout.html";
4608
+ this.selfRef = createRef();
4609
+ this.moveablesRef = createRef();
4610
+ this.mainRef = createRef();
4611
+ this.findBorderBarSizeRef = createRef();
5130
4612
  this.icons = { ...defaultIcons, ...props.icons };
5131
- this.windowId = props.windowId ? props.windowId : Model.MAIN_WINDOW_ID;
5132
- this.mainLayout = this.props.mainLayout ? this.props.mainLayout : this;
5133
- this.isDraggingOverWindow = false;
5134
- this.layoutWindow = this.props.model.getwindowsMap().get(this.windowId);
5135
- this.layoutWindow.layout = this;
5136
- this.popoutWindowName = this.props.popoutWindowName || "Popout Window";
5137
4613
  this.state = {
5138
4614
  rect: Rect.empty(),
5139
4615
  editingTab: void 0,
@@ -5144,14 +4620,11 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5144
4620
  forceRevision: 0,
5145
4621
  showHiddenBorder: DockLocation.CENTER
5146
4622
  };
5147
- this.isMainWindow = this.windowId === Model.MAIN_WINDOW_ID;
5148
4623
  }
5149
4624
  componentDidMount() {
5150
4625
  this.updateRect();
5151
4626
  this.currentDocument = this.selfRef.current.ownerDocument;
5152
- this.currentWindow = this.currentDocument.defaultView;
5153
- this.layoutWindow.window = this.currentWindow;
5154
- this.layoutWindow.toScreenRectFunction = (r) => this.getScreenRect(r);
4627
+ this.props.model.layout = this;
5155
4628
  this.resizeObserver = new ResizeObserver((_entries) => {
5156
4629
  requestAnimationFrame(() => {
5157
4630
  this.updateRect();
@@ -5160,81 +4633,49 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5160
4633
  if (this.selfRef.current) {
5161
4634
  this.resizeObserver.observe(this.selfRef.current);
5162
4635
  }
5163
- if (this.isMainWindow) {
5164
- this.props.model.addChangeListener(this.onModelChange);
5165
- this.updateLayoutMetrics();
5166
- } else {
5167
- this.currentWindow.addEventListener("resize", () => {
5168
- this.updateRect();
5169
- });
5170
- const sourceElement = this.props.mainLayout.getRootDiv();
5171
- const targetElement = this.selfRef.current;
5172
- copyInlineStyles(sourceElement, targetElement);
5173
- this.styleObserver = new MutationObserver(() => {
5174
- const changed = copyInlineStyles(sourceElement, targetElement);
5175
- if (changed) {
5176
- this.redraw("mutation observer");
5177
- }
5178
- });
5179
- this.styleObserver.observe(sourceElement, { attributeFilter: ["style"] });
5180
- }
4636
+ this.props.model.addChangeListener(this.onModelChange);
4637
+ this.updateLayoutMetrics();
5181
4638
  document.addEventListener("visibilitychange", () => {
5182
- for (const [_, layoutWindow] of this.props.model.getwindowsMap()) {
5183
- const layout = layoutWindow.layout;
5184
- if (layout) {
5185
- this.redraw("visibility change");
5186
- }
5187
- }
4639
+ this.redraw("visibility change");
5188
4640
  });
5189
4641
  }
5190
4642
  componentDidUpdate() {
5191
4643
  this.currentDocument = this.selfRef.current.ownerDocument;
5192
- this.currentWindow = this.currentDocument.defaultView;
5193
- if (this.isMainWindow) {
5194
- if (this.props.model !== this.previousModel) {
5195
- if (this.previousModel !== void 0) {
5196
- this.previousModel.removeChangeListener(this.onModelChange);
5197
- }
5198
- this.props.model.getwindowsMap().get(this.windowId).layout = this;
5199
- this.props.model.addChangeListener(this.onModelChange);
5200
- this.layoutWindow = this.props.model.getwindowsMap().get(this.windowId);
5201
- this.layoutWindow.layout = this;
5202
- this.layoutWindow.toScreenRectFunction = (r) => this.getScreenRect(r);
5203
- this.previousModel = this.props.model;
5204
- this.tidyMoveablesMap();
4644
+ if (this.props.model !== this.previousModel) {
4645
+ if (this.previousModel !== void 0) {
4646
+ this.previousModel.removeChangeListener(this.onModelChange);
5205
4647
  }
5206
- this.updateLayoutMetrics();
4648
+ this.props.model.layout = this;
4649
+ this.props.model.addChangeListener(this.onModelChange);
4650
+ this.previousModel = this.props.model;
4651
+ this.tidyMoveablesMap();
5207
4652
  }
4653
+ this.updateLayoutMetrics();
5208
4654
  }
5209
4655
  componentWillUnmount() {
5210
4656
  if (this.selfRef.current) {
5211
4657
  this.resizeObserver?.unobserve(this.selfRef.current);
5212
4658
  }
5213
- this.styleObserver?.disconnect();
5214
4659
  }
5215
4660
  render() {
5216
4661
  if (!this.selfRef.current) {
5217
- return /* @__PURE__ */ React19.createElement("div", { ref: this.selfRef, className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */) }, /* @__PURE__ */ React19.createElement("div", { ref: this.moveablesRef, key: "__moveables__", className: this.getClassName("flexlayout__layout_moveables" /* FLEXLAYOUT__LAYOUT_MOVEABLES */) }), this.renderMetricsElements());
4662
+ return /* @__PURE__ */ jsxs8("div", { ref: this.selfRef, className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */), children: [
4663
+ /* @__PURE__ */ jsx17("div", { ref: this.moveablesRef, className: this.getClassName("flexlayout__layout_moveables" /* FLEXLAYOUT__LAYOUT_MOVEABLES */) }, "__moveables__"),
4664
+ this.renderMetricsElements()
4665
+ ] });
5218
4666
  }
5219
4667
  const model = this.props.model;
5220
- model.getRoot(this.windowId).calcMinMaxSize();
5221
- model.getRoot(this.windowId).setPaths("");
4668
+ model.getRoot().calcMinMaxSize();
4669
+ model.getRoot().setPaths("");
5222
4670
  model.getBorderSet().setPaths();
5223
4671
  const inner = this.renderLayout();
5224
4672
  const outer = this.renderBorders(inner);
5225
4673
  const tabs = this.renderTabs();
5226
4674
  const reorderedTabs = this.reorderComponents(tabs, this.orderedIds);
5227
- let floatingWindows = null;
5228
- let tabMoveables = null;
5229
- let tabStamps = null;
5230
- let metricElements = null;
5231
- if (this.isMainWindow) {
5232
- floatingWindows = this.renderWindows();
5233
- metricElements = this.renderMetricsElements();
5234
- tabMoveables = this.renderTabMoveables();
5235
- tabStamps = /* @__PURE__ */ React19.createElement("div", { key: "__tabStamps__", className: this.getClassName("flexlayout__layout_tab_stamps" /* FLEXLAYOUT__LAYOUT_TAB_STAMPS */) }, this.renderTabStamps());
5236
- }
5237
- return /* @__PURE__ */ React19.createElement(
4675
+ const metricElements = this.renderMetricsElements();
4676
+ const tabMoveables = this.renderTabMoveables();
4677
+ const tabStamps = /* @__PURE__ */ jsx17("div", { className: this.getClassName("flexlayout__layout_tab_stamps" /* FLEXLAYOUT__LAYOUT_TAB_STAMPS */), children: this.renderTabStamps() }, "__tabStamps__");
4678
+ return /* @__PURE__ */ jsxs8(
5238
4679
  "div",
5239
4680
  {
5240
4681
  ref: this.selfRef,
@@ -5242,135 +4683,141 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5242
4683
  onDragEnter: this.onDragEnterRaw,
5243
4684
  onDragLeave: this.onDragLeaveRaw,
5244
4685
  onDragOver: this.onDragOver,
5245
- onDrop: this.onDrop
5246
- },
5247
- /* @__PURE__ */ React19.createElement("div", { ref: this.moveablesRef, key: "__moveables__", className: this.getClassName("flexlayout__layout_moveables" /* FLEXLAYOUT__LAYOUT_MOVEABLES */) }),
5248
- metricElements,
5249
- /* @__PURE__ */ React19.createElement(Overlay, { key: "__overlay__", layout: this, show: this.state.showOverlay }),
5250
- outer,
5251
- reorderedTabs,
5252
- tabMoveables,
5253
- tabStamps,
5254
- this.state.portal,
5255
- floatingWindows
4686
+ onDrop: this.onDrop,
4687
+ children: [
4688
+ /* @__PURE__ */ jsx17("div", { ref: this.moveablesRef, className: this.getClassName("flexlayout__layout_moveables" /* FLEXLAYOUT__LAYOUT_MOVEABLES */) }, "__moveables__"),
4689
+ metricElements,
4690
+ /* @__PURE__ */ jsx17(Overlay, { layout: this, show: this.state.showOverlay }, "__overlay__"),
4691
+ outer,
4692
+ reorderedTabs,
4693
+ tabMoveables,
4694
+ tabStamps,
4695
+ this.state.portal
4696
+ ]
4697
+ }
5256
4698
  );
5257
4699
  }
5258
4700
  renderBorders(inner) {
5259
4701
  const classMain = this.getClassName("flexlayout__layout_main" /* FLEXLAYOUT__LAYOUT_MAIN */);
5260
4702
  const borders = this.props.model.getBorderSet().getBorderMap();
5261
- if (this.isMainWindow && borders.size > 0) {
5262
- inner = /* @__PURE__ */ React19.createElement("div", { className: classMain, ref: this.mainRef }, inner);
4703
+ if (borders.size > 0) {
4704
+ inner = /* @__PURE__ */ jsx17("div", { className: classMain, ref: this.mainRef, children: inner });
5263
4705
  const borderSetComponents = /* @__PURE__ */ new Map();
5264
4706
  const borderSetContentComponents = /* @__PURE__ */ new Map();
5265
4707
  for (const [_, location] of DockLocation.values) {
5266
4708
  const border = borders.get(location);
5267
4709
  const showBorder = border && (!border.isAutoHide() || border.isAutoHide() && (border.getChildren().length > 0 || this.state.showHiddenBorder === location));
5268
4710
  if (showBorder) {
5269
- borderSetComponents.set(location, /* @__PURE__ */ React19.createElement(BorderTabSet, { layout: this, border, size: this.state.calculatedBorderBarSize }));
5270
- borderSetContentComponents.set(location, /* @__PURE__ */ React19.createElement(BorderTab, { layout: this, border, show: border.getSelected() !== -1 }));
4711
+ borderSetComponents.set(location, /* @__PURE__ */ jsx17(BorderTabSet, { layout: this, border, size: this.state.calculatedBorderBarSize }));
4712
+ borderSetContentComponents.set(location, /* @__PURE__ */ jsx17(BorderTab, { layout: this, border, show: border.getSelected() !== -1 }));
5271
4713
  }
5272
4714
  }
5273
4715
  const classBorderOuter = this.getClassName("flexlayout__layout_border_container" /* FLEXLAYOUT__LAYOUT_BORDER_CONTAINER */);
5274
4716
  const classBorderInner = this.getClassName("flexlayout__layout_border_container_inner" /* FLEXLAYOUT__LAYOUT_BORDER_CONTAINER_INNER */);
5275
4717
  if (this.props.model.getBorderSet().getLayoutHorizontal()) {
5276
- const innerWithBorderTabs = /* @__PURE__ */ React19.createElement("div", { className: classBorderInner, style: { flexDirection: "column" } }, borderSetContentComponents.get(DockLocation.TOP), /* @__PURE__ */ React19.createElement("div", { className: classBorderInner, style: { flexDirection: "row" } }, borderSetContentComponents.get(DockLocation.LEFT), inner, borderSetContentComponents.get(DockLocation.RIGHT)), borderSetContentComponents.get(DockLocation.BOTTOM));
5277
- return /* @__PURE__ */ React19.createElement("div", { className: classBorderOuter, style: { flexDirection: "column" } }, borderSetComponents.get(DockLocation.TOP), /* @__PURE__ */ React19.createElement("div", { className: classBorderInner, style: { flexDirection: "row" } }, borderSetComponents.get(DockLocation.LEFT), innerWithBorderTabs, borderSetComponents.get(DockLocation.RIGHT)), borderSetComponents.get(DockLocation.BOTTOM));
5278
- } else {
5279
- const innerWithBorderTabs = /* @__PURE__ */ React19.createElement("div", { className: classBorderInner, style: { flexDirection: "row" } }, borderSetContentComponents.get(DockLocation.LEFT), /* @__PURE__ */ React19.createElement("div", { className: classBorderInner, style: { flexDirection: "column" } }, borderSetContentComponents.get(DockLocation.TOP), inner, borderSetContentComponents.get(DockLocation.BOTTOM)), borderSetContentComponents.get(DockLocation.RIGHT));
5280
- return /* @__PURE__ */ React19.createElement("div", { className: classBorderOuter, style: { flexDirection: "row" } }, borderSetComponents.get(DockLocation.LEFT), /* @__PURE__ */ React19.createElement("div", { className: classBorderInner, style: { flexDirection: "column" } }, borderSetComponents.get(DockLocation.TOP), innerWithBorderTabs, borderSetComponents.get(DockLocation.BOTTOM)), borderSetComponents.get(DockLocation.RIGHT));
5281
- }
5282
- } else {
5283
- return /* @__PURE__ */ React19.createElement("div", { className: classMain, ref: this.mainRef, style: { position: "absolute", top: 0, left: 0, bottom: 0, right: 0, display: "flex" } }, inner);
5284
- }
4718
+ const innerWithBorderTabs2 = /* @__PURE__ */ jsxs8("div", { className: classBorderInner, style: { flexDirection: "column" }, children: [
4719
+ borderSetContentComponents.get(DockLocation.TOP),
4720
+ /* @__PURE__ */ jsxs8("div", { className: classBorderInner, style: { flexDirection: "row" }, children: [
4721
+ borderSetContentComponents.get(DockLocation.LEFT),
4722
+ inner,
4723
+ borderSetContentComponents.get(DockLocation.RIGHT)
4724
+ ] }),
4725
+ borderSetContentComponents.get(DockLocation.BOTTOM)
4726
+ ] });
4727
+ return /* @__PURE__ */ jsxs8("div", { className: classBorderOuter, style: { flexDirection: "column" }, children: [
4728
+ borderSetComponents.get(DockLocation.TOP),
4729
+ /* @__PURE__ */ jsxs8("div", { className: classBorderInner, style: { flexDirection: "row" }, children: [
4730
+ borderSetComponents.get(DockLocation.LEFT),
4731
+ innerWithBorderTabs2,
4732
+ borderSetComponents.get(DockLocation.RIGHT)
4733
+ ] }),
4734
+ borderSetComponents.get(DockLocation.BOTTOM)
4735
+ ] });
4736
+ }
4737
+ const innerWithBorderTabs = /* @__PURE__ */ jsxs8("div", { className: classBorderInner, style: { flexDirection: "row" }, children: [
4738
+ borderSetContentComponents.get(DockLocation.LEFT),
4739
+ /* @__PURE__ */ jsxs8("div", { className: classBorderInner, style: { flexDirection: "column" }, children: [
4740
+ borderSetContentComponents.get(DockLocation.TOP),
4741
+ inner,
4742
+ borderSetContentComponents.get(DockLocation.BOTTOM)
4743
+ ] }),
4744
+ borderSetContentComponents.get(DockLocation.RIGHT)
4745
+ ] });
4746
+ return /* @__PURE__ */ jsxs8("div", { className: classBorderOuter, style: { flexDirection: "row" }, children: [
4747
+ borderSetComponents.get(DockLocation.LEFT),
4748
+ /* @__PURE__ */ jsxs8("div", { className: classBorderInner, style: { flexDirection: "column" }, children: [
4749
+ borderSetComponents.get(DockLocation.TOP),
4750
+ innerWithBorderTabs,
4751
+ borderSetComponents.get(DockLocation.BOTTOM)
4752
+ ] }),
4753
+ borderSetComponents.get(DockLocation.RIGHT)
4754
+ ] });
4755
+ }
4756
+ return /* @__PURE__ */ jsx17("div", { className: classMain, ref: this.mainRef, style: { position: "absolute", top: 0, left: 0, bottom: 0, right: 0, display: "flex" }, children: inner });
5285
4757
  }
5286
4758
  renderLayout() {
5287
- return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(Row, { key: "__row__", layout: this, node: this.props.model.getRoot(this.windowId) }), this.renderEdgeIndicators());
4759
+ return /* @__PURE__ */ jsxs8(Fragment5, { children: [
4760
+ /* @__PURE__ */ jsx17(Row, { layout: this, node: this.props.model.getRoot() }, "__row__"),
4761
+ this.renderEdgeIndicators()
4762
+ ] });
5288
4763
  }
5289
4764
  renderEdgeIndicators() {
5290
4765
  const edges = [];
5291
4766
  const arrowIcon = this.icons.edgeArrow;
5292
4767
  if (this.state.showEdges) {
5293
- const r = this.props.model.getRoot(this.windowId).getRect();
4768
+ const r = this.props.model.getRoot().getRect();
5294
4769
  const length = edgeRectLength;
5295
4770
  const width = edgeRectWidth;
5296
4771
  const offset = edgeRectLength / 2;
5297
4772
  const className = this.getClassName("flexlayout__edge_rect" /* FLEXLAYOUT__EDGE_RECT */);
5298
4773
  const radius = 50;
5299
4774
  edges.push(
5300
- /* @__PURE__ */ React19.createElement(
4775
+ /* @__PURE__ */ jsx17(
5301
4776
  "div",
5302
4777
  {
5303
- key: "North",
5304
4778
  style: { top: 0, left: r.width / 2 - offset, width: length, height: width, borderBottomLeftRadius: radius, borderBottomRightRadius: radius },
5305
- className: className + " " + this.getClassName("flexlayout__edge_rect_top" /* FLEXLAYOUT__EDGE_RECT_TOP */)
4779
+ className: className + " " + this.getClassName("flexlayout__edge_rect_top" /* FLEXLAYOUT__EDGE_RECT_TOP */),
4780
+ children: /* @__PURE__ */ jsx17("div", { style: { transform: "rotate(180deg)" }, children: arrowIcon })
5306
4781
  },
5307
- /* @__PURE__ */ React19.createElement("div", { style: { transform: "rotate(180deg)" } }, arrowIcon)
4782
+ "North"
5308
4783
  )
5309
4784
  );
5310
4785
  edges.push(
5311
- /* @__PURE__ */ React19.createElement(
4786
+ /* @__PURE__ */ jsx17(
5312
4787
  "div",
5313
4788
  {
5314
- key: "West",
5315
4789
  style: { top: r.height / 2 - offset, left: 0, width, height: length, borderTopRightRadius: radius, borderBottomRightRadius: radius },
5316
- className: className + " " + this.getClassName("flexlayout__edge_rect_left" /* FLEXLAYOUT__EDGE_RECT_LEFT */)
4790
+ className: className + " " + this.getClassName("flexlayout__edge_rect_left" /* FLEXLAYOUT__EDGE_RECT_LEFT */),
4791
+ children: /* @__PURE__ */ jsx17("div", { style: { transform: "rotate(90deg)" }, children: arrowIcon })
5317
4792
  },
5318
- /* @__PURE__ */ React19.createElement("div", { style: { transform: "rotate(90deg)" } }, arrowIcon)
4793
+ "West"
5319
4794
  )
5320
4795
  );
5321
4796
  edges.push(
5322
- /* @__PURE__ */ React19.createElement(
4797
+ /* @__PURE__ */ jsx17(
5323
4798
  "div",
5324
4799
  {
5325
- key: "South",
5326
4800
  style: { top: r.height - width, left: r.width / 2 - offset, width: length, height: width, borderTopLeftRadius: radius, borderTopRightRadius: radius },
5327
- className: className + " " + this.getClassName("flexlayout__edge_rect_bottom" /* FLEXLAYOUT__EDGE_RECT_BOTTOM */)
4801
+ className: className + " " + this.getClassName("flexlayout__edge_rect_bottom" /* FLEXLAYOUT__EDGE_RECT_BOTTOM */),
4802
+ children: /* @__PURE__ */ jsx17("div", { children: arrowIcon })
5328
4803
  },
5329
- /* @__PURE__ */ React19.createElement("div", null, arrowIcon)
4804
+ "South"
5330
4805
  )
5331
4806
  );
5332
4807
  edges.push(
5333
- /* @__PURE__ */ React19.createElement(
4808
+ /* @__PURE__ */ jsx17(
5334
4809
  "div",
5335
4810
  {
5336
- key: "East",
5337
4811
  style: { top: r.height / 2 - offset, left: r.width - width, width, height: length, borderTopLeftRadius: radius, borderBottomLeftRadius: radius },
5338
- className: className + " " + this.getClassName("flexlayout__edge_rect_right" /* FLEXLAYOUT__EDGE_RECT_RIGHT */)
4812
+ className: className + " " + this.getClassName("flexlayout__edge_rect_right" /* FLEXLAYOUT__EDGE_RECT_RIGHT */),
4813
+ children: /* @__PURE__ */ jsx17("div", { style: { transform: "rotate(-90deg)" }, children: arrowIcon })
5339
4814
  },
5340
- /* @__PURE__ */ React19.createElement("div", { style: { transform: "rotate(-90deg)" } }, arrowIcon)
4815
+ "East"
5341
4816
  )
5342
4817
  );
5343
4818
  }
5344
4819
  return edges;
5345
4820
  }
5346
- renderWindows() {
5347
- const floatingWindows = [];
5348
- if (this.supportsPopout) {
5349
- const windows = this.props.model.getwindowsMap();
5350
- let i = 1;
5351
- for (const [windowId, layoutWindow] of windows) {
5352
- if (windowId !== Model.MAIN_WINDOW_ID) {
5353
- floatingWindows.push(
5354
- /* @__PURE__ */ React19.createElement(
5355
- PopoutWindow,
5356
- {
5357
- key: windowId,
5358
- layout: this,
5359
- title: this.popoutWindowName + " " + i,
5360
- layoutWindow,
5361
- url: this.popoutURL + "?id=" + windowId,
5362
- onSetWindow: this.onSetWindow,
5363
- onCloseWindow: this.onCloseWindow
5364
- },
5365
- /* @__PURE__ */ React19.createElement(_LayoutInternal, { ...this.props, windowId, mainLayout: this })
5366
- )
5367
- );
5368
- i++;
5369
- }
5370
- }
5371
- }
5372
- return floatingWindows;
5373
- }
5374
4821
  renderTabMoveables() {
5375
4822
  const tabMoveables = [];
5376
4823
  this.props.model.visitNodes((node) => {
@@ -5382,10 +4829,10 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5382
4829
  const rect = child.getParent().getContentRect();
5383
4830
  const renderTab = child.isRendered() || (selected || !child.isEnableRenderOnDemand()) && rect.width > 0 && rect.height > 0;
5384
4831
  if (renderTab) {
5385
- const key = child.getId() + (child.isEnableWindowReMount() ? child.getWindowId() : "");
4832
+ const key = child.getId();
5386
4833
  tabMoveables.push(
5387
- createPortal3(
5388
- /* @__PURE__ */ React19.createElement(SizeTracker, { rect, selected: child.isSelected(), forceRevision: this.state.forceRevision, tabsRevision: this.props.renderRevision, key }, /* @__PURE__ */ React19.createElement(ErrorBoundary, { message: this.i18nName("Error rendering component" /* Error_rendering_component */) }, this.props.factory(child))),
4834
+ createPortal2(
4835
+ /* @__PURE__ */ jsx17(SizeTracker, { rect, selected: child.isSelected(), forceRevision: this.state.forceRevision, tabsRevision: this.props.renderRevision, children: /* @__PURE__ */ jsx17(ErrorBoundary, { message: this.i18nName("Error rendering component" /* Error_rendering_component */), children: this.props.factory(child) }) }, key),
5389
4836
  element,
5390
4837
  key
5391
4838
  )
@@ -5401,33 +4848,28 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5401
4848
  this.props.model.visitNodes((node) => {
5402
4849
  if (node instanceof TabNode) {
5403
4850
  const child = node;
5404
- tabStamps.push(/* @__PURE__ */ React19.createElement(DragContainer, { key: child.getId(), layout: this, node: child }));
4851
+ tabStamps.push(/* @__PURE__ */ jsx17(DragContainer, { layout: this, node: child }, child.getId()));
5405
4852
  }
5406
4853
  });
5407
4854
  return tabStamps;
5408
4855
  }
5409
4856
  renderTabs() {
5410
4857
  const tabs = /* @__PURE__ */ new Map();
5411
- this.props.model.visitWindowNodes(this.windowId, (node) => {
4858
+ this.props.model.visitNodes((node) => {
5412
4859
  if (node instanceof TabNode) {
5413
4860
  const child = node;
5414
4861
  const selected = child.isSelected();
5415
4862
  const path = child.getPath();
5416
4863
  const renderTab = child.isRendered() || selected || !child.isEnableRenderOnDemand();
5417
4864
  if (renderTab) {
5418
- tabs.set(
5419
- child.getId(),
5420
- // <SizeTracker rect={rect} forceRevision={this.state.forceRevision} key={key}>
5421
- /* @__PURE__ */ React19.createElement(Tab, { key: child.getId(), layout: this, path, node: child, selected })
5422
- // </SizeTracker>
5423
- );
4865
+ tabs.set(child.getId(), /* @__PURE__ */ jsx17(Tab, { layout: this, path, node: child, selected }, child.getId()));
5424
4866
  }
5425
4867
  }
5426
4868
  });
5427
4869
  return tabs;
5428
4870
  }
5429
4871
  renderMetricsElements() {
5430
- return /* @__PURE__ */ React19.createElement("div", { key: "findBorderBarSize", ref: this.findBorderBarSizeRef, className: this.getClassName("flexlayout__border_sizer" /* FLEXLAYOUT__BORDER_SIZER */) }, "FindBorderBarSize");
4872
+ return /* @__PURE__ */ jsx17("div", { ref: this.findBorderBarSizeRef, className: this.getClassName("flexlayout__border_sizer" /* FLEXLAYOUT__BORDER_SIZER */), children: "FindBorderBarSize" }, "findBorderBarSize");
5431
4873
  }
5432
4874
  checkForBorderToShow(x, y) {
5433
4875
  const r = this.getBoundingClientRect(this.mainRef.current);
@@ -5481,7 +4923,6 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5481
4923
  reorderComponents(components, ids) {
5482
4924
  const nextIds = [];
5483
4925
  const nextIdsSet = /* @__PURE__ */ new Set();
5484
- let reordered = [];
5485
4926
  for (const id of ids) {
5486
4927
  if (components.get(id)) {
5487
4928
  nextIds.push(id);
@@ -5494,7 +4935,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5494
4935
  ids.push(id);
5495
4936
  }
5496
4937
  }
5497
- reordered = ids.map((id) => {
4938
+ const reordered = ids.map((id) => {
5498
4939
  return components.get(id);
5499
4940
  });
5500
4941
  return reordered;
@@ -5506,12 +4947,12 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5506
4947
  }
5507
4948
  };
5508
4949
  redraw(_type) {
5509
- this.mainLayout.setState((state, _props) => {
4950
+ this.setState((state, _props) => {
5510
4951
  return { forceRevision: state.forceRevision + 1 };
5511
4952
  });
5512
4953
  }
5513
4954
  redrawInternal(_type) {
5514
- this.mainLayout.setState((state, _props) => {
4955
+ this.setState((state, _props) => {
5515
4956
  return { layoutRevision: state.layoutRevision + 1 };
5516
4957
  });
5517
4958
  }
@@ -5522,17 +4963,13 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5522
4963
  return this.props.model.doAction(outcome);
5523
4964
  }
5524
4965
  return void 0;
5525
- } else {
5526
- return this.props.model.doAction(action);
5527
4966
  }
4967
+ return this.props.model.doAction(action);
5528
4968
  }
5529
4969
  updateRect = () => {
5530
4970
  const rect = this.getDomRect();
5531
4971
  if (!rect.equals(this.state.rect) && rect.width !== 0 && rect.height !== 0) {
5532
4972
  this.setState({ rect });
5533
- if (this.windowId !== Model.MAIN_WINDOW_ID) {
5534
- this.redrawInternal("rect updated");
5535
- }
5536
4973
  }
5537
4974
  };
5538
4975
  getBoundingClientRect(div) {
@@ -5556,14 +4993,13 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5556
4993
  return moveableElement;
5557
4994
  }
5558
4995
  getMainLayout() {
5559
- return this.mainLayout;
4996
+ return this;
5560
4997
  }
5561
4998
  getClassName = (defaultClassName) => {
5562
4999
  if (this.props.classNameMapper === void 0) {
5563
5000
  return defaultClassName;
5564
- } else {
5565
- return this.props.classNameMapper(defaultClassName);
5566
5001
  }
5002
+ return this.props.classNameMapper(defaultClassName);
5567
5003
  };
5568
5004
  getCurrentDocument() {
5569
5005
  return this.currentDocument;
@@ -5571,12 +5007,11 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5571
5007
  getDomRect() {
5572
5008
  if (this.selfRef.current) {
5573
5009
  return Rect.fromDomRect(this.selfRef.current.getBoundingClientRect());
5574
- } else {
5575
- return Rect.empty();
5576
5010
  }
5011
+ return Rect.empty();
5577
5012
  }
5578
5013
  getWindowId() {
5579
- return this.windowId;
5014
+ return Model.MAIN_WINDOW_ID;
5580
5015
  }
5581
5016
  getRootDiv() {
5582
5017
  return this.selfRef.current;
@@ -5587,15 +5022,9 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5587
5022
  getFactory() {
5588
5023
  return this.props.factory;
5589
5024
  }
5590
- isSupportsPopout() {
5591
- return this.supportsPopout;
5592
- }
5593
5025
  isRealtimeResize() {
5594
5026
  return this.props.realtimeResize ?? false;
5595
5027
  }
5596
- getPopoutURL() {
5597
- return this.popoutURL;
5598
- }
5599
5028
  setEditingTab(tabNode) {
5600
5029
  this.setState({ editingTab: tabNode });
5601
5030
  }
@@ -5605,22 +5034,6 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5605
5034
  getModel() {
5606
5035
  return this.props.model;
5607
5036
  }
5608
- onCloseWindow = (windowLayout) => {
5609
- this.doAction(Actions.closeWindow(windowLayout.windowId));
5610
- };
5611
- onSetWindow = (_windowLayout, _window) => {
5612
- };
5613
- getScreenRect(inRect) {
5614
- const rect = inRect.clone();
5615
- const layoutRect = this.getDomRect();
5616
- const navHeight = 60;
5617
- const navWidth = 2;
5618
- rect.x = this.currentWindow.screenX + this.currentWindow.scrollX + navWidth / 2 + layoutRect.x + rect.x;
5619
- rect.y = this.currentWindow.screenY + this.currentWindow.scrollY + (navHeight - navWidth / 2) + layoutRect.y + rect.y;
5620
- rect.height += navHeight;
5621
- rect.width += navWidth;
5622
- return rect;
5623
- }
5624
5037
  addTabToTabSet(tabsetId, json) {
5625
5038
  const tabsetNode = this.props.model.getNodeById(tabsetId);
5626
5039
  if (tabsetNode !== void 0) {
@@ -5630,7 +5043,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5630
5043
  return void 0;
5631
5044
  }
5632
5045
  addTabToActiveTabSet(json) {
5633
- const tabsetNode = this.props.model.getActiveTabset(this.windowId);
5046
+ const tabsetNode = this.props.model.getActiveTabset();
5634
5047
  if (tabsetNode !== void 0) {
5635
5048
  const node = this.doAction(Actions.addNode(json, tabsetNode.getId(), DockLocation.CENTER, -1));
5636
5049
  return node;
@@ -5638,7 +5051,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5638
5051
  return void 0;
5639
5052
  }
5640
5053
  showControlInPortal = (control, element) => {
5641
- const portal = createPortal3(control, element);
5054
+ const portal = createPortal2(control, element);
5642
5055
  this.setState({ portal });
5643
5056
  };
5644
5057
  hideControlInPortal = () => {
@@ -5693,13 +5106,13 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5693
5106
  // *************************** Start Drag Drop *************************************
5694
5107
  addTabWithDragAndDrop(_event, json, onDrop) {
5695
5108
  const tempNode = TabNode.fromJson(json, this.props.model, false);
5696
- _LayoutInternal.dragState = new DragState(this.mainLayout, "add" /* Add */, tempNode, json, onDrop);
5109
+ _LayoutInternal.dragState = new DragState(this, "add" /* Add */, tempNode, json, onDrop);
5697
5110
  }
5698
5111
  moveTabWithDragAndDrop(event, node) {
5699
5112
  this.setDragNode(event, node);
5700
5113
  }
5701
5114
  setDragNode = (event, node) => {
5702
- _LayoutInternal.dragState = new DragState(this.mainLayout, "internal" /* Internal */, node, void 0, void 0);
5115
+ _LayoutInternal.dragState = new DragState(this, "internal" /* Internal */, node, void 0, void 0);
5703
5116
  event.dataTransfer.setData("text/plain", "--flexlayout--");
5704
5117
  event.dataTransfer.effectAllowed = "copyMove";
5705
5118
  event.dataTransfer.dropEffect = "move";
@@ -5731,7 +5144,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5731
5144
  const y = isInVerticalBorder ? 10 : offsetY;
5732
5145
  let rendered = false;
5733
5146
  if (this.props.onRenderDragRect) {
5734
- const content = /* @__PURE__ */ React19.createElement(TabButtonStamp, { key: node.getId(), layout: this, node });
5147
+ const content = /* @__PURE__ */ jsx17(TabButtonStamp, { layout: this, node }, node.getId());
5735
5148
  const dragComponent = this.props.onRenderDragRect(content, node, void 0);
5736
5149
  if (dragComponent) {
5737
5150
  this.setDragComponent(event, dragComponent, x, y);
@@ -5740,7 +5153,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5740
5153
  }
5741
5154
  if (!rendered) {
5742
5155
  if (isSafari()) {
5743
- this.setDragComponent(event, /* @__PURE__ */ React19.createElement(TabButtonStamp, { node, layout: this }), x, y);
5156
+ this.setDragComponent(event, /* @__PURE__ */ jsx17(TabButtonStamp, { node, layout: this }), x, y);
5744
5157
  } else {
5745
5158
  event.dataTransfer.setDragImage(node.getTabStamp(), x, y);
5746
5159
  }
@@ -5748,7 +5161,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5748
5161
  }
5749
5162
  };
5750
5163
  setDragComponent(event, component, x, y) {
5751
- const dragElement = /* @__PURE__ */ React19.createElement("div", { style: { position: "unset" }, className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */) + " " + this.getClassName("flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */) }, component);
5164
+ const dragElement = /* @__PURE__ */ jsx17("div", { style: { position: "unset" }, className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */) + " " + this.getClassName("flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */), children: component });
5752
5165
  const tempDiv = this.currentDocument.createElement("div");
5753
5166
  tempDiv.setAttribute("data-layout-path", "/drag-rectangle");
5754
5167
  tempDiv.style.position = "absolute";
@@ -5761,21 +5174,6 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5761
5174
  this.currentDocument.body.removeChild(tempDiv);
5762
5175
  }, 0);
5763
5176
  }
5764
- setDraggingOverWindow(overWindow) {
5765
- if (this.isDraggingOverWindow !== overWindow) {
5766
- if (this.outlineDiv) {
5767
- this.outlineDiv.style.visibility = overWindow ? "hidden" : "visible";
5768
- }
5769
- if (overWindow) {
5770
- this.setState({ showEdges: false });
5771
- } else {
5772
- if (this.props.model.getMaximizedTabset(this.windowId) === void 0) {
5773
- this.setState({ showEdges: this.props.model.isEnableEdgeDock() });
5774
- }
5775
- }
5776
- this.isDraggingOverWindow = overWindow;
5777
- }
5778
- }
5779
5177
  onDragEnterRaw = (event) => {
5780
5178
  this.dragEnterCount++;
5781
5179
  if (this.dragEnterCount === 1) {
@@ -5802,12 +5200,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5802
5200
  };
5803
5201
  clearDragMain() {
5804
5202
  _LayoutInternal.dragState = void 0;
5805
- if (this.windowId === Model.MAIN_WINDOW_ID) {
5806
- this.isDraggingOverWindow = false;
5807
- }
5808
- for (const [, layoutWindow] of this.props.model.getwindowsMap()) {
5809
- layoutWindow.layout.clearDragLocal();
5810
- }
5203
+ this.clearDragLocal();
5811
5204
  }
5812
5205
  clearDragLocal() {
5813
5206
  this.setState({ showEdges: false });
@@ -5825,14 +5218,11 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5825
5218
  const externalDrag = this.props.onExternalDrag(event);
5826
5219
  if (externalDrag) {
5827
5220
  const tempNode = TabNode.fromJson(externalDrag.json, this.props.model, false);
5828
- _LayoutInternal.dragState = new DragState(this.mainLayout, "external" /* External */, tempNode, externalDrag.json, externalDrag.onDrop);
5221
+ _LayoutInternal.dragState = new DragState(this, "external" /* External */, tempNode, externalDrag.json, externalDrag.onDrop);
5829
5222
  }
5830
5223
  }
5831
5224
  if (_LayoutInternal.dragState) {
5832
- if (this.windowId !== Model.MAIN_WINDOW_ID && _LayoutInternal.dragState.mainLayout === this.mainLayout) {
5833
- _LayoutInternal.dragState.mainLayout.setDraggingOverWindow(true);
5834
- }
5835
- if (_LayoutInternal.dragState.mainLayout !== this.mainLayout) {
5225
+ if (_LayoutInternal.dragState.mainLayout !== this) {
5836
5226
  return;
5837
5227
  }
5838
5228
  event.preventDefault();
@@ -5847,7 +5237,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5847
5237
  this.dragging = true;
5848
5238
  this.showOverlay(true);
5849
5239
  this.props.onDragStateChange?.(true);
5850
- if (!this.isDraggingOverWindow && this.props.model.getMaximizedTabset(this.windowId) === void 0) {
5240
+ if (this.props.model.getMaximizedTabset() === void 0) {
5851
5241
  this.setState({ showEdges: this.props.model.isEnableEdgeDock() });
5852
5242
  }
5853
5243
  const clientRect = this.selfRef.current.getBoundingClientRect();
@@ -5856,7 +5246,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5856
5246
  }
5857
5247
  };
5858
5248
  onDragOver = (event) => {
5859
- if (this.dragging && !this.isDraggingOverWindow) {
5249
+ if (this.dragging) {
5860
5250
  event.preventDefault();
5861
5251
  const clientRect = this.selfRef.current?.getBoundingClientRect();
5862
5252
  const pos = {
@@ -5864,7 +5254,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5864
5254
  y: event.clientY - (clientRect?.top ?? 0)
5865
5255
  };
5866
5256
  this.checkForBorderToShow(pos.x, pos.y);
5867
- const dropInfo = this.props.model.findDropTargetNode(this.windowId, _LayoutInternal.dragState.dragNode, pos.x, pos.y);
5257
+ const dropInfo = this.props.model.findDropTargetNode(Model.MAIN_WINDOW_ID, _LayoutInternal.dragState.dragNode, pos.x, pos.y);
5868
5258
  if (dropInfo) {
5869
5259
  this.dropInfo = dropInfo;
5870
5260
  if (this.outlineDiv) {
@@ -5877,9 +5267,6 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5877
5267
  };
5878
5268
  onDragLeave = (_event) => {
5879
5269
  if (this.dragging) {
5880
- if (this.windowId !== Model.MAIN_WINDOW_ID) {
5881
- _LayoutInternal.dragState.mainLayout.setDraggingOverWindow(false);
5882
- }
5883
5270
  this.clearDragLocal();
5884
5271
  }
5885
5272
  };
@@ -5897,7 +5284,7 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5897
5284
  this.doAction(Actions.moveNode(dragState.dragNode.getId(), this.dropInfo.node.getId(), this.dropInfo.location, this.dropInfo.index));
5898
5285
  }
5899
5286
  }
5900
- this.mainLayout.clearDragMain();
5287
+ this.clearDragMain();
5901
5288
  }
5902
5289
  this.dragEnterCount = 0;
5903
5290
  };
@@ -5905,16 +5292,14 @@ var LayoutInternal = class _LayoutInternal extends React19.Component {
5905
5292
  };
5906
5293
  var FlexLayoutVersion = "0.8.1";
5907
5294
  var defaultIcons = {
5908
- close: /* @__PURE__ */ React19.createElement(CloseIcon, null),
5909
- closeTabset: /* @__PURE__ */ React19.createElement(CloseIcon, null),
5910
- popout: /* @__PURE__ */ React19.createElement(PopoutIcon, null),
5911
- maximize: /* @__PURE__ */ React19.createElement(MaximizeIcon, null),
5912
- restore: /* @__PURE__ */ React19.createElement(RestoreIcon, null),
5913
- more: /* @__PURE__ */ React19.createElement(OverflowIcon, null),
5914
- edgeArrow: /* @__PURE__ */ React19.createElement(EdgeIcon, null),
5915
- activeTabset: /* @__PURE__ */ React19.createElement(AsterickIcon, null)
5295
+ close: /* @__PURE__ */ jsx17(CloseIcon, {}),
5296
+ closeTabset: /* @__PURE__ */ jsx17(CloseIcon, {}),
5297
+ maximize: /* @__PURE__ */ jsx17(MaximizeIcon, {}),
5298
+ restore: /* @__PURE__ */ jsx17(RestoreIcon, {}),
5299
+ more: /* @__PURE__ */ jsx17(OverflowIcon, {}),
5300
+ edgeArrow: /* @__PURE__ */ jsx17(EdgeIcon, {}),
5301
+ activeTabset: /* @__PURE__ */ jsx17(AsterickIcon, {})
5916
5302
  };
5917
- var defaultSupportsPopout = isDesktop();
5918
5303
  var edgeRectLength = 100;
5919
5304
  var edgeRectWidth = 10;
5920
5305
  var DragState = class {
@@ -5933,8 +5318,8 @@ var DragState = class {
5933
5318
  };
5934
5319
 
5935
5320
  // src/view/OptimizedLayout.tsx
5936
- import * as React20 from "react";
5937
- import { memo as memo2, useCallback, useEffect as useEffect6, useLayoutEffect as useLayoutEffect9, useMemo, useRef as useRef12, useState as useState4 } from "react";
5321
+ import { memo as memo2, useCallback, useEffect as useEffect6, useLayoutEffect as useLayoutEffect8, useMemo, useRef as useRef11, useState as useState3 } from "react";
5322
+ import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
5938
5323
  function createTabInfo(node) {
5939
5324
  const parent = node.getParent();
5940
5325
  const contentRect = parent?.getContentRect() ?? Rect.empty();
@@ -5992,10 +5377,10 @@ var TabPanel = memo2(function TabPanel2({
5992
5377
  isMaximized,
5993
5378
  hasMaximizedTabset
5994
5379
  }) {
5995
- const selfRef = useRef12(null);
5380
+ const selfRef = useRef11(null);
5996
5381
  const hasValidDimensions = rect.width > 0 && rect.height > 0;
5997
5382
  const content = useMemo(() => renderTab(node), [renderTab, node]);
5998
- useLayoutEffect9(() => {
5383
+ useLayoutEffect8(() => {
5999
5384
  const element = selfRef.current;
6000
5385
  if (!element) return;
6001
5386
  const onPointerDown = () => {
@@ -6020,7 +5405,7 @@ var TabPanel = memo2(function TabPanel2({
6020
5405
  isHidden = true;
6021
5406
  }
6022
5407
  }
6023
- return /* @__PURE__ */ React20.createElement(
5408
+ return /* @__PURE__ */ jsx18(
6024
5409
  "div",
6025
5410
  {
6026
5411
  ref: selfRef,
@@ -6038,9 +5423,9 @@ var TabPanel = memo2(function TabPanel2({
6038
5423
  zIndex,
6039
5424
  // Tab panels receive pointer events when visible and not dragging
6040
5425
  pointerEvents: !isHidden && !isDragging ? "auto" : "none"
6041
- }
6042
- },
6043
- content
5426
+ },
5427
+ children: content
5428
+ }
6044
5429
  );
6045
5430
  });
6046
5431
  function TabContainer({
@@ -6056,13 +5441,12 @@ function TabContainer({
6056
5441
  const maximizedTabset = model.getMaximizedTabset(Model.MAIN_WINDOW_ID);
6057
5442
  const hasMaximizedTabset = maximizedTabset !== void 0;
6058
5443
  const containerStyle = hasMaximizedTabset ? { zIndex: 10 } : {};
6059
- return /* @__PURE__ */ React20.createElement("div", { className: "flexlayout__optimized_layout_tab_container", "data-layout-path": "/tab-container", style: containerStyle }, Array.from(tabs.entries()).map(([nodeId, tabInfo]) => {
5444
+ return /* @__PURE__ */ jsx18("div", { className: "flexlayout__optimized_layout_tab_container", "data-layout-path": "/tab-container", style: containerStyle, children: Array.from(tabs.entries()).map(([nodeId, tabInfo]) => {
6060
5445
  const parent = tabInfo.node.getParent();
6061
5446
  const isMaximized = parent instanceof TabSetNode && parent.isMaximized();
6062
- return /* @__PURE__ */ React20.createElement(
5447
+ return /* @__PURE__ */ jsx18(
6063
5448
  TabPanel,
6064
5449
  {
6065
- key: nodeId,
6066
5450
  nodeId,
6067
5451
  node: tabInfo.node,
6068
5452
  rect: tabInfo.rect,
@@ -6074,14 +5458,15 @@ function TabContainer({
6074
5458
  model,
6075
5459
  isMaximized,
6076
5460
  hasMaximizedTabset
6077
- }
5461
+ },
5462
+ nodeId
6078
5463
  );
6079
- }));
5464
+ }) });
6080
5465
  }
6081
5466
  function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange, onModelChange: userOnModelChange, ...layoutProps }) {
6082
- const [isDragging, setIsDragging] = useState4(false);
6083
- const [tabs, setTabs] = useState4(() => /* @__PURE__ */ new Map());
6084
- const [maximizedTabsetId, setMaximizedTabsetId] = useState4(() => model.getMaximizedTabset(Model.MAIN_WINDOW_ID)?.getId());
5467
+ const [isDragging, setIsDragging] = useState3(false);
5468
+ const [tabs, setTabs] = useState3(() => /* @__PURE__ */ new Map());
5469
+ const [maximizedTabsetId, setMaximizedTabsetId] = useState3(() => model.getMaximizedTabset(Model.MAIN_WINDOW_ID)?.getId());
6085
5470
  const syncTabsWithModel = useCallback(
6086
5471
  (prevTabs) => {
6087
5472
  const modelTabNodes = /* @__PURE__ */ new Map();
@@ -6183,11 +5568,14 @@ function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange,
6183
5568
  );
6184
5569
  const factory = useCallback(
6185
5570
  (node) => {
6186
- return /* @__PURE__ */ React20.createElement(TabRef, { key: node.getId(), node, selected: node.isSelected(), onTabMount: handleTabMount, onRectChange: handleRectChange, onVisibilityChange: handleVisibilityChange });
5571
+ return /* @__PURE__ */ jsx18(TabRef, { node, selected: node.isSelected(), onTabMount: handleTabMount, onRectChange: handleRectChange, onVisibilityChange: handleVisibilityChange }, node.getId());
6187
5572
  },
6188
5573
  [handleTabMount, handleRectChange, handleVisibilityChange]
6189
5574
  );
6190
- return /* @__PURE__ */ React20.createElement("div", { className: "flexlayout__optimized_layout" }, /* @__PURE__ */ React20.createElement(Layout, { model, factory, classNameMapper, onDragStateChange: handleDragStateChange, onModelChange: handleModelChange, ...layoutProps }), /* @__PURE__ */ React20.createElement(TabContainer, { tabs, renderTab, isDragging, classNameMapper, model, maximizedTabsetId }));
5575
+ return /* @__PURE__ */ jsxs9("div", { className: "flexlayout__optimized_layout", children: [
5576
+ /* @__PURE__ */ jsx18(Layout, { model, factory, classNameMapper, onDragStateChange: handleDragStateChange, onModelChange: handleModelChange, ...layoutProps }),
5577
+ /* @__PURE__ */ jsx18(TabContainer, { tabs, renderTab, isDragging, classNameMapper, model, maximizedTabsetId })
5578
+ ] });
6191
5579
  }
6192
5580
 
6193
5581
  // src/model/walk.ts
@@ -6246,7 +5634,6 @@ export {
6246
5634
  ICloseType,
6247
5635
  Layout,
6248
5636
  LayoutInternal,
6249
- LayoutWindow,
6250
5637
  Model,
6251
5638
  Node,
6252
5639
  OptimizedLayout,