dockview-react 7.0.3 → 8.0.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 (71) hide show
  1. package/LICENCE.md +21 -0
  2. package/README.md +21 -16
  3. package/dist/cjs/dockview/reactContextMenuItemPart.d.ts +10 -3
  4. package/dist/cjs/index.d.ts +2 -2
  5. package/dist/cjs/svg.d.ts +1 -0
  6. package/dist/dockview-react.js +19172 -21736
  7. package/dist/dockview-react.min.js +4142 -22
  8. package/dist/package/main.cjs.js +960 -986
  9. package/dist/package/main.cjs.min.js +6 -6
  10. package/dist/package/main.esm.min.mjs +6 -6
  11. package/dist/package/main.esm.mjs +926 -977
  12. package/dist/styles/dockview.css +3098 -2400
  13. package/package.json +91 -85
  14. package/dist/cjs/dockview/defaultTab.js +0 -99
  15. package/dist/cjs/dockview/dockview.js +0 -285
  16. package/dist/cjs/dockview/headerActionsRenderer.js +0 -86
  17. package/dist/cjs/dockview/reactContentPart.js +0 -52
  18. package/dist/cjs/dockview/reactContextMenuItemPart.js +0 -31
  19. package/dist/cjs/dockview/reactGroupDragGhostPart.js +0 -32
  20. package/dist/cjs/dockview/reactHeaderPart.js +0 -46
  21. package/dist/cjs/dockview/reactTabGroupChipPart.js +0 -36
  22. package/dist/cjs/dockview/reactWatermarkPart.js +0 -47
  23. package/dist/cjs/gridview/gridview.js +0 -105
  24. package/dist/cjs/gridview/view.js +0 -41
  25. package/dist/cjs/index.js +0 -24
  26. package/dist/cjs/paneview/paneview.js +0 -137
  27. package/dist/cjs/paneview/view.js +0 -44
  28. package/dist/cjs/react.js +0 -183
  29. package/dist/cjs/splitview/splitview.js +0 -105
  30. package/dist/cjs/splitview/view.js +0 -39
  31. package/dist/cjs/svg.js +0 -15
  32. package/dist/cjs/types.js +0 -2
  33. package/dist/dockview-react.min.js.map +0 -1
  34. package/dist/esm/dockview/defaultTab.d.ts +0 -7
  35. package/dist/esm/dockview/defaultTab.js +0 -65
  36. package/dist/esm/dockview/dockview.d.ts +0 -33
  37. package/dist/esm/dockview/dockview.js +0 -252
  38. package/dist/esm/dockview/headerActionsRenderer.d.ts +0 -24
  39. package/dist/esm/dockview/headerActionsRenderer.js +0 -72
  40. package/dist/esm/dockview/reactContentPart.d.ts +0 -21
  41. package/dist/esm/dockview/reactContentPart.js +0 -43
  42. package/dist/esm/dockview/reactContextMenuItemPart.d.ts +0 -14
  43. package/dist/esm/dockview/reactContextMenuItemPart.js +0 -22
  44. package/dist/esm/dockview/reactGroupDragGhostPart.d.ts +0 -20
  45. package/dist/esm/dockview/reactGroupDragGhostPart.js +0 -23
  46. package/dist/esm/dockview/reactHeaderPart.d.ts +0 -17
  47. package/dist/esm/dockview/reactHeaderPart.js +0 -37
  48. package/dist/esm/dockview/reactTabGroupChipPart.d.ts +0 -23
  49. package/dist/esm/dockview/reactTabGroupChipPart.js +0 -27
  50. package/dist/esm/dockview/reactWatermarkPart.d.ts +0 -18
  51. package/dist/esm/dockview/reactWatermarkPart.js +0 -38
  52. package/dist/esm/gridview/gridview.d.ts +0 -17
  53. package/dist/esm/gridview/gridview.js +0 -72
  54. package/dist/esm/gridview/view.d.ts +0 -9
  55. package/dist/esm/gridview/view.js +0 -19
  56. package/dist/esm/index.d.ts +0 -10
  57. package/dist/esm/index.js +0 -8
  58. package/dist/esm/paneview/paneview.d.ts +0 -20
  59. package/dist/esm/paneview/paneview.js +0 -104
  60. package/dist/esm/paneview/view.d.ts +0 -19
  61. package/dist/esm/paneview/view.js +0 -35
  62. package/dist/esm/react.d.ts +0 -35
  63. package/dist/esm/react.js +0 -134
  64. package/dist/esm/splitview/splitview.d.ts +0 -17
  65. package/dist/esm/splitview/splitview.js +0 -72
  66. package/dist/esm/splitview/view.d.ts +0 -9
  67. package/dist/esm/splitview/view.js +0 -17
  68. package/dist/esm/svg.d.ts +0 -3
  69. package/dist/esm/svg.js +0 -7
  70. package/dist/esm/types.d.ts +0 -4
  71. package/dist/esm/types.js +0 -1
