@vuu-ui/vuu-shell 3.3.10 → 4.0.0-alpha.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 (78) hide show
  1. package/package.json +18 -16
  2. package/src/app-header/AppHeader.js +36 -26
  3. package/src/application-provider/ApplicationContext.js +2 -5
  4. package/src/application-provider/ApplicationProvider.js +8 -59
  5. package/src/feature/Feature.js +3 -34
  6. package/src/feature/index.js +1 -0
  7. package/src/feature-list/FeatureList.css.js +27 -5
  8. package/src/feature-list/FeatureList.js +117 -96
  9. package/src/index.js +3 -3
  10. package/src/left-nav/LeftNav.css.js +2 -4
  11. package/src/left-nav/LeftNav.js +139 -100
  12. package/src/module-registry/getRegisteredModules.js +12 -0
  13. package/src/persistence-manager/LocalWorkspacePersistenceService.js +129 -0
  14. package/src/persistence-manager/PersistenceProvider.js +10 -3
  15. package/src/persistence-manager/RemoteWorkspacePersistenceService.js +112 -0
  16. package/src/persistence-manager/WorkspacePersistenceService.js +9 -0
  17. package/src/persistence-manager/index.js +3 -0
  18. package/src/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.js +24 -0
  19. package/src/shell-layout-templates/context-panel/ContextPanel.css.js +8 -8
  20. package/src/shell-layout-templates/context-panel/ContextPanel.js +17 -35
  21. package/src/shell-layout-templates/context-panel/index.js +1 -0
  22. package/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +54 -40
  23. package/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +54 -64
  24. package/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +49 -28
  25. package/src/shell-layout-templates/side-panel/SidePanel.css.js +3 -1
  26. package/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +43 -35
  27. package/src/shell.css.js +85 -2
  28. package/src/shell.js +148 -70
  29. package/src/workspace-management/LayoutList.js +59 -99
  30. package/src/workspace-management/SaveLayoutPanel.js +3 -3
  31. package/src/workspace-management/WorkspaceController.js +73 -0
  32. package/src/workspace-management/WorkspaceHost.js +194 -0
  33. package/src/workspace-management/WorkspacePersistentState.js +67 -0
  34. package/src/workspace-management/WorkspaceProvider.js +699 -178
  35. package/src/workspace-management/WorkspaceRepository.js +127 -0
  36. package/src/workspace-management/WorkspaceStartPanel.css.js +44 -0
  37. package/src/workspace-management/WorkspaceStartPanel.js +34 -0
  38. package/src/workspace-management/index.js +8 -0
  39. package/src/workspace-management/shell-workspace-components.js +59 -0
  40. package/src/workspace-management/useWorkspaceContextMenuItems.js +12 -6
  41. package/src/workspace-management/workspace-component-registry.js +30 -0
  42. package/src/workspace-management/workspace-schemas.js +257 -0
  43. package/types/app-header/AppHeader.d.ts +2 -2
  44. package/types/application-provider/ApplicationContext.d.ts +1 -6
  45. package/types/application-provider/ApplicationProvider.d.ts +5 -14
  46. package/types/feature/Feature.d.ts +2 -10
  47. package/types/feature/Loader.d.ts +1 -1
  48. package/types/feature/index.d.ts +2 -1
  49. package/types/feature-list/FeatureList.d.ts +4 -4
  50. package/types/index.d.ts +3 -3
  51. package/types/left-nav/LeftNav.d.ts +2 -1
  52. package/types/login/LoginPanel.d.ts +1 -1
  53. package/types/login/VuuLogo.d.ts +1 -1
  54. package/types/persistence-manager/PersistenceProvider.d.ts +7 -3
  55. package/types/persistence-manager/index.d.ts +3 -0
  56. package/types/shell-layout-templates/context-panel/ContextPanel.d.ts +9 -11
  57. package/types/shell-layout-templates/context-panel/index.d.ts +1 -0
  58. package/types/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +1 -1
  59. package/types/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +1 -1
  60. package/types/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +1 -1
  61. package/types/shell-layout-templates/side-panel/SidePanel.d.ts +1 -1
  62. package/types/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +1 -1
  63. package/types/shell-layout-templates/useShellLayout.d.ts +4 -2
  64. package/types/shell.d.ts +19 -15
  65. package/types/theme-switch/ThemeSwitch.d.ts +1 -1
  66. package/types/workspace-management/LayoutList.d.ts +2 -2
  67. package/types/workspace-management/LayoutTile.d.ts +1 -1
  68. package/types/workspace-management/SaveLayoutPanel.d.ts +2 -2
  69. package/types/workspace-management/WorkspaceProvider.d.ts +61 -50
  70. package/types/workspace-management/defaultWorkspaceJSON.d.ts +7 -6
  71. package/types/workspace-management/index.d.ts +8 -0
  72. package/types/workspace-management/useWorkspaceContextMenuItems.d.ts +1 -1
  73. package/src/feature/FeatureErrorBoundary.js +0 -33
  74. package/src/user-settings/SettingsForm.css.js +0 -10
  75. package/src/user-settings/SettingsForm.js +0 -141
  76. package/src/user-settings/UserSettingsPanel.css.js +0 -9
  77. package/src/user-settings/UserSettingsPanel.js +0 -29
  78. package/src/user-settings/index.js +0 -2
