flexlayout-react 0.8.16 → 0.8.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,13 +8,13 @@ FlexLayout is a layout manager that arranges React components in multiple tabset
8
8
 
9
9
  ![FlexLayout Demo Screenshot](screenshots/Screenshot_light.png?raw=true "FlexLayout Demo Screenshot")
10
10
 
11
- [Run the Demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/demo/index.html)
11
+ [Run the Demo](https://caplin.github.io/FlexLayout/demos/v0.8/demo/index.html)
12
12
 
13
13
  Try it now using [CodeSandbox](https://codesandbox.io/p/sandbox/yvjzqf)
14
14
 
15
- [API Doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/index.html)
15
+ [API Doc](https://caplin.github.io/FlexLayout/demos/v0.8/typedoc/index.html)
16
16
 
17
- [Screenshot of Caplin Liberator Explorer using FlexLayout](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.20/images/LiberatorExplorerV3_3.PNG)
17
+ [Screenshot of Caplin Liberator Explorer using FlexLayout](https://caplin.github.io/FlexLayout/demos/v0.20/images/LiberatorExplorerV3_3.PNG)
18
18
 
19
19
  FlexLayout's only dependency is React.
20
20
 
@@ -196,7 +196,7 @@ Each type of node has a defined set of requires/optional attributes.
196
196
 
197
197
  Weights on rows and tabsets specify the relative weight of these nodes within the parent row, the actual values do not matter just their relative values (ie two tabsets of weights 30,70 would render the same if they had weights of 3,7).
198
198
 
199
- NOTE: the easiest way to create your initial layout JSON is to use the [demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/demo/index.html) app, modify one of the
199
+ NOTE: the easiest way to create your initial layout JSON is to use the [demo](https://caplin.github.io/FlexLayout/demos/v0.8/demo/index.html) app, modify one of the
200
200
  existing layouts by dragging/dropping and adding nodes then press the 'Show Layout JSON in console' button to print the JSON to the browser developer console.
201
201
 
202
202
  By changing global or node attributes you can change the layout appearance and functionality, for example:
@@ -303,7 +303,7 @@ You apply actions using the `Model.doAction()` method.
303
303
  This method takes a single argument, created by one of the action
304
304
  generators (accessed as `FlexLayout.Actions.<actionName>`):
305
305
 
306
- [Actions doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/classes/Actions.html)
306
+ [Actions doc](https://caplin.github.io/FlexLayout/demos/v0.8/typedoc/classes/Actions.html)
307
307
 
308
308
  ### Examples
309
309
 
@@ -336,7 +336,7 @@ implementing the `onAction` callback property of the `Layout`.
336
336
 
337
337
  There are many optional properties that can be applied to the layout:
338
338
 
339
- [Layout Properties doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/interfaces/ILayoutProps.html)
339
+ [Layout Properties doc](https://caplin.github.io/FlexLayout/demos/v0.8/typedoc/interfaces/ILayoutProps.html)
340
340
 
341
341
 
342
342
  ## JSON Model Definition
@@ -345,29 +345,29 @@ The JSON model is well defined as a set of TypeScript interfaces, see the doc fo
345
345
 
346
346
  ## Model Config Attributes
347
347
 
348
- [Model Attributes doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/interfaces/IJsonModel.html)
348
+ [Model Attributes doc](https://caplin.github.io/FlexLayout/demos/v0.8/typedoc/interfaces/IJsonModel.html)
349
349
 
350
350
  ## Global Config Attributes
351
351
 
352
- [Global Attributes doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/interfaces/IGlobalAttributes.html)
352
+ [Global Attributes doc](https://caplin.github.io/FlexLayout/demos/v0.8/typedoc/interfaces/IGlobalAttributes.html)
353
353
 
354
354
  ## Row Config Attributes
355
355
 
356
- [Row Attributes doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/interfaces/IJsonRowNode.html)
356
+ [Row Attributes doc](https://caplin.github.io/FlexLayout/demos/v0.8/typedoc/interfaces/IJsonRowNode.html)
357
357
 
358
358
  ## TabSet Config Attributes
359
359
 
360
- [Tabset Attributes doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/interfaces/IJsonTabSetNode.html)
360
+ [Tabset Attributes doc](https://caplin.github.io/FlexLayout/demos/v0.8/typedoc/interfaces/IJsonTabSetNode.html)
361
361
 
362
362
  Note: tabsets will be dynamically created as tabs are moved, and deleted when all their tabs are removed (unless enableDeleteWhenEmpty is false).
363
363
 
364
364
  ## Tab Config attributes
365
365
 
366
- [Tab Attributes doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/interfaces/IJsonTabNode.html)
366
+ [Tab Attributes doc](https://caplin.github.io/FlexLayout/demos/v0.8/typedoc/interfaces/IJsonTabNode.html)
367
367
 
368
368
  ## Border Config attributes
369
369
 
370
- [Border Attributes doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/interfaces/IJsonBorderNode.html)
370
+ [Border Attributes doc](https://caplin.github.io/FlexLayout/demos/v0.8/typedoc/interfaces/IJsonBorderNode.html)
371
371
 
372
372
 
373
373
 
@@ -377,7 +377,7 @@ Note: tabsets will be dynamically created as tabs are moved, and deleted when al
377
377
 
378
378
  There are methods on the Layout Component for adding tabs:
379
379
 
380
- [Layout Methods doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/classes/Layout.html)
380
+ [Layout Methods doc](https://caplin.github.io/FlexLayout/demos/v0.8/typedoc/classes/Layout.html)
381
381
 
382
382
  Example:
383
383
 
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * flexlayout-react
3
- * @version 0.8.16
3
+ * @version 0.8.18
4
4
  */
5
5
  var __defProp = Object.defineProperty;
6
6
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -4041,6 +4041,17 @@ const useTabOverflow = (layout, node, orientation, tabStripRef, miniScrollRef, t
4041
4041
  updateScrollMetrics();
4042
4042
  updateHiddenTabs();
4043
4043
  });
4044
+ React.useEffect(() => {
4045
+ var _a;
4046
+ (_a = selfRef.current) == null ? void 0 : _a.addEventListener("wheel", onWheel, { passive: false });
4047
+ return () => {
4048
+ var _a2;
4049
+ (_a2 = selfRef.current) == null ? void 0 : _a2.removeEventListener("wheel", onWheel);
4050
+ };
4051
+ }, [selfRef.current]);
4052
+ const onWheel = (event) => {
4053
+ event.preventDefault();
4054
+ };
4044
4055
  function scrollIntoView() {
4045
4056
  const selectedTabNode = node.getSelectedNode();
4046
4057
  if (selectedTabNode && tabStripRef.current) {
@@ -5585,9 +5596,6 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
5585
5596
  __publicField(this, "isDraggingOverWindow");
5586
5597
  __publicField(this, "styleObserver");
5587
5598
  __publicField(this, "popoutWindowName");
5588
- __publicField(this, "onScroll", () => {
5589
- this.updateRect();
5590
- });
5591
5599
  __publicField(this, "updateLayoutMetrics", () => {
5592
5600
  if (this.findBorderBarSizeRef.current) {
5593
5601
  const borderBarSize = this.findBorderBarSizeRef.current.getBoundingClientRect().height;
@@ -5823,7 +5831,6 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
5823
5831
  if (this.selfRef.current) {
5824
5832
  this.resizeObserver.observe(this.selfRef.current);
5825
5833
  }
5826
- this.currentWindow.addEventListener("scroll", this.onScroll);
5827
5834
  if (this.isMainWindow) {
5828
5835
  this.props.model.addChangeListener(this.onModelChange);
5829
5836
  this.updateLayoutMetrics();
@@ -5871,15 +5878,14 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
5871
5878
  }
5872
5879
  }
5873
5880
  componentWillUnmount() {
5874
- var _a, _b, _c;
5881
+ var _a, _b;
5875
5882
  if (this.selfRef.current) {
5876
5883
  (_a = this.resizeObserver) == null ? void 0 : _a.unobserve(this.selfRef.current);
5877
5884
  }
5878
- (_b = this.currentWindow) == null ? void 0 : _b.removeEventListener("scroll", this.onScroll);
5879
5885
  if (this.isMainWindow) {
5880
5886
  this.props.model.removeChangeListener(this.onModelChange);
5881
5887
  }
5882
- (_c = this.styleObserver) == null ? void 0 : _c.disconnect();
5888
+ (_b = this.styleObserver) == null ? void 0 : _b.disconnect();
5883
5889
  }
5884
5890
  render() {
5885
5891
  if (!this.selfRef.current) {
@@ -6223,7 +6229,11 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
6223
6229
  return this.currentDocument;
6224
6230
  }
6225
6231
  getDomRect() {
6226
- return this.state.rect;
6232
+ if (this.selfRef.current) {
6233
+ return Rect.fromDomRect(this.selfRef.current.getBoundingClientRect());
6234
+ } else {
6235
+ return Rect.empty();
6236
+ }
6227
6237
  }
6228
6238
  getWindowId() {
6229
6239
  return this.windowId;
@@ -6392,7 +6402,7 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
6392
6402
  };
6393
6403
  __publicField(_LayoutInternal, "dragState");
6394
6404
  let LayoutInternal = _LayoutInternal;
6395
- const FlexLayoutVersion = "0.8.16";
6405
+ const FlexLayoutVersion = "0.8.18";
6396
6406
  const defaultIcons = {
6397
6407
  close: /* @__PURE__ */ jsx(CloseIcon, {}),
6398
6408
  closeTabset: /* @__PURE__ */ jsx(CloseIcon, {}),
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "flexlayout-react",
3
- "version": "0.8.16",
3
+ "version": "0.8.18",
4
4
  "description": "A multi-tab docking layout manager",
5
5
  "author": "Caplin Systems Ltd",
6
- "repository": "https://github.com/caplin/FlexLayout",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/caplin/FlexLayout.git"
9
+ },
7
10
  "license": "ISC",
8
- "type":"module",
11
+ "type": "module",
9
12
  "main": "./dist/index.js",
10
13
  "module": "./dist/index.js",
11
14
  "types": "./types/index.d.ts",
@@ -95,4 +98,4 @@
95
98
  "vite": "^6.3.0",
96
99
  "vitest": "^3.1.1"
97
100
  }
98
- }
101
+ }
@@ -160,7 +160,6 @@ export declare class LayoutInternal extends React.Component<ILayoutInternalProps
160
160
  componentDidMount(): void;
161
161
  componentDidUpdate(): void;
162
162
  componentWillUnmount(): void;
163
- onScroll: () => void;
164
163
  render(): import("react/jsx-runtime").JSX.Element;
165
164
  renderBorders(inner: React.ReactNode): import("react/jsx-runtime").JSX.Element;
166
165
  renderLayout(): import("react/jsx-runtime").JSX.Element;