@aptre/flex-layout 0.2.1 → 0.2.2

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 (58) hide show
  1. package/dist/index.mjs +260 -52
  2. package/dist/model/Utils.d.ts +1 -1
  3. package/package.json +7 -4
  4. package/tsconfig.json +1 -0
  5. package/typedoc/assets/main.js +2 -2
  6. package/typedoc/assets/style.css +35 -15
  7. package/typedoc/classes/Action.html +1 -1
  8. package/typedoc/classes/Actions.html +1 -1
  9. package/typedoc/classes/BorderNode.html +2 -2
  10. package/typedoc/classes/BorderSet.html +1 -1
  11. package/typedoc/classes/DockLocation.html +1 -1
  12. package/typedoc/classes/DragDrop.html +1 -1
  13. package/typedoc/classes/DropInfo.html +1 -1
  14. package/typedoc/classes/Layout.html +13 -13
  15. package/typedoc/classes/Model.html +1 -1
  16. package/typedoc/classes/Node.html +2 -2
  17. package/typedoc/classes/Orientation.html +1 -1
  18. package/typedoc/classes/Rect.html +1 -1
  19. package/typedoc/classes/RowNode.html +2 -2
  20. package/typedoc/classes/SplitterNode.html +2 -2
  21. package/typedoc/classes/TabNode.html +3 -3
  22. package/typedoc/classes/TabSetNode.html +2 -2
  23. package/typedoc/enums/CLASSES.html +1 -1
  24. package/typedoc/enums/I18nLabel.html +1 -1
  25. package/typedoc/enums/ICloseType.html +1 -1
  26. package/typedoc/hierarchy.html +1 -0
  27. package/typedoc/index.html +1 -1
  28. package/typedoc/interfaces/IBorderAttributes.html +2 -2
  29. package/typedoc/interfaces/ICustomDropDestination.html +2 -2
  30. package/typedoc/interfaces/IDraggable.html +1 -1
  31. package/typedoc/interfaces/IDropTarget.html +1 -1
  32. package/typedoc/interfaces/IFontValues.html +2 -2
  33. package/typedoc/interfaces/IGlobalAttributes.html +2 -2
  34. package/typedoc/interfaces/IIcons.html +2 -2
  35. package/typedoc/interfaces/IJsonBorderNode.html +2 -2
  36. package/typedoc/interfaces/IJsonModel.html +2 -2
  37. package/typedoc/interfaces/IJsonRowNode.html +2 -2
  38. package/typedoc/interfaces/IJsonTabNode.html +2 -2
  39. package/typedoc/interfaces/IJsonTabSetNode.html +2 -2
  40. package/typedoc/interfaces/ILayoutProps.html +2 -2
  41. package/typedoc/interfaces/ILayoutState.html +2 -2
  42. package/typedoc/interfaces/IRowAttributes.html +2 -2
  43. package/typedoc/interfaces/ITabAttributes.html +2 -2
  44. package/typedoc/interfaces/ITabRenderValues.html +2 -2
  45. package/typedoc/interfaces/ITabSetAttributes.html +2 -2
  46. package/typedoc/interfaces/ITabSetRenderValues.html +2 -2
  47. package/typedoc/interfaces/ITitleObject.html +2 -2
  48. package/typedoc/types/CustomDragCallback.html +1 -1
  49. package/typedoc/types/DragRectRenderCallback.html +1 -1
  50. package/typedoc/types/FloatingTabPlaceholderRenderCallback.html +1 -1
  51. package/typedoc/types/IBorderLocation.html +1 -1
  52. package/typedoc/types/IInsets.html +1 -1
  53. package/typedoc/types/ITabLocation.html +1 -1
  54. package/typedoc/types/IconFactory.html +1 -1
  55. package/typedoc/types/NodeMouseEvent.html +1 -1
  56. package/typedoc/types/ShowOverflowMenuCallback.html +1 -1
  57. package/typedoc/types/TabSetPlaceHolderCallback.html +1 -1
  58. package/typedoc/types/TitleFactory.html +1 -1