@@ -2,29 +2,30 @@ const css = `
2
2
  .vuuContextPanel {
3
3
  --header-height: var(--vuuContextPanel-header-height, 48px);
4
4
  background: var(--vuuContextPanel-background, var(--salt-container-primary-background));
5
+ width: var(--vuu-side-panel-width, 0px);
5
6
  z-index: 1;
6
7
  transition: width .3s ease-in-out;
7
8
  position: relative;
8
- width: var(--vuu-side-panel-width, 0px) !important;
9
9
  }
10
10
 
11
11
  .vuuContextPanel-expanded {
12
+ --vuu-side-panel-width: var(--vuuContextPanel-width, 300px);
12
13
  --vuu-side-panel-shadow: -4px 4px 4px #0000001a;
13
14
  --vuu-side-panel-padding: var(--vuuContextPanel-padding, 24px);
14
- --vuu-side-panel-width: var(--vuuContextPanel-width, 300px) !important;
15
15
 
16
- & .vuuView.vuuContextPanel-inner {
16
+ & .vuuContextPanel-inner {
17
17
  padding: 24px 8px 24px 18px;
18
18
  }
19
19
  }
20
20
 
21
21
  .vuuContextPanel-overlay {
22
- width: 0 !important;
22
+ width: 0;
23
23
  }
24
24
 
25
- .vuuView.vuuContextPanel-inner {
25
+ .vuuContextPanel-inner {
26
26
  background-color: inherit;
27
27
  box-shadow: var(--vuu-side-panel-shadow, none);
28
+ min-width: 0;
28
29
  height: 100%;
29
30
  width: var(--vuu-side-panel-width, 0px);
30
31
  flex-direction: column;
@@ -32,19 +33,18 @@ const css = `
32
33
  transition-duration: .3s;
33
34
  transition-timing-function: ease-in-out;
34
35
  display: flex;
36
+ position: absolute;
35
37
  top: 0;
36
38
  right: 0;
37
39
  overflow: auto;
38
- min-width: 0 !important;
39
- position: absolute !important;
40
40
  }
41
41
 
42
42
  .vuuContextPanel-header {
43
43
  flex-wrap: nowrap;
44
+ flex: 0 0 var(--header-height);
44
45
  justify-content: space-between;
45
46
  align-items: center;
46
47
  display: flex;
47
- flex: 0 0 var(--header-height) !important;
48
48
  }
49
49
 
