flexlayout-react 0.6.8 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +104 -0
  2. package/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. package/ChangeLog.txt +10 -0
  4. package/README.md +19 -8
  5. package/declarations/view/Icons.d.ts +0 -1
  6. package/declarations/view/Layout.d.ts +5 -3
  7. package/dist/flexlayout.js +9 -9
  8. package/dist/flexlayout.js.zip +0 -0
  9. package/dist/flexlayout_min.js +1 -1
  10. package/dist/flexlayout_min.js.zip +0 -0
  11. package/lib/PopupMenu.js.map +1 -1
  12. package/lib/index.js +5 -1
  13. package/lib/index.js.map +1 -1
  14. package/lib/model/Node.js +13 -8
  15. package/lib/model/Node.js.map +1 -1
  16. package/lib/model/TabSetNode.js +4 -1
  17. package/lib/model/TabSetNode.js.map +1 -1
  18. package/lib/view/BorderTabSet.js +1 -1
  19. package/lib/view/BorderTabSet.js.map +1 -1
  20. package/lib/view/ErrorBoundary.js.map +1 -1
  21. package/lib/view/Layout.js +7 -5
  22. package/lib/view/Layout.js.map +1 -1
  23. package/lib/view/TabOverflowHook.js +1 -1
  24. package/lib/view/TabOverflowHook.js.map +1 -1
  25. package/lib/view/TabSet.js +6 -1
  26. package/lib/view/TabSet.js.map +1 -1
  27. package/lib/view/Utils.js.map +1 -1
  28. package/package.json +18 -20
  29. package/src/PopupMenu.tsx +5 -5
  30. package/src/model/Node.ts +11 -7
  31. package/src/model/TabSetNode.ts +4 -1
  32. package/src/view/BorderButton.tsx +3 -3
  33. package/src/view/BorderTabSet.tsx +4 -4
  34. package/src/view/ErrorBoundary.tsx +1 -0
  35. package/src/view/Layout.tsx +12 -8
  36. package/src/view/TabButton.tsx +3 -3
  37. package/src/view/TabButtonStamp.tsx +3 -3
  38. package/src/view/TabOverflowHook.tsx +1 -1
  39. package/src/view/TabSet.tsx +8 -4
  40. package/src/view/Utils.tsx +3 -3
  41. package/style/dark.css +2 -2
  42. package/style/gray.css +2 -2
  43. package/style/light.css +2 -2
  44. package/style/underline.css +2 -2