package/dist/index.mjs CHANGED
@@ -41,7 +41,7 @@ var Rect = class _Rect {
41
41
  this.height = height;
42
42
  }
43
43
  static fromElement(element) {
44
- let { x, y, width, height } = element.getBoundingClientRect();
44
+ const { x, y, width, height } = element.getBoundingClientRect();
45
45
  return new _Rect(x, y, width, height);
46
46
  }
47
47
  clone() {
@@ -768,7 +768,7 @@ var AttributeDefinitions = class {
768
768
  }
769
769
  update(jsonObj, obj) {
770
770
  for (const attr of this.attributes) {
771
- if (jsonObj.hasOwnProperty(attr.name)) {
771
+ if (attr.name in jsonObj) {
772
772
  const fromValue = jsonObj[attr.name];
773
773
  if (fromValue === void 0) {
774
774
  delete obj[attr.name];
@@ -801,7 +801,7 @@ var AttributeDefinitions = class {
801
801
  defaultValue = attr.defaultValue;
802
802
  type = attr.type;
803
803
  }
804
- let defValue = JSON.stringify(defaultValue);
804
+ const defValue = JSON.stringify(defaultValue);
805
805
  const required = attr.required || attr.fixed ? "" : "?";
806
806
  if (c.fixed) {
807
807
  lines.push(" " + c.name + ": " + defValue + ";");
@@ -1193,15 +1193,6 @@ var SplitterNode = class _SplitterNode extends Node {
1193
1193
 
1194
1194
  // src/model/TabNode.ts
1195
1195
  var TabNode = class _TabNode extends Node {
1196
- /** @internal */
1197
- constructor(model, json, addToModel = true) {
1198
- super(model);
1199
- this._extra = {};
1200
- _TabNode._attributeDefinitions.fromJson(json, this._attributes);
1201
- if (addToModel === true) {
1202
- model._addNode(this);
1203
- }
1204
- }
1205
1196
  static {
1206
1197
  this.TYPE = "tab";
1207
1198
  }
@@ -1239,6 +1230,15 @@ var TabNode = class _TabNode extends Node {
1239
1230
  attributeDefinitions.addInherited("borderHeight", "tabBorderHeight").setType(Attribute.NUMBER);
1240
1231
  return attributeDefinitions;
1241
1232
  }
1233
+ /** @internal */
1234
+ constructor(model, json, addToModel = true) {
1235
+ super(model);
1236
+ this._extra = {};
1237
+ _TabNode._attributeDefinitions.fromJson(json, this._attributes);
1238
+ if (addToModel === true) {
1239
+ model._addNode(this);
1240
+ }
1241
+ }
1242
1242
  getWindow() {
1243
1243
  return this._window;
1244
1244
  }
@@ -1374,18 +1374,217 @@ var TabNode = class _TabNode extends Node {
1374
1374
  }
1375
1375
  };
1376
1376
 
1377
+ // node_modules/layerr/dist/error.js
1378
+ function assertError(err) {
1379
+ if (!isError(err)) {
1380
+ throw new Error("Parameter was not an error");
1381
+ }
1382
+ }
1383
+ function isError(err) {
1384
+ return objectToString(err) === "[object Error]" || err instanceof Error;
1385
+ }
1386
+ function objectToString(obj) {
1387
+ return Object.prototype.toString.call(obj);
1388
+ }
1389
+
1390
+ // node_modules/layerr/dist/tools.js
1391
+ function parseArguments(args) {
1392
+ let options, shortMessage = "";
1393
+ if (args.length === 0) {
1394
+ options = {};
1395
+ } else if (isError(args[0])) {
1396
+ options = {
1397
+ cause: args[0]
1398
+ };
1399
+ shortMessage = args.slice(1).join(" ") || "";
1400
+ } else if (args[0] && typeof args[0] === "object") {
1401
+ options = Object.assign({}, args[0]);
1402
+ shortMessage = args.slice(1).join(" ") || "";
1403
+ } else if (typeof args[0] === "string") {
1404
+ options = {};
1405
+ shortMessage = shortMessage = args.join(" ") || "";
1406
+ } else {
1407
+ throw new Error("Invalid arguments passed to Layerr");
1408
+ }
1409
+ return {
1410
+ options,
1411
+ shortMessage
1412
+ };
1413
+ }
1414
+
1415
+ // node_modules/layerr/dist/layerr.js
1416
+ var Layerr = class _Layerr extends Error {
1417
+ constructor(errorOptionsOrMessage, messageText) {
1418
+ const args = [...arguments];
1419
+ const { options, shortMessage } = parseArguments(args);
1420
+ let message = shortMessage;
1421
+ if (options.cause) {
1422
+ message = `${message}: ${options.cause.message}`;
1423
+ }
1424
+ super(message);
1425
+ this.message = message;
1426
+ if (options.name && typeof options.name === "string") {
1427
+ this.name = options.name;
1428
+ } else {
1429
+ this.name = "Layerr";
1430
+ }
1431
+ if (options.cause) {
1432
+ Object.defineProperty(this, "_cause", { value: options.cause });
1433
+ }
1434
+ Object.defineProperty(this, "_info", { value: {} });
1435
+ if (options.info && typeof options.info === "object") {
1436
+ Object.assign(this._info, options.info);
1437
+ }
1438
+ if (Error.captureStackTrace) {
1439
+ const ctor = options.constructorOpt || this.constructor;
1440
+ Error.captureStackTrace(this, ctor);
1441
+ }
1442
+ }
1443
+ static cause(err) {
1444
+ assertError(err);
1445
+ if (!err._cause)
1446
+ return null;
1447
+ return isError(err._cause) ? err._cause : null;
1448
+ }
1449
+ static fullStack(err) {
1450
+ assertError(err);
1451
+ const cause = _Layerr.cause(err);
1452
+ if (cause) {
1453
+ return `${err.stack}
1454
+ caused by: ${_Layerr.fullStack(cause)}`;
1455
+ }
1456
+ return err.stack;
1457
+ }
1458
+ static info(err) {
1459
+ assertError(err);
1460
+ const output = {};
1461
+ const cause = _Layerr.cause(err);
1462
+ if (cause) {
1463
+ Object.assign(output, _Layerr.info(cause));
1464
+ }
1465
+ if (err._info) {
1466
+ Object.assign(output, err._info);
1467
+ }
1468
+ return output;
1469
+ }
1470
+ cause() {
1471
+ return _Layerr.cause(this);
1472
+ }
1473
+ toString() {
1474
+ let output = this.name || this.constructor.name || this.constructor.prototype.name;
1475
+ if (this.message) {
1476
+ output = `${output}: ${this.message}`;
1477
+ }
1478
+ return output;
1479
+ }
1480
+ };
1481
+
1482
+ // node_modules/ulidx/dist/browser/index.js
1483
+ var ENCODING = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
1484
+ var ENCODING_LEN = 32;
1485
+ var TIME_MAX = 281474976710655;
1486
+ var TIME_LEN = 10;
1487
+ var RANDOM_LEN = 16;
1488
+ var ERROR_INFO = Object.freeze({
1489
+ source: "ulid"
1490
+ });
1491
+ function detectPRNG(root) {
1492
+ const rootLookup = root || detectRoot();
1493
+ const globalCrypto = rootLookup && (rootLookup.crypto || rootLookup.msCrypto) || null;
1494
+ if (typeof globalCrypto?.getRandomValues === "function") {
1495
+ return () => {
1496
+ const buffer = new Uint8Array(1);
1497
+ globalCrypto.getRandomValues(buffer);
1498
+ return buffer[0] / 255;
1499
+ };
1500
+ } else if (typeof globalCrypto?.randomBytes === "function") {
1501
+ return () => globalCrypto.randomBytes(1).readUInt8() / 255;
1502
+ } else
1503
+ ;
1504
+ throw new Layerr({
1505
+ info: {
1506
+ code: "PRNG_DETECT",
1507
+ ...ERROR_INFO
1508
+ }
1509
+ }, "Failed to find a reliable PRNG");
1510
+ }
1511
+ function detectRoot() {
1512
+ if (inWebWorker())
1513
+ return self;
1514
+ if (typeof window !== "undefined") {
1515
+ return window;
1516
+ }
1517
+ if (typeof global !== "undefined") {
1518
+ return global;
1519
+ }
1520
+ if (typeof globalThis !== "undefined") {
1521
+ return globalThis;
1522
+ }
1523
+ return null;
1524
+ }
1525
+ function encodeRandom(len, prng) {
1526
+ let str = "";
1527
+ for (; len > 0; len--) {
1528
+ str = randomChar(prng) + str;
1529
+ }
1530
+ return str;
1531
+ }
1532
+ function encodeTime(now, len) {
1533
+ if (isNaN(now)) {
1534
+ throw new Layerr({
1535
+ info: {
1536
+ code: "ENC_TIME_NAN",
1537
+ ...ERROR_INFO
1538
+ }
1539
+ }, `Time must be a number: ${now}`);
1540
+ } else if (now > TIME_MAX) {
1541
+ throw new Layerr({
1542
+ info: {
1543
+ code: "ENC_TIME_SIZE_EXCEED",
1544
+ ...ERROR_INFO
1545
+ }
1546
+ }, `Cannot encode a time larger than ${TIME_MAX}: ${now}`);
1547
+ } else if (now < 0) {
1548
+ throw new Layerr({
1549
+ info: {
1550
+ code: "ENC_TIME_NEG",
1551
+ ...ERROR_INFO
1552
+ }
1553
+ }, `Time must be positive: ${now}`);
1554
+ } else if (Number.isInteger(now) === false) {
1555
+ throw new Layerr({
1556
+ info: {
1557
+ code: "ENC_TIME_TYPE",
1558
+ ...ERROR_INFO
1559
+ }
1560
+ }, `Time must be an integer: ${now}`);
1561
+ }
1562
+ let mod, str = "";
1563
+ for (let currentLen = len; currentLen > 0; currentLen--) {
1564
+ mod = now % ENCODING_LEN;
1565
+ str = ENCODING.charAt(mod) + str;
1566
+ now = (now - mod) / ENCODING_LEN;
1567
+ }
1568
+ return str;
1569
+ }
1570
+ function inWebWorker() {
1571
+ return typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope;
1572
+ }
1573
+ function randomChar(prng) {
1574
+ let rand = Math.floor(prng() * ENCODING_LEN);
1575
+ if (rand === ENCODING_LEN) {
1576
+ rand = ENCODING_LEN - 1;
1577
+ }
1578
+ return ENCODING.charAt(rand);
1579
+ }
1580
+ function ulid(seedTime, prng) {
1581
+ const currentPRNG = prng || detectPRNG();
1582
+ const seed = isNaN(seedTime) ? Date.now() : seedTime;
1583
+ return encodeTime(seed, TIME_LEN) + encodeRandom(RANDOM_LEN, currentPRNG);
1584
+ }
1585
+
1377
1586
  // src/model/RowNode.ts
1378
1587
  var RowNode = class _RowNode extends Node {
1379
- /** @internal */
1380
- constructor(model, json) {
1381
- super(model);
1382
- this._dirty = true;
1383
- this._drawChildren = [];
1384
- this._minHeight = 0;
1385
- this._minWidth = 0;
1386
- _RowNode._attributeDefinitions.fromJson(json, this._attributes);
1387
- model._addNode(this);
1388
- }
1389
1588
  static {
1390
1589
  this.TYPE = "row";
1391
1590
  }
@@ -1419,6 +1618,16 @@ var RowNode = class _RowNode extends Node {
1419
1618
  attributeDefinitions.add("height", void 0).setType(Attribute.NUMBER);
1420
1619
  return attributeDefinitions;
1421
1620
  }
1621
+ /** @internal */
1622
+ constructor(model, json) {
1623
+ super(model);
1624
+ this._dirty = true;
1625
+ this._drawChildren = [];
1626
+ this._minHeight = 0;
1627
+ this._minWidth = 0;
1628
+ _RowNode._attributeDefinitions.fromJson(json, this._attributes);
1629
+ model._addNode(this);
1630
+ }
1422
1631
  getWeight() {
1423
1632
  return this._attributes.weight;
1424
1633
  }
@@ -1838,14 +2047,6 @@ var RowNode = class _RowNode extends Node {
1838
2047
 
1839
2048
  // src/model/TabSetNode.ts
1840
2049
  var TabSetNode = class _TabSetNode extends Node {
1841
- /** @internal */
1842
- constructor(model, json) {
1843
- super(model);
1844
- _TabSetNode._attributeDefinitions.fromJson(json, this._attributes);
1845
- model._addNode(this);
1846
- this._calculatedTabBarHeight = 0;
1847
- this._calculatedHeaderBarHeight = 0;
1848
- }
1849
2050
  static {
1850
2051
  this.TYPE = "tabset";
1851
2052
  }
@@ -1904,6 +2105,14 @@ var TabSetNode = class _TabSetNode extends Node {
1904
2105
  attributeDefinitions.addInherited("autoSelectTab", "tabSetAutoSelectTab").setType(Attribute.BOOLEAN);
1905
2106
  return attributeDefinitions;
1906
2107
  }
2108
+ /** @internal */
2109
+ constructor(model, json) {
2110
+ super(model);
2111
+ _TabSetNode._attributeDefinitions.fromJson(json, this._attributes);
2112
+ model._addNode(this);
2113
+ this._calculatedTabBarHeight = 0;
2114
+ this._calculatedHeaderBarHeight = 0;
2115
+ }
1907
2116
  getName() {
1908
2117
  return this._getAttr("name");
1909
2118
  }
@@ -2301,7 +2510,7 @@ function adjustSelectedIndex(parent, removedIndex) {
2301
2510
  }
2302
2511
  }
2303
2512
  function randomUUID() {
2304
- return ("10000000-1000-4000-8000" + -1e11).replace(/[018]/g, (c) => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16));
2513
+ return ulid();
2305
2514
  }
2306
2515
 
2307
2516
  // src/model/BorderNode.ts
@@ -2743,7 +2952,7 @@ function getRenderStateEx(layout, node, iconFactory, titleFactory, iconAngle) {
2743
2952
  leadingContent = /* @__PURE__ */ React.createElement("img", { style: { width: "1em", height: "1em" }, src: node.getIcon(), alt: "leadingContent" });
2744
2953
  }
2745
2954
  }
2746
- let buttons = [];
2955
+ const buttons = [];
2747
2956
  const renderState = { leading: leadingContent, content: titleContent, name, buttons };
2748
2957
  layout.customizeTab(node, renderState);
2749
2958
  node._setRenderedName(renderState.name);
@@ -2925,9 +3134,9 @@ var TabButtonStamp = (props) => {
2925
3134
  const { layout, node, iconFactory, titleFactory } = props;
2926
3135
  const selfRef = React3.useRef(null);
2927
3136
  const cm = layout.getClassName;
2928
- let classNames = cm("flexlayout__tab_button_stamp" /* FLEXLAYOUT__TAB_BUTTON_STAMP */);
3137
+ const classNames = cm("flexlayout__tab_button_stamp" /* FLEXLAYOUT__TAB_BUTTON_STAMP */);
2929
3138
  const renderState = getRenderStateEx(layout, node, iconFactory, titleFactory);
2930
- let content = renderState.content ? /* @__PURE__ */ React3.createElement("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */) }, renderState.content) : node._getNameForOverflowMenu();
3139
+ const content = renderState.content ? /* @__PURE__ */ React3.createElement("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */) }, renderState.content) : node._getNameForOverflowMenu();
2931
3140
  const leading = renderState.leading ? /* @__PURE__ */ React3.createElement("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */) }, renderState.leading) : null;
2932
3141
  return /* @__PURE__ */ React3.createElement("div", { ref: selfRef, className: classNames, title: node.getHelpText() }, leading, content);
2933
3142
  };
@@ -3068,7 +3277,7 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
3068
3277
  tabsTruncated.current = false;
3069
3278
  }
3070
3279
  const nodeRect = node instanceof TabSetNode ? node.getRect() : node.getTabHeaderRect();
3071
- let lastChild = node.getChildren()[node.getChildren().length - 1];
3280
+ const lastChild = node.getChildren()[node.getChildren().length - 1];
3072
3281
  const stickyButtonsSize = stickyButtonsRef.current === null ? 0 : getSize(stickyButtonsRef.current.getBoundingClientRect());
3073
3282
  if (firstRender.current === true || lastHiddenCount.current === 0 && hiddenTabs.length !== 0 || nodeRect.width !== lastRect.current.width || // incase rect changed between first render and second
3074
3283
  nodeRect.height !== lastRect.current.height) {
@@ -3183,8 +3392,8 @@ var BorderTabSet = (props) => {
3183
3392
  let style2 = border.getTabHeaderRect().styleWithPosition({});
3184
3393
  const tabs = [];
3185
3394
  const layoutTab = (i) => {
3186
- let isSelected = border.getSelected() === i;
3187
- let child = border.getChildren()[i];
3395
+ const isSelected = border.getSelected() === i;
3396
+ const child = border.getChildren()[i];
3188
3397
  tabs.push(
3189
3398
  /* @__PURE__ */ React6.createElement(
3190
3399
  BorderButton,
@@ -3213,7 +3422,7 @@ var BorderTabSet = (props) => {
3213
3422
  borderClasses += " " + border.getClassName();
3214
3423
  }
3215
3424
  let buttons = [];
3216
- let stickyButtons = [];
3425
+ const stickyButtons = [];
3217
3426
  const renderState = { headerContent: void 0, buttons, stickyButtons, headerButtons: [], overflowPosition: void 0 };
3218
3427
  layout.customizeTabSet(border, renderState);
3219
3428
  buttons = renderState.buttons;
@@ -3412,7 +3621,7 @@ var Splitter = (props) => {
3412
3621
  return rtn;
3413
3622
  };
3414
3623
  const cm = layout.getClassName;
3415
- let r = node.getRect();
3624
+ const r = node.getRect();
3416
3625
  const style2 = r.styleWithPosition({
3417
3626
  cursor: node.getOrientation() === Orientation.HORZ ? "ns-resize" : "ew-resize"
3418
3627
  });
@@ -3428,7 +3637,7 @@ var Splitter = (props) => {
3428
3637
  if (extra === 0) {
3429
3638
  return /* @__PURE__ */ React7.createElement("div", { style: style2, "data-layout-path": path, className, onTouchStart: onMouseDown, onMouseDown });
3430
3639
  } else {
3431
- let r2 = r.clone();
3640
+ const r2 = r.clone();
3432
3641
  r2.x = 0;
3433
3642
  r2.y = 0;
3434
3643
  if (node.getOrientation() === Orientation.VERT) {
@@ -3609,7 +3818,7 @@ var TabButton = (props) => {
3609
3818
  const cm = layout.getClassName;
3610
3819
  const parentNode = node.getParent();
3611
3820
  const isStretch = parentNode.isEnableSingleTabStretch() && parentNode.getChildren().length === 1;
3612
- let baseClassName = isStretch ? "flexlayout__tab_button_stretch" /* FLEXLAYOUT__TAB_BUTTON_STRETCH */ : "flexlayout__tab_button" /* FLEXLAYOUT__TAB_BUTTON */;
3821
+ const baseClassName = isStretch ? "flexlayout__tab_button_stretch" /* FLEXLAYOUT__TAB_BUTTON_STRETCH */ : "flexlayout__tab_button" /* FLEXLAYOUT__TAB_BUTTON */;
3613
3822
  let classNames = cm(baseClassName);
3614
3823
  classNames += " " + cm(baseClassName + "_" + parentNode.getTabLocation());
3615
3824
  if (!isStretch) {
@@ -3779,7 +3988,7 @@ var TabSet = (props) => {
3779
3988
  if (node.isEnableTabStrip()) {
3780
3989
  for (let i = 0; i < node.getChildren().length; i++) {
3781
3990
  const child = node.getChildren()[i];
3782
- let isSelected = node.getSelected() === i;
3991
+ const isSelected = node.getSelected() === i;
3783
3992
  tabs.push(/* @__PURE__ */ React11.createElement(TabButton, { layout, node: child, path: path + "/tb" + i, key: child.getId(), selected: isSelected, iconFactory, titleFactory, icons }));
3784
3993
  if (i < node.getChildren().length - 1) {
3785
3994
  tabs.push(/* @__PURE__ */ React11.createElement("div", { key: "divider" + i, className: cm("flexlayout__tabset_tab_divider" /* FLEXLAYOUT__TABSET_TAB_DIVIDER */) }));
@@ -3922,7 +4131,6 @@ var TabSet = (props) => {
3922
4131
  buttons
3923
4132
  );
3924
4133
  let header;
3925
- let tabStrip;
3926
4134
  let tabStripClasses = cm("flexlayout__tabset_tabbar_outer" /* FLEXLAYOUT__TABSET_TABBAR_OUTER */);
3927
4135
  if (node.getClassNameTabStrip() !== void 0) {
3928
4136
  tabStripClasses += " " + node.getClassNameTabStrip();
@@ -3982,7 +4190,7 @@ var TabSet = (props) => {
3982
4190
  );
3983
4191
  }
3984
4192
  const tabStripStyle = { height: node.getTabStripHeight() + "px" };
3985
- tabStrip = /* @__PURE__ */ React11.createElement(
4193
+ const tabStrip = /* @__PURE__ */ React11.createElement(
3986
4194
  "div",
3987
4195
  {
3988
4196
  className: tabStripClasses,
@@ -4005,7 +4213,7 @@ var TabSet = (props) => {
4005
4213
  toolbar
4006
4214
  );
4007
4215
  style2 = layout.styleFont(style2);
4008
- var placeHolder = void 0;
4216
+ let placeHolder = void 0;
4009
4217
  if (node.getChildren().length === 0) {
4010
4218
  const placeHolderCallback = layout.getTabSetPlaceHolderCallback();
4011
4219
  if (placeHolderCallback) {
@@ -4013,7 +4221,7 @@ var TabSet = (props) => {
4013
4221
  }
4014
4222
  }
4015
4223
  const center = /* @__PURE__ */ React11.createElement("div", { className: cm("flexlayout__tabset_content" /* FLEXLAYOUT__TABSET_CONTENT */) }, placeHolder);
4016
- var content;
4224
+ let content;
4017
4225
  if (node.getTabLocation() === "top") {
4018
4226
  content = /* @__PURE__ */ React11.createElement(React11.Fragment, null, header, tabStrip, center);
4019
4227
  } else {
@@ -4474,7 +4682,7 @@ var Layout = class extends React16.Component {
4474
4682
  this.dragDiv.style.visibility = "visible";
4475
4683
  }
4476
4684
  }
4477
- let dropInfo = this.props.model._findDropTargetNode(this.dragNode, pos.x, pos.y);
4685
+ const dropInfo = this.props.model._findDropTargetNode(this.dragNode, pos.x, pos.y);
4478
4686
  if (dropInfo) {
4479
4687
  if (this.props.onTabDrag) {
4480
4688
  this.handleCustomTabDrag(dropInfo, pos, event);
@@ -4770,10 +4978,10 @@ var Layout = class extends React16.Component {
4770
4978
  let tabCount = 0;
4771
4979
  for (const child of drawChildren) {
4772
4980
  if (child instanceof SplitterNode) {
4773
- let path = borderPath + "/s";
4981
+ const path = borderPath + "/s";
4774
4982
  splitterComponents.push(/* @__PURE__ */ React16.createElement(Splitter, { key: child.getId(), layout: this, node: child, path }));
4775
4983
  } else if (child instanceof TabNode) {
4776
- let path = borderPath + "/t" + tabCount++;
4984
+ const path = borderPath + "/t" + tabCount++;
4777
4985
  if (this.supportsPopout && child.isFloating()) {
4778
4986
  const rect = this._getScreenRect(child);
4779
4987
  const tabBorderWidth = child._getAttr("borderWidth");
@@ -5565,12 +5773,12 @@ var Model = class _Model {
5565
5773
  * @returns {IJsonModel} json object that represents this model
5566
5774
  */
5567
5775
  toJson() {
5568
- const global = {};
5569
- _Model._attributeDefinitions.toJson(global, this._attributes);
5776
+ const global2 = {};
5777
+ _Model._attributeDefinitions.toJson(global2, this._attributes);
5570
5778
  this.visitNodes((node) => {
5571
5779
  node._fireEvent("save", void 0);
5572
5780
  });
5573
- return { global, borders: this._borders._toJson(), layout: this._root.toJson() };
5781
+ return { global: global2, borders: this._borders._toJson(), layout: this._root.toJson() };
5574
5782
  }
5575
5783
  getSplitterSize() {
5576
5784
  let splitterSize = this._attributes.splitterSize;
@@ -1 +1 @@
1
- export declare function randomUUID(): any;
1
+ export declare function randomUUID(): string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@aptre/flex-layout",
3
3
  "author": "Caplin Systems Ltd",
4
4
  "description": "A multi-tab docking layout manager",
5
- "version": "0.2.1",
5
+ "version": "0.2.2",
6
6
  "license": "ISC",
7
7
  "repository": {
8
8
  "type": "git",
@@ -72,16 +72,19 @@
72
72
  "react": "^18.0.0",
73
73
  "react-dom": "^18.0.0"
74
74
  },
75
- "eslintConfig": {
76
- "extends": "react-app"
75
+ "dependencies": {
76
+ "ulidx": "^2.2.1"
77
77
  },
78
- "dependencies": {},
79
78
  "devDependencies": {
80
79
  "@types/node": "^20.8.7",
81
80
  "@types/prismjs": "^1.26.0",
82
81
  "@types/react": "^18.2.31",
83
82
  "@types/react-dom": "^18.0.1",
83
+ "@typescript-eslint/eslint-plugin": "^6.15.0",
84
+ "@typescript-eslint/parser": "^6.15.0",
84
85
  "esbuild": "^0.19.5",
86
+ "eslint": "^8.56.0",
87
+ "eslint-plugin-react": "^7.33.2",
85
88
  "prettier": "^3.0.0",
86
89
  "prismjs": "^1.28.0",
87
90
  "react": "^18.0.0",
package/tsconfig.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "sourceMap": true,
5
5
  "noImplicitAny": true,
6
6
  "module": "ES6",
7
+ "moduleResolution": "node",
7
8
  "target": "ES6",
8
9
  "stripInternal": true,
9
10
  "alwaysStrict": true,