50
50
  .vuuContextPanel-title {
@@ -1,14 +1,12 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { View, layoutFromJson, useLayoutProviderDispatch } from "@vuu-ui/vuu-layout";
3
- import { IconButton, useHideContextPanel } from "@vuu-ui/vuu-ui-controls";
4
- import { VuuShellLocation } from "@vuu-ui/vuu-utils";
5
2
  import { useComponentCssInjection } from "@salt-ds/styles";
6
3
  import { useWindow } from "@salt-ds/window";
4
+ import { IconButton, useHideContextPanel } from "@vuu-ui/vuu-ui-controls";
7
5
  import clsx from "clsx";
8
- import react, { useCallback, useLayoutEffect, useMemo, useRef } from "react";
6
+ import { useCallback, useLayoutEffect, useRef } from "react";
9
7
  import ContextPanel from "./ContextPanel.css";
10
8
  const classBase = "vuuContextPanel";
11
- const ContextPanel_ContextPanel = ({ className: classNameProp, expanded = false, content: contentProp, id, onClose, overlay = false, title })=>{
9
+ const ContextPanel_ContextPanel = ({ className, content, expanded = false, id, onClose, overlay = false, title })=>{
12
10
  const targetWindow = useWindow();
13
11
  useComponentCssInjection({
14
12
  testId: "vuu-context-panel",
@@ -17,49 +15,33 @@ const ContextPanel_ContextPanel = ({ className: classNameProp, expanded = false,
17
15
  });
18
16
  const hideContextPanel = useHideContextPanel();
19
17
  const closeButtonRef = useRef(null);
20
- const dispatchLayoutAction = useLayoutProviderDispatch();
21
18
  const handleClose = useCallback(()=>{
22
- if (hideContextPanel) hideContextPanel();
23
- else dispatchLayoutAction({
24
- path: `#${VuuShellLocation.ContextPanel}`,
25
- propName: "expanded",
26
- propValue: false,
27
- type: "set-prop"
28
- });
19
+ hideContextPanel?.();
20
+ onClose?.();
29
21
  }, [
30
- dispatchLayoutAction,
31
- hideContextPanel
22
+ hideContextPanel,
23
+ onClose
32
24
  ]);
33
- const handleKeyDown = useCallback((e)=>{
34
- if ("Escape" === e.key) handleClose();
25
+ const handleKeyDown = useCallback((event)=>{
26
+ if ("Escape" === event.key) handleClose();
35
27
  }, [
36
28
  handleClose
37
29
  ]);
38
- const className = clsx(classBase, classNameProp, {
39
- [`${classBase}-expanded`]: expanded,
40
- [`${classBase}-inline`]: true !== overlay,
41
- [`${classBase}-overlay`]: overlay
42
- });
43
- const content = useMemo(()=>contentProp && expanded ? /*#__PURE__*/ react.isValidElement(contentProp) ? contentProp : layoutFromJson(contentProp, "context-0") : null, [
44
- contentProp,
45
- expanded
46
- ]);
47
30
  useLayoutEffect(()=>{
48
31
  if (expanded) closeButtonRef.current?.focus();
49
- else onClose?.();
50
32
  }, [
51
- expanded,
52
- onClose
33
+ expanded
53
34
  ]);
54
35
  return /*#__PURE__*/ jsx("div", {
55
36
  className: clsx(classBase, className, "vuuScrollable", {
56
- [`${classBase}-expanded`]: expanded
37
+ [`${classBase}-expanded`]: expanded,
38
+ [`${classBase}-inline`]: !overlay,
39
+ [`${classBase}-overlay`]: overlay
57
40
  }),
58
41
  id: id,
59
- children: /*#__PURE__*/ jsxs(View, {
42
+ onKeyDown: handleKeyDown,
43
+ children: /*#__PURE__*/ jsxs("div", {
60
44
  className: `${classBase}-inner`,
61
- header: false,
62
- id: id,
63
45
  children: [
64
46
  /*#__PURE__*/ jsxs("div", {
65
47
  className: `${classBase}-header`,
@@ -70,11 +52,11 @@ const ContextPanel_ContextPanel = ({ className: classNameProp, expanded = false,
70
52
  }),
71
53
  /*#__PURE__*/ jsx(IconButton, {
72
54
  appearance: "transparent",
55
+ "aria-label": "Close context panel",
73
56
  className: `${classBase}-close`,
74
57
  "data-embedded": true,
75
58
  icon: "close",
76
59
  onClick: handleClose,
77
- onKeyDown: handleKeyDown,
78
60
  ref: closeButtonRef,
79
61
  sentiment: "neutral",
80
62
  size: 16
@@ -83,7 +65,7 @@ const ContextPanel_ContextPanel = ({ className: classNameProp, expanded = false,
83
65
  }),
84
66
  /*#__PURE__*/ jsx("div", {
85
67
  className: `${classBase}-content`,
86
- children: content
68
+ children: expanded ? content : null
87
69
  })
88
70
  ]
89
71
  })
@@ -1 +1,2 @@
1
1
  export * from "./ContextPanel.js";
2
+ export * from "./ApplicationSettingsContextPanel.js";
@@ -1,44 +1,58 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Flexbox, LayoutContainer } from "@vuu-ui/vuu-layout";
3
- import { VuuShellLocation } from "@vuu-ui/vuu-utils";
4
- import { ContextPanel } from "../context-panel/index.js";
2
+ import { GridLayout, GridLayoutItem } from "@heswell/grid-layout";
3
+ import { ApplicationSettingsContextPanel } from "../context-panel/index.js";
5
4
  import { SidePanel } from "../side-panel/index.js";
6
- import { useMemo } from "react";
7
- const useFullHeightLeftPanel = ({ appHeader, SidePanelProps: LeftSidePanelProps, htmlAttributes })=>useMemo(()=>/*#__PURE__*/ jsxs(Flexbox, {
8
- ...htmlAttributes,
9
- style: {
10
- ...htmlAttributes?.style,
11
- flexDirection: "row"
12
- },
13
- children: [
14
- /*#__PURE__*/ jsx(SidePanel, {
15
- ...LeftSidePanelProps,
16
- id: VuuShellLocation.SidePanel
17
- }),
18
- /*#__PURE__*/ jsxs(Flexbox, {
19
- className: "vuuShell-content",
20
- style: {
21
- flex: 1,
22
- flexDirection: "column"
23
- },
24
- children: [
25
- appHeader,
26
- /*#__PURE__*/ jsx(LayoutContainer, {
27
- id: VuuShellLocation.WorkspaceContainer,
28
- style: {
29
- flex: 1
30
- }
31
- }, "main-content")
32
- ]
33
- }),
34
- /*#__PURE__*/ jsx(ContextPanel, {
35
- id: VuuShellLocation.ContextPanel,
36
- overlay: true
37
- })
5
+ const useFullHeightLeftPanel = ({ appHeader, SidePanelProps, htmlAttributes, workspaceHost })=>{
6
+ const { onChange: _onChange, ...gridAttributes } = htmlAttributes ?? {};
7
+ return /*#__PURE__*/ jsxs(GridLayout, {
8
+ ...gridAttributes,
9
+ className: `${htmlAttributes?.className ?? ""} vuuShell-staticGrid`,
10
+ colsAndRows: {
11
+ cols: [
12
+ `${SidePanelProps?.sizeOpen ?? 200}px`,
13
+ "1fr",
14
+ "0px"
15
+ ],
16
+ rows: [
17
+ "40px",
18
+ "1fr"
38
19
  ]
39
- }), [
40
- LeftSidePanelProps,
41
- appHeader,
42
- htmlAttributes
43
- ]);
20
+ },
21
+ id: "vuu-shell-grid",
22
+ children: [
23
+ /*#__PURE__*/ jsx(GridLayoutItem, {
24
+ id: "vuu-shell-left-nav",
25
+ style: {
26
+ gridArea: "1/1/3/2"
27
+ },
28
+ children: /*#__PURE__*/ jsx(SidePanel, {
29
+ ...SidePanelProps,
30
+ id: "vuu-side-panel"
31
+ })
32
+ }),
33
+ /*#__PURE__*/ jsx(GridLayoutItem, {
34
+ id: "vuu-shell-header",
35
+ style: {
36
+ gridArea: "1/2/2/3"
37
+ },
38
+ children: appHeader
39
+ }),
40
+ /*#__PURE__*/ jsx(GridLayoutItem, {
41
+ className: "vuuShell-content",
42
+ id: "vuu-shell-workspace-host",
43
+ style: {
44
+ gridArea: "2/2/3/3"
45
+ },
46
+ children: workspaceHost
47
+ }),
48
+ /*#__PURE__*/ jsx(GridLayoutItem, {
49
+ id: "vuu-shell-context",
50
+ style: {
51
+ gridArea: "1/3/3/4"
52
+ },
53
+ children: /*#__PURE__*/ jsx(ApplicationSettingsContextPanel, {})
54
+ })
55
+ ]
56
+ });
57
+ };
44
58
  export { useFullHeightLeftPanel };
@@ -1,68 +1,58 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { DockLayout, Drawer, Flexbox, LayoutContainer, View } from "@vuu-ui/vuu-layout";
3
- import { VuuShellLocation } from "@vuu-ui/vuu-utils";
4
- import { useCallback, useMemo, useRef, useState } from "react";
5
- const useInlayLeftPanel = ({ SidePanelProps: LeftSidePanelProps, appHeader, htmlAttributes })=>{
6
- const paletteView = useRef(null);
7
- const [open, setOpen] = useState(true);
8
- const handleDrawerClick = useCallback((e)=>{
9
- const target = e.target;
10
- if (!paletteView.current?.contains(target)) setOpen(!open);
11
- }, [
12
- open
13
- ]);
14
- return useMemo(()=>{
15
- const getDrawers = (leftSidePanel)=>{
16
- const drawers = [];
17
- drawers.push(/*#__PURE__*/ jsx(Drawer, {
18
- onClick: handleDrawerClick,
19
- open: open,
20
- position: "left",
21
- inline: true,
22
- peekaboo: true,
23
- sizeOpen: 200,
24
- toggleButton: "end",
25
- children: /*#__PURE__*/ jsx(View, {
26
- className: "vuuShell-palette",
27
- id: "vw-app-palette",
28
- ref: paletteView,
29
- style: {
30
- height: "100%"
31
- },
32
- children: leftSidePanel
33
- }, "app-palette")
34
- }, "left-panel"));
35
- return drawers;
36
- };
37
- return /*#__PURE__*/ jsxs(Flexbox, {
38
- ...htmlAttributes,
39
- style: {
40
- ...htmlAttributes?.style,
41
- flexDirection: "column"
42
- },
43
- children: [
44
- appHeader,
45
- /*#__PURE__*/ jsx(DockLayout, {
46
- style: {
47
- flex: 1
48
- },
49
- children: getDrawers(LeftSidePanelProps?.children).concat(/*#__PURE__*/ jsx(LayoutContainer, {
50
- dropTarget: true,
51
- id: VuuShellLocation.WorkspaceContainer,
52
- style: {
53
- width: "100%",
54
- height: "100%"
55
- }
56
- }, "main-content"))
57
- })
2
+ import { GridLayout, GridLayoutItem } from "@heswell/grid-layout";
3
+ import { SidePanel } from "../side-panel/index.js";
4
+ import { ApplicationSettingsContextPanel } from "../context-panel/index.js";
5
+ const useInlayLeftPanel = ({ SidePanelProps, appHeader, htmlAttributes, workspaceHost })=>{
6
+ const { onChange: _onChange, ...gridAttributes } = htmlAttributes ?? {};
7
+ return /*#__PURE__*/ jsxs(GridLayout, {
8
+ ...gridAttributes,
9
+ className: `${htmlAttributes?.className ?? ""} vuuShell-staticGrid`,
10
+ colsAndRows: {
11
+ cols: [
12
+ `${SidePanelProps?.sizeOpen ?? 200}px`,
13
+ "1fr",
14
+ "0px"
15
+ ],
16
+ rows: [
17
+ "40px",
18
+ "1fr"
58
19
  ]
59
- });
60
- }, [
61
- LeftSidePanelProps,
62
- appHeader,
63
- handleDrawerClick,
64
- htmlAttributes,
65
- open
66
- ]);
20
+ },
21
+ id: "vuu-shell-grid",
22
+ children: [
23
+ /*#__PURE__*/ jsx(GridLayoutItem, {
24
+ id: "vuu-shell-header",
25
+ style: {
26
+ gridArea: "1/1/2/3"
27
+ },
28
+ children: appHeader
29
+ }),
30
+ /*#__PURE__*/ jsx(GridLayoutItem, {
31
+ id: "vuu-shell-left-nav",
32
+ style: {
33
+ gridArea: "2/1/3/2"
34
+ },
35
+ children: /*#__PURE__*/ jsx(SidePanel, {
36
+ ...SidePanelProps,
37
+ id: "vuu-side-panel"
38
+ })
39
+ }),
40
+ /*#__PURE__*/ jsx(GridLayoutItem, {
41
+ className: "vuuShell-content",
42
+ id: "vuu-shell-workspace-host",
43
+ style: {
44
+ gridArea: "2/2/3/3"
45
+ },
46
+ children: workspaceHost
47
+ }),
48
+ /*#__PURE__*/ jsx(GridLayoutItem, {
49
+ id: "vuu-shell-context",
50
+ style: {
51
+ gridArea: "1/3/3/4"
52
+ },
53
+ children: /*#__PURE__*/ jsx(ApplicationSettingsContextPanel, {})
54
+ })
55
+ ]
56
+ });
67
57
  };
68
58
  export { useInlayLeftPanel };
@@ -1,32 +1,53 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Flexbox, StackLayout } from "@vuu-ui/vuu-layout";
3
- import { VuuShellLocation } from "@vuu-ui/vuu-utils";
4
- import { useMemo } from "react";
5
- const useLeftMainTabs = ({ appHeader, htmlAttributes, ToolbarProps })=>{
6
- if (void 0 === ToolbarProps) throw Error("LeftMainTabs layout requires ToolbarProps");
7
- return useMemo(()=>/*#__PURE__*/ jsxs(Flexbox, {
8
- ...htmlAttributes,
9
- style: {
10
- ...htmlAttributes?.style,
11
- flexDirection: "column"
12
- },
13
- children: [
14
- appHeader,
15
- /*#__PURE__*/ jsx(StackLayout, {
16
- TabstripProps: {
17
- className: `${VuuShellLocation.MultiWorkspaceContainer}-tabs`
18
- },
19
- active: 0,
20
- showTabs: "left",
21
- style: {
22
- flex: 1
23
- },
24
- id: VuuShellLocation.MultiWorkspaceContainer
25
- })
2
+ import { GridLayout, GridLayoutItem } from "@heswell/grid-layout";
3
+ import { ApplicationSettingsContextPanel } from "../context-panel/index.js";
4
+ const useLeftMainTabs = ({ appHeader, htmlAttributes, ToolbarProps, workspaceHost })=>{
5
+ const { onChange: _onChange, ...gridAttributes } = htmlAttributes ?? {};
6
+ return /*#__PURE__*/ jsxs(GridLayout, {
7
+ ...gridAttributes,
8
+ className: `${htmlAttributes?.className ?? ""} vuuShell-staticGrid`,
9
+ colsAndRows: {
10
+ cols: [
11
+ `${ToolbarProps?.width ?? 48}px`,
12
+ "1fr",
13
+ "0px"
14
+ ],
15
+ rows: [
16
+ "40px",
17
+ "1fr"
26
18
  ]
27
- }), [
28
- appHeader,
29
- htmlAttributes
30
- ]);
19
+ },
20
+ id: "vuu-shell-grid",
21
+ children: [
22
+ /*#__PURE__*/ jsx(GridLayoutItem, {
23
+ id: "vuu-shell-header",
24
+ style: {
25
+ gridArea: "1/1/2/3"
26
+ },
27
+ children: appHeader
28
+ }),
29
+ /*#__PURE__*/ jsx(GridLayoutItem, {
30
+ id: "vuu-shell-toolbar",
31
+ style: {
32
+ gridArea: "2/1/3/2"
33
+ },
34
+ children: ToolbarProps?.children
35
+ }),
36
+ /*#__PURE__*/ jsx(GridLayoutItem, {
37
+ id: "vuu-shell-workspace-host",
38
+ style: {
39
+ gridArea: "2/2/3/3"
40
+ },
41
+ children: workspaceHost
42
+ }),
43
+ /*#__PURE__*/ jsx(GridLayoutItem, {
44
+ id: "vuu-shell-context",
45
+ style: {
46
+ gridArea: "1/3/3/4"
47
+ },
48
+ children: /*#__PURE__*/ jsx(ApplicationSettingsContextPanel, {})
49
+ })
50
+ ]
51
+ });
31
52
  };
32
53
  export { useLeftMainTabs };
@@ -1,6 +1,8 @@
1
1
  const css = `
2
2
  .vuuShellSidePanel {
3
- width: var(--shell-left-nav-size);
3
+ height: 100%;
4
+ min-width: var(--shell-left-nav-size);
5
+ width: auto;
4
6
  transition: width .2s ease-out;
5
7
  }
6
8
 
@@ -1,38 +1,46 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Flexbox, LayoutContainer } from "@vuu-ui/vuu-layout";
3
- import { VuuShellLocation } from "@vuu-ui/vuu-utils";
4
- import { ContextPanel } from "../context-panel/index.js";
5
- import { useMemo } from "react";
6
- const useSimpleContentPane = ({ appHeader, htmlAttributes })=>useMemo(()=>/*#__PURE__*/ jsxs(Flexbox, {
7
- ...htmlAttributes,
8
- style: {
9
- ...htmlAttributes?.style,
10
- flexDirection: "row"
11
- },
12
- children: [
13
- /*#__PURE__*/ jsxs(Flexbox, {
14
- className: "vuuShell-content",
15
- style: {
16
- flex: 1,
17
- flexDirection: "column"
18
- },
19
- children: [
20
- appHeader,
21
- /*#__PURE__*/ jsx(LayoutContainer, {
22
- id: VuuShellLocation.WorkspaceContainer,
23
- style: {
24
- flex: 1
25
- }
26
- }, "main-content")
27
- ]
28
- }),
29
- /*#__PURE__*/ jsx(ContextPanel, {
30
- id: VuuShellLocation.ContextPanel,
31
- overlay: true
32
- })
2
+ import { GridLayout, GridLayoutItem } from "@heswell/grid-layout";
3
+ import { ApplicationSettingsContextPanel } from "../context-panel/index.js";
4
+ const useSimpleContentPane = ({ appHeader, htmlAttributes, workspaceHost })=>{
5
+ const { onChange: _onChange, ...gridAttributes } = htmlAttributes ?? {};
6
+ return /*#__PURE__*/ jsxs(GridLayout, {
7
+ ...gridAttributes,
8
+ className: `${htmlAttributes?.className ?? ""} vuuShell-staticGrid`,
9
+ colsAndRows: {
10
+ cols: [
11
+ "1fr",
12
+ "0px"
13
+ ],
14
+ rows: [
15
+ "40px",
16
+ "1fr"
33
17
  ]
34
- }), [
35
- appHeader,
36
- htmlAttributes
37
- ]);
18
+ },
19
+ id: "vuu-shell-grid",
20
+ children: [
21
+ /*#__PURE__*/ jsx(GridLayoutItem, {
22
+ id: "vuu-shell-header",
23
+ style: {
24
+ gridArea: "1/1/2/2"
25
+ },
26
+ children: appHeader
27
+ }),
28
+ /*#__PURE__*/ jsx(GridLayoutItem, {
29
+ className: "vuuShell-content",
30
+ id: "vuu-shell-workspace-host",
31
+ style: {
32
+ gridArea: "2/1/3/2"
33
+ },
34
+ children: workspaceHost
35
+ }),
36
+ /*#__PURE__*/ jsx(GridLayoutItem, {
37
+ id: "vuu-shell-context",
38
+ style: {
39
+ gridArea: "1/2/3/3"
40
+ },
41
+ children: /*#__PURE__*/ jsx(ApplicationSettingsContextPanel, {})
42
+ })
43
+ ]
44
+ });
45
+ };
38
46
  export { useSimpleContentPane };
package/src/shell.css.js CHANGED
@@ -1,8 +1,9 @@
1
1
  const css = `
2
- .vuuShell {
2
+ .vuuShell.vuuGridLayout {
3
3
  background-color: var(--vuuShell-background, var(--salt-container-primary-background));
4
4
  height: var(--vuuShell-height, 100vh);
5
5
  width: var(--vuuShell-width, 100vw);
6
+ padding: 0;
6
7
 
7
8
  & .left-main-tabs {
8
9
  --vuuOverflowContainer-width: 48px;
@@ -51,7 +52,89 @@ const css = `
51
52
  }
52
53
 
53
54
  .vuuShell-content {
54
- padding: var(--vuuShell-content-padding, 8px);
55
+ padding: var(--vuuShell-content-padding, 8px 0 0 0);
56
+ margin: 0 8px 8px 0;
57
+ }
58
+
59
+ .vuuShell-staticGrid, .vuuWorkspaceHost, .vuuWorkspaceHost-content, .vuuWorkspaceHost-workspace {
60
+ width: 100%;
61
+ min-width: 0;
62
+ height: 100%;
63
+ min-height: 0;
64
+ }
65
+
66
+ .vuuShell-staticGrid {
67
+ --vuu-grid-gap: 0px;
68
+ overflow: hidden;
69
+ }
70
+
71
+ .vuuShell-staticGrid > .vuuGridLayoutItem {
72
+ border: 0;
73
+ min-width: 0;
74
+ min-height: 0;
75
+ }
76
+
77
+ .vuuShell-staticGrid > #vuu-shell-workspace-host {
78
+ overflow: hidden;
79
+ }
80
+
81
+ .vuuLeftNav > .vuuGridLayout {
82
+ --vuu-grid-gap: 0px;
83
+ width: max-content;
84
+ height: 100%;
85
+ }
86
+
87
+ .vuuLeftNav > .vuuGridLayout > .vuuGridLayoutItem {
88
+ border: 0;
89
+ min-width: 0;
90
+ min-height: 0;
91
+ }
92
+
93
+ .vuuWorkspaceHost {
94
+ flex-direction: column;
95
+ display: flex;
96
+ }
97
+
98
+ .vuuWorkspaceHost-content {
99
+ flex: auto;
100
+ min-height: 0;
101
+ }
102
+
103
+ .vuuWorkspaceHost-workspace[hidden] {
104
+ display: none;
105
+ }
106
+
107
+ .vuuWorkspaceHost-workspace {
108
+ position: relative;
109
+ }
110
+
111
+ .vuuWorkspaceHost-workspace > .vuuGridLayout {
112
+ width: 100%;
113
+ min-width: 0;
114
+ height: 100%;
115
+ min-height: 0;
116
+ }
117
+
118
+ .vuuWorkspaceHost-state {
119
+ justify-content: center;
120
+ align-items: center;
121
+ height: 100%;
122
+ display: flex;
123
+ }
124
+
125
+ .vuuWorkspaceHost-empty {
126
+ width: 100%;
127
+ min-width: 0;
128
+ height: 100%;
129
+ min-height: 0;
130
+ position: relative;
131
+ }
132
+
133
+ .vuuWorkspaceHost-emptyGrid {
134
+ width: 100%;
135
+ min-width: 0;
136
+ height: 100%;
137
+ min-height: 0;
55
138
  }
56
139
 
57
140