package/LICENCE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 mathuo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,22 +1,26 @@
1
1
  <div align="center">
2
+
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/dockview/dockview/blob/HEAD/static/img/dockview-lockup-dark.svg?raw=true">
5
+ <img src="https://github.com/dockview/dockview/blob/HEAD/static/img/dockview-lockup-light.svg?raw=true" alt="Dockview" width="480">
6
+ </picture>
7
+
2
8
  <h1>dockview-react</h1>
3
9
 
4
- <p>React bindings for dockview — zero dependency layout manager supporting tabs, groups, grids and splitviews</p>
10
+ <p>React bindings for dockview, a zero dependency layout manager supporting tabs, groups, grids and splitviews</p>
11
+
12
+ [![npm version](https://img.shields.io/npm/v/dockview-react)](https://www.npmjs.com/package/dockview-react)
13
+ [![npm downloads](https://img.shields.io/npm/dm/dockview-react)](https://www.npmjs.com/package/dockview-react)
14
+ [![CI](https://img.shields.io/github/actions/workflow/status/dockview/dockview/main.yml?branch=master&label=CI)](https://github.com/dockview/dockview/actions?query=workflow%3ACI)
15
+ [![Coverage](https://img.shields.io/sonar/coverage/dockview_dockview?server=https%3A%2F%2Fsonarcloud.io)](https://sonarcloud.io/summary/overall?id=dockview_dockview)
16
+ [![Quality gate](https://img.shields.io/sonar/quality_gate/dockview_dockview?server=https%3A%2F%2Fsonarcloud.io)](https://sonarcloud.io/summary/overall?id=dockview_dockview)
17
+ [![Bundle size](https://img.shields.io/bundlephobia/minzip/dockview-react?label=size)](https://bundlephobia.com/result?p=dockview-react)
5
18
 
6
19
  </div>
7
20
 
8
21
  ---
9
22
 
10
- [![npm version](https://badge.fury.io/js/dockview-react.svg)](https://www.npmjs.com/package/dockview-react)
11
- [![npm](https://img.shields.io/npm/dm/dockview-react)](https://www.npmjs.com/package/dockview-react)
12
- [![CI Build](https://github.com/mathuo/dockview/workflows/CI/badge.svg)](https://github.com/mathuo/dockview/actions?query=workflow%3ACI)
13
- [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=mathuo_dockview&metric=coverage)](https://sonarcloud.io/summary/overall?id=mathuo_dockview)
14
- [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mathuo_dockview&metric=alert_status)](https://sonarcloud.io/summary/overall?id=mathuo_dockview)
15
- [![Bundle Phobia](https://badgen.net/bundlephobia/minzip/dockview-react)](https://bundlephobia.com/result?p=dockview-react)
16
-
17
- ##
18
-
19
- ![](https://github.com/mathuo/dockview/blob/HEAD/packages/docs/static/img/splashscreenv2.png?raw=true)
23
+ ![A Dockview layout showing docked, tabbed and split panels in a trading workbench](https://github.com/dockview/dockview/blob/HEAD/static/img/demo-hero.webp?raw=true)
20
24
 
21
25
  Please see the website: https://dockview.dev
22
26
 
@@ -36,11 +40,11 @@ Please see the website: https://dockview.dev
36
40
  - High test coverage
37
41
  - Documentation website with live examples
38
42
  - Transparent builds and Code Analysis
39
- - Security at mind - verified publishing and builds through GitHub Actions
43
+ - Security in mind - verified publishing and builds through GitHub Actions
40
44
 
41
45
  ## Quick Start
42
46
 
43
- Dockview has a peer dependency on `react >= 16.8.0` and `react-dom >= 16.8.0`. Install from [npm](https://www.npmjs.com/package/dockview-react):
47
+ Dockview has a peer dependency on `react` and `react-dom`, versions 16.8 to 19. Install from [npm](https://www.npmjs.com/package/dockview-react):
44
48
 
45
49
  ```
46
50
  npm install dockview-react
@@ -52,10 +56,10 @@ Import the stylesheet:
52
56
  @import 'dockview-react/dist/styles/dockview.css';
53
57
  ```
54
58
 
55
- Apply a theme and render the component:
59
+ Pass a theme and render the component:
56
60
 
57
61
  ```tsx
58
- import { DockviewReact } from 'dockview-react';
62
+ import { DockviewReact, themeDark } from 'dockview-react';
59
63
 
60
64
  const components = {
61
65
  myComponent: (props) => <div>Hello World</div>,
@@ -63,8 +67,9 @@ const components = {
63
67
 
64
68
  function App() {
65
69
  return (
66
- <div className="dockview-theme-dark" style={{ height: '400px' }}>
70
+ <div style={{ height: '400px' }}>
67
71
  <DockviewReact
72
+ theme={themeDark}
68
73
  components={components}
69
74
  onReady={(event) => {
70
75
  event.api.addPanel({
@@ -1,6 +1,12 @@
1
1
  import React from 'react';
2
2
  import { ReactPortalStore } from '../react';
3
- import { IContextMenuItemRenderer, IContextMenuItemComponentProps } from 'dockview';
3
+ import { IContextMenuItemRenderer, IContextMenuItemComponentProps, IChipContextMenuItemComponentProps } from 'dockview';
4
+ /**
5
+ * The same renderer serves both the tab context menu (props carry a `panel`)
6
+ * and the tab group chip context menu (props carry a `tabGroup`), so it accepts
7
+ * either prop shape.
8
+ */
9
+ type ContextMenuItemProps = IContextMenuItemComponentProps | IChipContextMenuItemComponentProps;
4
10
  export declare class ReactContextMenuItemPart implements IContextMenuItemRenderer {
5
11
  readonly id: string;
6
12
  private readonly component;
@@ -8,7 +14,8 @@ export declare class ReactContextMenuItemPart implements IContextMenuItemRendere
8
14
  private readonly _element;
9
15
  private part?;
10
16
  get element(): HTMLElement;
11
- constructor(id: string, component: React.FunctionComponent<IContextMenuItemComponentProps>, reactPortalStore: ReactPortalStore);
12
- init(props: IContextMenuItemComponentProps): void;
17
+ constructor(id: string, component: React.FunctionComponent<ContextMenuItemProps>, reactPortalStore: ReactPortalStore);
18
+ init(props: ContextMenuItemProps): void;
13
19
  dispose(): void;
14
20
  }
21
+ export {};
@@ -1,8 +1,8 @@
1
1
  export * from 'dockview';
2
2
  export * from './dockview/dockview';
3
3
  export * from './dockview/defaultTab';
4
- export { IDockviewTabGroupChipProps } from './dockview/reactTabGroupChipPart';
5
- export { IDockviewGroupDragGhostProps } from './dockview/reactGroupDragGhostPart';
4
+ export { type IDockviewTabGroupChipProps } from './dockview/reactTabGroupChipPart';
5
+ export { type IDockviewGroupDragGhostProps } from './dockview/reactGroupDragGhostPart';
6
6
  export * from './splitview/splitview';
7
7
  export * from './gridview/gridview';
8
8
  export * from './paneview/paneview';
package/dist/cjs/svg.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
2
  export declare const CloseButton: () => React.JSX.Element;
3
+ export declare const PinButton: () => React.JSX.Element;
3
4
  export declare const ExpandMore: () => React.JSX.Element;