@@ -0,0 +1,104 @@
1
+ name: '🐛 Bug report'
2
+ description: Create a report to help us improve
3
+ body:
4
+ - type: markdown
5
+ attributes:
6
+ value: |
7
+ Thank you for reporting an issue :pray:.
8
+
9
+ This issue tracker is for reporting bugs found in `FlexLayout` (https://github.com/caplin/FlexLayout).
10
+ If you have a question about how to achieve something and are struggling, please post a question
11
+ inside of `FlexLayout` Discussions tab: https://github.com/caplin/FlexLayout/discussions
12
+
13
+ Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already:
14
+ - `FlexLayout` Issues tab: https://github.com/caplin/FlexLayout/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
15
+ - `FlexLayout` closed issues tab: https://github.com/caplin/FlexLayout/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed
16
+ - `FlexLayout` Discussions tab: https://github.com/caplin/FlexLayout/discussions
17
+
18
+ The more information you fill in, the better the community can help you.
19
+ - type: textarea
20
+ id: description
21
+ attributes:
22
+ label: Describe the bug
23
+ description: Provide a clear and concise description of the challenge you are running into.
24
+ validations:
25
+ required: true
26
+ - type: input
27
+ id: link
28
+ attributes:
29
+ label: Your Example Website or App
30
+ description: |
31
+ Which website or app were you using when the bug happened?
32
+ Note:
33
+ - Your bug will may get fixed much faster if we can run your code and it doesn't have dependencies other than the `FlexLayout` npm package.
34
+ - To create a shareable code example you can use Stackblitz (https://stackblitz.com/). Please no localhost URLs.
35
+ - Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
36
+ placeholder: |
37
+ e.g. https://stackblitz.com/edit/...... OR Github Repo
38
+ validations:
39
+ required: false
40
+ - type: textarea
41
+ id: steps
42
+ attributes:
43
+ label: Steps to Reproduce the Bug or Issue
44
+ description: Describe the steps we have to take to reproduce the behavior.
45
+ placeholder: |
46
+ 1. Go to '...'
47
+ 2. Click on '....'
48
+ 3. Scroll down to '....'
49
+ 4. See error
50
+ validations:
51
+ required: true
52
+ - type: textarea
53
+ id: expected
54
+ attributes:
55
+ label: Expected behavior
56
+ description: Provide a clear and concise description of what you expected to happen.
57
+ placeholder: |
58
+ As a user, I expected ___ behavior, but I am seeing ___
59
+ validations:
60
+ required: true
61
+ - type: input
62
+ id: os
63
+ attributes:
64
+ label: Operating System
65
+ description: What opearting system are you using?
66
+ placeholder: |
67
+ - OS: [e.g. macOS, Windows, Linux]
68
+ validations:
69
+ required: true
70
+ - type: input
71
+ id: browsers
72
+ attributes:
73
+ label: Browser Type?
74
+ description: What browsers are you seeing the problem on?
75
+ placeholder: |
76
+ - OS: [e.g. Google Chrome, Safari, Firefox, Opera etc]
77
+ validations:
78
+ required: true
79
+ - type: input
80
+ id: browser_version
81
+ attributes:
82
+ label: Browser Version
83
+ description: What browser version are you using?
84
+ placeholder: |
85
+ - Version: [e.g. 91.1]
86
+ validations:
87
+ required: true
88
+ - type: textarea
89
+ id: screenshots_or_videos
90
+ attributes:
91
+ label: Screenshots or Videos
92
+ description: |
93
+ If applicable, add screenshots or a video to help explain your problem.
94
+ For more information on the supported file image/file types and the file size limits, please refer
95
+ to the following link: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files
96
+ placeholder: |
97
+ You can drag your video or image files inside of this editor ↓
98
+ validations:
99
+ required: true
100
+ - type: textarea
101
+ id: additional
102
+ attributes:
103
+ label: Additional context
104
+ description: Add any other context about the problem here.
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: 🤔 Feature Requests & Questions
4
+ url: https://github.com/caplin/FlexLayout/discussions
5
+ about: Please ask and answer questions here.
package/ChangeLog.txt CHANGED
@@ -1,3 +1,13 @@
1
+ 0.7.0
2
+ Updated dependencies, in particular changed React peer dependency to React 18
3
+ Made changes for React 18
4
+
5
+ 0.6.10
6
+ fix for #312, chrome warning for wheel event listener
7
+
8
+ 0.6.9
9
+ fix for #308, Allow dragging within a maximized tabset
10
+
1
11
  0.6.8
2
12
  Added onTabSetPlaceHolder prop to render the tabset area when there are no tabs.
3
13
 
package/README.md CHANGED
@@ -8,11 +8,11 @@ FlexLayout is a layout manager that arranges React components in multiple tab se
8
8
 
9
9
  ![FlexLayout Demo Screenshot](/../screenshots/github_images/v0.5/demo1.png?raw=true "FlexLayout Demo Screenshot")
10
10
 
11
- [Run the Demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.6/demo/index.html)
11
+ [Run the Demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.7/demo/index.html)
12
12
 
13
- Try it now using [JSFiddle](https://jsfiddle.net/18zfp0qm/)
13
+ Try it now using [JSFiddle](https://jsfiddle.net/10kmLzvu/)
14
14
 
15
- [API Doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.6/typedoc/index.html)
15
+ [API Doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.7/typedoc/index.html)
16
16
 
17
17
  [Screenshot of Caplin Liberator Explorer using FlexLayout](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.20/images/LiberatorExplorerV3_3.PNG)
18
18
 
@@ -55,7 +55,7 @@ Import React and FlexLayout in your modules:
55
55
 
56
56
  ```
57
57
  import * as React from "react";
58
- import * as ReactDOM from "react-dom";
58
+ import { createRoot } from "react-dom/client";
59
59
  import * as FlexLayout from "flexlayout-react";
60
60
  ```
61
61
 
@@ -161,7 +161,7 @@ var json = {
161
161
 
162
162
  ```
163
163
  import * as React from "react";
164
- import * as ReactDOM from "react-dom";
164
+ import { createRoot } from "react-dom/client";
165
165
  import * as FlexLayout from "flexlayout-react";
166
166
 
167
167
  class Main extends React.Component {
@@ -185,13 +185,15 @@ class Main extends React.Component {
185
185
  }
186
186
  }
187
187
 
188
- ReactDOM.render(<Main/>, document.getElementById("container"));
188
+ const container = document.getElementById("container");
189
+ const root = createRoot(container);
190
+ root.render(<Main/>);
189
191
  ```
190
192
  (See the examples for full source code)
191
193
 
192
194
  The above code would render two tabsets horizontally each containing a single tab that hosts a button component. The tabs could be moved and resized by dragging and dropping. Additional grids could be added to the layout by sending actions to the model.
193
195
 
194
- Try it now using [JSFiddle](https://jsfiddle.net/18zfp0qm/)
196
+ Try it now using [JSFiddle](https://jsfiddle.net/10kmLzvu/)
195
197
 
196
198
  A simple Create React App (CRA) example (using typescript) can be found here:
197
199
 
@@ -219,7 +221,7 @@ The model json contains 3 top level elements:
219
221
 
220
222
  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).
221
223
 
222
- NOTE: the easiest way to create your initial layout JSON is to use the [demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.6/demo/index.html) app, modify one of the
224
+ NOTE: the easiest way to create your initial layout JSON is to use the [demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.7/demo/index.html) app, modify one of the
223
225
  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.
224
226
 
225
227
 
@@ -611,5 +613,14 @@ yarn cypress
611
613
 
612
614
  To build the npm distribution run 'yarn build', this will create the artifacts in the dist dir.
613
615
 
616
+ ## Alternative Layout Managers
617
+
618
+ | Name | Repository |
619
+ | ------------- |:-------------|
620
+ | rc-dock | https://github.com/ticlo/rc-dock |
621
+ | lumino | https://github.com/jupyterlab/lumino |
622
+ | golden-layout | https://github.com/golden-layout/golden-layout |
623
+ | react-mosaic | https://github.com/nomcopter/react-mosaic |
624
+
614
625
 
615
626
 
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const CloseIcon: () => JSX.Element;
3
2
  export declare const MaximizeIcon: () => JSX.Element;
4
3
  export declare const OverflowIcon: () => JSX.Element;
@@ -21,13 +21,15 @@ export declare type ShowOverflowMenuCallback = (node: TabSetNode | BorderNode, m
21
21
  node: TabNode;
22
22
  }) => void) => void;
23
23
  export declare type TabSetPlaceHolderCallback = (node: TabSetNode) => React.ReactNode;
24
+ export declare type IconFactory = (node: TabNode) => React.ReactNode;
25
+ export declare type TitleFactory = (node: TabNode) => ITitleObject | React.ReactNode;
24
26
  export interface ILayoutProps {
25
27
  model: Model;
26
28
  factory: (node: TabNode) => React.ReactNode;
27
29
  font?: IFontValues;
28
30
  fontFamily?: string;
29
- iconFactory?: (node: TabNode) => React.ReactNode | undefined;
30
- titleFactory?: (node: TabNode) => ITitleObject | React.ReactNode | undefined;
31
+ iconFactory?: IconFactory;
32
+ titleFactory?: TitleFactory;
31
33
  icons?: IIcons;
32
34
  onAction?: (action: Action) => Action | undefined;
33
35
  onRenderTab?: (node: TabNode, renderValues: ITabRenderValues) => void;
@@ -89,7 +91,7 @@ export interface ILayoutState {
89
91
  calculatedBorderBarSize: number;
90
92
  editingTab?: TabNode;
91
93
  showHiddenBorder: DockLocation;
92
- portal?: React.ReactNode;
94
+ portal?: React.ReactPortal;
93
95
  }
94
96
  export interface IIcons {
95
97
  close?: (React.ReactNode | ((tabNode: TabNode) => React.ReactNode));