@vuu-ui/vuu-shell 4.0.0-alpha.8 → 4.0.0-beta.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 (143) hide show
  1. package/package.json +19 -20
  2. package/src/app-header/AppHeader.css.js +1 -1
  3. package/src/app-header/AppHeader.js +26 -36
  4. package/src/application-provider/ApplicationContext.js +5 -2
  5. package/src/application-provider/ApplicationProvider.js +59 -8
  6. package/src/feature/Feature.js +34 -3
  7. package/src/feature/FeatureErrorBoundary.js +33 -0
  8. package/src/feature/index.js +0 -1
  9. package/src/feature-list/FeatureList.css.js +5 -27
  10. package/src/feature-list/FeatureList.js +96 -117
  11. package/src/index.js +3 -3
  12. package/src/left-nav/LeftNav.css.js +4 -2
  13. package/src/left-nav/LeftNav.js +100 -139
  14. package/src/persistence-manager/PersistenceProvider.js +3 -10
  15. package/src/persistence-manager/index.js +0 -3
  16. package/src/shell-layout-templates/context-panel/ContextPanel.css.js +8 -8
  17. package/src/shell-layout-templates/context-panel/ContextPanel.js +35 -17
  18. package/src/shell-layout-templates/context-panel/index.js +0 -1
  19. package/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +40 -54
  20. package/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +64 -54
  21. package/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +28 -49
  22. package/src/shell-layout-templates/side-panel/SidePanel.css.js +1 -3
  23. package/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +35 -43
  24. package/src/shell.css.js +3 -86
  25. package/src/shell.js +70 -148
  26. package/src/user-settings/SettingsForm.css.js +10 -0
  27. package/src/user-settings/SettingsForm.js +141 -0
  28. package/src/user-settings/UserSettingsPanel.css.js +9 -0
  29. package/src/user-settings/UserSettingsPanel.js +29 -0
  30. package/src/user-settings/index.js +2 -0
  31. package/src/workspace-management/LayoutList.js +99 -59
  32. package/src/workspace-management/SaveLayoutPanel.js +3 -3
  33. package/src/workspace-management/WorkspaceProvider.js +178 -699
  34. package/src/workspace-management/index.js +0 -8
  35. package/src/workspace-management/useWorkspaceContextMenuItems.js +6 -12
  36. package/types/app-header/AppHeader.d.ts +2 -2
  37. package/types/application-provider/ApplicationContext.d.ts +6 -1
  38. package/types/application-provider/ApplicationProvider.d.ts +14 -5
  39. package/types/feature/Feature.d.ts +10 -2
  40. package/types/feature/FeatureErrorBoundary.d.ts +1 -1
  41. package/types/feature/Loader.d.ts +1 -1
  42. package/types/feature/index.d.ts +1 -2
  43. package/types/feature-list/FeatureList.d.ts +4 -4
  44. package/types/index.d.ts +3 -3
  45. package/types/left-nav/LeftNav.d.ts +1 -2
  46. package/types/login/LoginPanel.d.ts +1 -1
  47. package/types/login/VuuLogo.d.ts +1 -1
  48. package/types/persistence-manager/PersistenceProvider.d.ts +3 -7
  49. package/types/persistence-manager/index.d.ts +0 -3
  50. package/types/shell-layout-templates/context-panel/ContextPanel.d.ts +11 -9
  51. package/types/shell-layout-templates/context-panel/index.d.ts +0 -1
  52. package/types/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +1 -1
  53. package/types/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +1 -1
  54. package/types/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +1 -1
  55. package/types/shell-layout-templates/side-panel/SidePanel.d.ts +1 -1
  56. package/types/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +1 -1
  57. package/types/shell-layout-templates/useShellLayout.d.ts +2 -4
  58. package/types/shell.d.ts +15 -19
  59. package/types/theme-switch/ThemeSwitch.d.ts +1 -1
  60. package/types/workspace-management/LayoutList.d.ts +2 -2
  61. package/types/workspace-management/LayoutTile.d.ts +1 -1
  62. package/types/workspace-management/SaveLayoutPanel.d.ts +2 -2
  63. package/types/workspace-management/WorkspaceProvider.d.ts +50 -61
  64. package/types/workspace-management/defaultWorkspaceJSON.d.ts +6 -7
  65. package/types/workspace-management/index.d.ts +0 -8
  66. package/types/workspace-management/useWorkspaceContextMenuItems.d.ts +1 -1
  67. package/src/module-registry/getRegisteredModules.js +0 -12
  68. package/src/persistence-manager/LocalWorkspacePersistenceService.js +0 -129
  69. package/src/persistence-manager/RemoteWorkspacePersistenceService.js +0 -112
  70. package/src/persistence-manager/WorkspacePersistenceService.js +0 -9
  71. package/src/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.js +0 -24
  72. package/src/workspace-management/WorkspaceController.js +0 -73
  73. package/src/workspace-management/WorkspaceHost.js +0 -194
  74. package/src/workspace-management/WorkspacePersistentState.js +0 -67
  75. package/src/workspace-management/WorkspaceRepository.js +0 -127
  76. package/src/workspace-management/WorkspaceStartPanel.css.js +0 -44
  77. package/src/workspace-management/WorkspaceStartPanel.js +0 -34
  78. package/src/workspace-management/shell-workspace-components.js +0 -59
  79. package/src/workspace-management/workspace-component-registry.js +0 -30
  80. package/src/workspace-management/workspace-schemas.js +0 -257
  81. package/types/module-registry/getRegisteredModules.d.ts +0 -5
  82. package/types/persistence-manager/LocalWorkspacePersistenceService.d.ts +0 -18
  83. package/types/persistence-manager/RemoteWorkspacePersistenceService.d.ts +0 -25
  84. package/types/persistence-manager/WorkspacePersistenceService.d.ts +0 -27
  85. package/types/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.d.ts +0 -1
  86. package/types/src/ShellContextProvider.d.ts +0 -7
  87. package/types/src/app-header/AppHeader.d.ts +0 -6
  88. package/types/src/app-header/index.d.ts +0 -1
  89. package/types/src/application-provider/ApplicationContext.d.ts +0 -11
  90. package/types/src/application-provider/ApplicationProvider.d.ts +0 -17
  91. package/types/src/application-provider/index.d.ts +0 -1
  92. package/types/src/feature/Feature.d.ts +0 -10
  93. package/types/src/feature/FeatureErrorBoundary.d.ts +0 -13
  94. package/types/src/feature/Loader.d.ts +0 -1
  95. package/types/src/feature/index.d.ts +0 -1
  96. package/types/src/feature-and-layout-provider/FeatureAndLayoutProvider.d.ts +0 -19
  97. package/types/src/feature-and-layout-provider/index.d.ts +0 -1
  98. package/types/src/feature-list/FeatureList.d.ts +0 -7
  99. package/types/src/feature-list/index.d.ts +0 -1
  100. package/types/src/get-layout-history.d.ts +0 -8
  101. package/types/src/index.d.ts +0 -14
  102. package/types/src/left-nav/LeftNav.d.ts +0 -14
  103. package/types/src/left-nav/index.d.ts +0 -1
  104. package/types/src/login/LoginPanel.d.ts +0 -6
  105. package/types/src/login/VuuLogo.d.ts +0 -1
  106. package/types/src/persistence-manager/LocalPersistenceManager.d.ts +0 -20
  107. package/types/src/persistence-manager/PersistenceManager.d.ts +0 -71
  108. package/types/src/persistence-manager/PersistenceProvider.d.ts +0 -11
  109. package/types/src/persistence-manager/RemotePersistenceManager.d.ts +0 -25
  110. package/types/src/persistence-manager/StaticPersistenceManager.d.ts +0 -25
  111. package/types/src/persistence-manager/index.d.ts +0 -5
  112. package/types/src/shell-layout-templates/context-panel/ContextPanel.d.ts +0 -13
  113. package/types/src/shell-layout-templates/context-panel/index.d.ts +0 -1
  114. package/types/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +0 -2
  115. package/types/src/shell-layout-templates/index.d.ts +0 -3
  116. package/types/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +0 -2
  117. package/types/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +0 -2
  118. package/types/src/shell-layout-templates/side-panel/SidePanel.d.ts +0 -8
  119. package/types/src/shell-layout-templates/side-panel/index.d.ts +0 -1
  120. package/types/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +0 -2
  121. package/types/src/shell-layout-templates/useShellLayout.d.ts +0 -51
  122. package/types/src/shell.d.ts +0 -17
  123. package/types/src/theme-switch/ThemeSwitch.d.ts +0 -8
  124. package/types/src/theme-switch/index.d.ts +0 -1
  125. package/types/src/user-settings/SettingsForm.d.ts +0 -46
  126. package/types/src/user-settings/UserSettingsPanel.d.ts +0 -3
  127. package/types/src/user-settings/index.d.ts +0 -2
  128. package/types/src/workspace-management/LayoutList.d.ts +0 -2
  129. package/types/src/workspace-management/LayoutTile.d.ts +0 -7
  130. package/types/src/workspace-management/SaveLayoutPanel.d.ts +0 -9
  131. package/types/src/workspace-management/WorkspaceProvider.d.ts +0 -52
  132. package/types/src/workspace-management/defaultWorkspaceJSON.d.ts +0 -10
  133. package/types/src/workspace-management/index.d.ts +0 -5
  134. package/types/src/workspace-management/screenshot-utils.d.ts +0 -6
  135. package/types/src/workspace-management/useWorkspaceContextMenuItems.d.ts +0 -5
  136. package/types/workspace-management/WorkspaceController.d.ts +0 -32
  137. package/types/workspace-management/WorkspaceHost.d.ts +0 -1
  138. package/types/workspace-management/WorkspacePersistentState.d.ts +0 -19
  139. package/types/workspace-management/WorkspaceRepository.d.ts +0 -13
  140. package/types/workspace-management/WorkspaceStartPanel.d.ts +0 -1
  141. package/types/workspace-management/shell-workspace-components.d.ts +0 -2
  142. package/types/workspace-management/workspace-component-registry.d.ts +0 -12
  143. package/types/workspace-management/workspace-schemas.d.ts +0 -69
@@ -17,11 +17,13 @@ const css = `
17
17
  --vuu-light-text-primary: #15171b;
18
18
  --menu-level-2-width: 0px;
19
19
  z-index: 0;
20
- height: 100%;
20
+ height: calc(100% - 4px);
21
+ margin-bottom: 4px;
21
22
  transition: width .2s ease-out;
22
23
  display: flex;
23
24
  position: relative;
24
25
  overflow: hidden;
26
+ box-shadow: 3px 4px 4px #00000026;
25
27
  }
26
28
 
27
29
  .vuuLeftNav-menu-full {
@@ -62,7 +64,7 @@ const css = `
62
64
  .vuuLeftNav-menu-secondary {
63
65
  flex: none;
64
66
  flex-basis: var(--nav-menu-content-width, 240px);
65
- z-index: 0;
67
+ z-index: -1;
66
68
  display: none;
67
69
  top: 0;
68
70
  right: 0;
@@ -1,16 +1,17 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { VuuLogo } from "@vuu-ui/vuu-icons";
3
- import { GridLayout, GridLayoutItem } from "@vuu-ui/grid-layout";
4
- import { IconButton, Tab, Tabstrip } from "@vuu-ui/vuu-ui-controls";
3
+ import { Stack, useLayoutProviderDispatch } from "@vuu-ui/vuu-layout";
4
+ import { Tab, Tabstrip } from "@vuu-ui/vuu-ui-controls";
5
5
  import { hasFilterTableFeatureProps } from "@vuu-ui/vuu-utils";
6
6
  import { useComponentCssInjection } from "@salt-ds/styles";
7
7
  import { useWindow } from "@salt-ds/window";
8
8
  import clsx from "clsx";
9
- import { useCallback, useEffect, useMemo, useState } from "react";
9
+ import { useCallback, useMemo, useState } from "react";
10
10
  import { FeatureList } from "../feature-list/index.js";
11
- import { LayoutList, useWorkspace } from "../workspace-management/index.js";
11
+ import { LayoutList } from "../workspace-management/index.js";
12
12
  import LeftNav from "./LeftNav.css";
13
13
  import { useFeatures } from "../feature-and-layout-provider/index.js";
14
+ import { Button } from "@salt-ds/core";
14
15
  const classBase = "vuuLeftNav";
15
16
  const getDisplayStatus = (activeTabIndex, expanded)=>{
16
17
  if (0 === activeTabIndex) return expanded ? "menu-full" : "menu-icons";
@@ -31,7 +32,8 @@ const byModule = (f1, f2)=>{
31
32
  throw Error("Invalid tableFeature");
32
33
  };
33
34
  const LeftNav_LeftNav = (props)=>{
34
- const { "data-path": path, defaultExpanded = true, defaultActiveTabIndex = 0, onActiveChange, onTogglePrimaryMenu, onWidthChange, sizeCollapsed = 80, sizeContent = 300, sizeExpanded = 240, style: styleProp, ...htmlAttributes } = props;
35
+ const dispatch = useLayoutProviderDispatch();
36
+ const { "data-path": path, defaultExpanded = true, defaultActiveTabIndex = 0, onActiveChange, onTogglePrimaryMenu, sizeCollapsed = 80, sizeContent = 300, sizeExpanded = 240, style: styleProp, ...htmlAttributes } = props;
35
37
  const targetWindow = useWindow();
36
38
  useComponentCssInjection({
37
39
  testId: "vuu-left-nav",
@@ -39,45 +41,20 @@ const LeftNav_LeftNav = (props)=>{
39
41
  window: targetWindow
40
42
  });
41
43
  const { dynamicFeatures = [], tableFeatures = [] } = useFeatures();
42
- const { getApplicationSetting, scopeIdentity, setApplicationSetting, status } = useWorkspace();
43
- const storedActiveTabIndex = getApplicationSetting("leftNav.activeTabIndex");
44
- const storedExpanded = getApplicationSetting("leftNav.expanded");
45
44
  const [navState, setNavState] = useState({
46
- activeTabIndex: "number" == typeof storedActiveTabIndex ? storedActiveTabIndex : defaultActiveTabIndex,
47
- expanded: "boolean" == typeof storedExpanded ? storedExpanded : defaultExpanded,
48
- scopeIdentity: "loading" === status ? "" : scopeIdentity
49
- });
50
- const visibleNavState = "loading" !== status && navState.scopeIdentity === scopeIdentity ? navState : {
51
45
  activeTabIndex: defaultActiveTabIndex,
52
- expanded: defaultExpanded,
53
- scopeIdentity: ""
54
- };
55
- useEffect(()=>{
56
- "loading" === status ? setNavState({
57
- activeTabIndex: defaultActiveTabIndex,
58
- expanded: defaultExpanded,
59
- scopeIdentity: ""
60
- }) : setNavState({
61
- activeTabIndex: "number" == typeof storedActiveTabIndex ? storedActiveTabIndex : defaultActiveTabIndex,
62
- expanded: "boolean" == typeof storedExpanded ? storedExpanded : defaultExpanded,
63
- scopeIdentity
64
- });
65
- }, [
66
- defaultActiveTabIndex,
67
- defaultExpanded,
68
- scopeIdentity,
69
- status,
70
- storedActiveTabIndex,
71
- storedExpanded
72
- ]);
46
+ expanded: defaultExpanded
47
+ });
73
48
  const tableFeaturesByGroup = useMemo(()=>tableFeatures?.sort(byModule).reduce((acc, filterTableFeature)=>{
74
49
  if (!hasFilterTableFeatureProps(filterTableFeature)) return acc;
75
50
  {
76
51
  const { table } = filterTableFeature.ComponentProps.tableSchema;
77
52
  const key = `${table.module} Tables`;
78
53
  if (!acc[key]) acc[key] = [];
79
- acc[key].push(filterTableFeature);
80
- return acc;
54
+ return {
55
+ ...acc,
56
+ [key]: acc[key].concat(filterTableFeature)
57
+ };
81
58
  }
82
59
  }, {}), [
83
60
  tableFeatures
@@ -90,50 +67,48 @@ const LeftNav_LeftNav = (props)=>{
90
67
  sizeContent,
91
68
  sizeExpanded
92
69
  ]);
93
- useEffect(()=>{
94
- onWidthChange?.(getFullWidth(visibleNavState.activeTabIndex, visibleNavState.expanded));
95
- }, [
96
- getFullWidth,
97
- onWidthChange,
98
- visibleNavState
99
- ]);
100
70
  const handleTabSelection = useCallback((activeTabIndex)=>{
101
- const { activeTabIndex: currentIndex, expanded } = visibleNavState;
71
+ const { activeTabIndex: currentIndex, expanded } = navState;
102
72
  const newState = {
103
73
  activeTabIndex,
104
- expanded,
105
- scopeIdentity
74
+ expanded
106
75
  };
107
76
  setNavState(newState);
108
- getFullWidth(activeTabIndex, expanded);
109
- setApplicationSetting("leftNav.activeTabIndex", activeTabIndex);
77
+ if (0 === activeTabIndex || 0 === currentIndex) {
78
+ const width = getFullWidth(activeTabIndex, expanded);
79
+ dispatch({
80
+ type: "layout-resize",
81
+ path: "#vuu-side-panel",
82
+ size: width
83
+ });
84
+ }
110
85
  onActiveChange?.(activeTabIndex);
111
86
  }, [
87
+ dispatch,
112
88
  getFullWidth,
113
- onActiveChange,
114
- scopeIdentity,
115
- setApplicationSetting,
116
- visibleNavState
89
+ navState,
90
+ onActiveChange
117
91
  ]);
118
- const displayStatus = getDisplayStatus(visibleNavState.activeTabIndex, visibleNavState.expanded);
92
+ const displayStatus = getDisplayStatus(navState.activeTabIndex, navState.expanded);
119
93
  const toggleExpanded = useCallback(()=>{
120
- const { activeTabIndex, expanded } = visibleNavState;
94
+ const { activeTabIndex, expanded } = navState;
121
95
  const primaryMenuExpanded = !expanded;
122
96
  const newState = {
123
97
  activeTabIndex,
124
- expanded: primaryMenuExpanded,
125
- scopeIdentity
98
+ expanded: primaryMenuExpanded
126
99
  };
127
100
  setNavState(newState);
128
- getFullWidth(activeTabIndex, primaryMenuExpanded);
129
- setApplicationSetting("leftNav.expanded", primaryMenuExpanded);
101
+ dispatch({
102
+ type: "layout-resize",
103
+ path: "#vuu-side-panel",
104
+ size: getFullWidth(activeTabIndex, primaryMenuExpanded)
105
+ });
130
106
  onTogglePrimaryMenu?.(primaryMenuExpanded);
131
107
  }, [
108
+ dispatch,
132
109
  getFullWidth,
133
- onTogglePrimaryMenu,
134
- scopeIdentity,
135
- setApplicationSetting,
136
- visibleNavState
110
+ navState,
111
+ onTogglePrimaryMenu
137
112
  ]);
138
113
  const style = {
139
114
  ...styleProp,
@@ -141,93 +116,79 @@ const LeftNav_LeftNav = (props)=>{
141
116
  "--nav-menu-expanded-width": `${sizeExpanded}px`,
142
117
  "--nav-menu-content-width": `${sizeContent}px`
143
118
  };
144
- return /*#__PURE__*/ jsx("div", {
119
+ return /*#__PURE__*/ jsxs("div", {
145
120
  ...htmlAttributes,
146
121
  className: clsx(classBase, `${classBase}-${displayStatus}`),
147
122
  style: style,
148
- children: /*#__PURE__*/ jsxs(GridLayout, {
149
- colsAndRows: {
150
- cols: [
151
- `${visibleNavState.expanded ? sizeExpanded : sizeCollapsed}px`,
152
- `${0 === visibleNavState.activeTabIndex ? 0 : sizeContent}px`
153
- ],
154
- rows: [
155
- "1fr"
156
- ]
157
- },
158
- id: "vuu-left-nav-grid",
159
- children: [
160
- /*#__PURE__*/ jsxs(GridLayoutItem, {
161
- className: clsx(`${classBase}-menu-primary`),
162
- "data-mode": "dark",
163
- id: "vuu-left-nav-primary",
164
- style: {
165
- gridArea: "1/1/2/2"
166
- },
167
- children: [
168
- /*#__PURE__*/ jsx("div", {
169
- className: "vuuLeftNav-logo",
170
- children: /*#__PURE__*/ jsx(VuuLogo, {})
171
- }),
172
- /*#__PURE__*/ jsx("div", {
173
- className: `${classBase}-main`,
174
- children: /*#__PURE__*/ jsxs(Tabstrip, {
175
- activeTabIndex: visibleNavState.activeTabIndex,
176
- animateSelectionThumb: false,
177
- className: `${classBase}-Tabstrip`,
178
- onActiveChange: handleTabSelection,
179
- orientation: "vertical",
180
- children: [
181
- /*#__PURE__*/ jsx(Tab, {
182
- "data-icon": "demo",
183
- label: "DEMO"
184
- }),
185
- /*#__PURE__*/ jsx(Tab, {
186
- "data-icon": "features",
187
- label: "VUU FEATURES"
188
- }),
189
- /*#__PURE__*/ jsx(Tab, {
190
- "data-icon": "tables",
191
- label: "VUU TABLES"
192
- }),
193
- /*#__PURE__*/ jsx(Tab, {
194
- "data-icon": "layouts",
195
- label: "MY LAYOUTS"
196
- })
197
- ]
198
- })
199
- }),
200
- /*#__PURE__*/ jsx("div", {
201
- className: "vuuLeftNav-buttonBar",
202
- children: /*#__PURE__*/ jsx(IconButton, {
203
- className: clsx("vuuLeftNav-toggleButton", {
204
- "vuuLeftNav-toggleButton-open": displayStatus.startsWith("menu-full"),
205
- "vuuLeftNav-toggleButton-closed": displayStatus.startsWith("menu-icons")
123
+ children: [
124
+ /*#__PURE__*/ jsxs("div", {
125
+ className: clsx(`${classBase}-menu-primary`),
126
+ "data-mode": "dark",
127
+ children: [
128
+ /*#__PURE__*/ jsx("div", {
129
+ className: "vuuLeftNav-logo",
130
+ children: /*#__PURE__*/ jsx(VuuLogo, {})
131
+ }),
132
+ /*#__PURE__*/ jsx("div", {
133
+ className: `${classBase}-main`,
134
+ children: /*#__PURE__*/ jsxs(Tabstrip, {
135
+ activeTabIndex: navState.activeTabIndex,
136
+ animateSelectionThumb: false,
137
+ className: `${classBase}-Tabstrip`,
138
+ onActiveChange: handleTabSelection,
139
+ orientation: "vertical",
140
+ children: [
141
+ /*#__PURE__*/ jsx(Tab, {
142
+ "data-icon": "demo",
143
+ label: "DEMO"
144
+ }),
145
+ /*#__PURE__*/ jsx(Tab, {
146
+ "data-icon": "features",
147
+ label: "VUU FEATURES"
206
148
  }),
207
- icon: displayStatus.startsWith("menu-full") ? "chevron-left" : "chevron-right",
208
- onClick: toggleExpanded
209
- })
149
+ /*#__PURE__*/ jsx(Tab, {
150
+ "data-icon": "tables",
151
+ label: "VUU TABLES"
152
+ }),
153
+ /*#__PURE__*/ jsx(Tab, {
154
+ "data-icon": "layouts",
155
+ label: "MY LAYOUTS"
156
+ })
157
+ ]
158
+ })
159
+ }),
160
+ /*#__PURE__*/ jsx("div", {
161
+ className: "vuuLeftNav-buttonBar",
162
+ children: /*#__PURE__*/ jsx(Button, {
163
+ className: clsx("vuuLeftNav-toggleButton", {
164
+ "vuuLeftNav-toggleButton-open": displayStatus.startsWith("menu-full"),
165
+ "vuuLeftNav-toggleButton-closed": displayStatus.startsWith("menu-icons")
166
+ }),
167
+ "data-icon": displayStatus.startsWith("menu-full") ? "chevron-left" : "chevron-right",
168
+ onClick: toggleExpanded
210
169
  })
211
- ]
212
- }),
213
- /*#__PURE__*/ jsx(GridLayoutItem, {
214
- className: `${classBase}-menu-secondary`,
215
- id: "vuu-left-nav-secondary",
216
- style: {
217
- gridArea: "1/2/2/3"
218
- },
219
- children: 1 === visibleNavState.activeTabIndex ? /*#__PURE__*/ jsx(FeatureList, {
170
+ })
171
+ ]
172
+ }),
173
+ /*#__PURE__*/ jsxs(Stack, {
174
+ active: navState.activeTabIndex - 1,
175
+ className: `${classBase}-menu-secondary`,
176
+ showTabs: false,
177
+ children: [
178
+ /*#__PURE__*/ jsx(FeatureList, {
220
179
  features: dynamicFeatures,
221
180
  title: "VUU FEATURES"
222
- }) : 2 === visibleNavState.activeTabIndex ? /*#__PURE__*/ jsx(FeatureList, {
181
+ }),
182
+ /*#__PURE__*/ jsx(FeatureList, {
223
183
  features: tableFeaturesByGroup,
224
184
  title: "VUU TABLES"
225
- }) : 3 === visibleNavState.activeTabIndex ? /*#__PURE__*/ jsx(LayoutList, {
185
+ }),
186
+ /*#__PURE__*/ jsx(LayoutList, {
226
187
  title: "MY LAYOUTS"
227
- }) : null
228
- })
229
- ]
230
- }, `${visibleNavState.expanded}-${visibleNavState.activeTabIndex}`)
188
+ })
189
+ ]
190
+ })
191
+ ]
231
192
  });
232
193
  };
233
194
  export { LeftNav_LeftNav as LeftNav };
@@ -1,10 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { createContext, useContext } from "react";
3
3
  const PersistenceContext = /*#__PURE__*/ createContext({});
4
- const PersistenceProvider = ({ children, persistenceManager, workspacePersistenceService })=>/*#__PURE__*/ jsx(PersistenceContext.Provider, {
4
+ const PersistenceProvider = ({ children, persistenceManager })=>/*#__PURE__*/ jsx(PersistenceContext.Provider, {
5
5
  value: {
6
- persistenceManager,
7
- workspacePersistenceService
6
+ persistenceManager
8
7
  },
9
8
  children: children
10
9
  });
@@ -12,10 +11,4 @@ const usePersistenceManager = ()=>{
12
11
  const { persistenceManager } = useContext(PersistenceContext);
13
12
  return persistenceManager;
14
13
  };
15
- const useWorkspacePersistenceService = ()=>{
16
- const { workspacePersistenceService } = useContext(PersistenceContext);
17
- if (!workspacePersistenceService) throw new Error("useWorkspacePersistenceService requires a configured PersistenceProvider");
18
- return workspacePersistenceService;
19
- };
20
- const useOptionalWorkspacePersistenceService = ()=>useContext(PersistenceContext).workspacePersistenceService;
21
- export { PersistenceContext, PersistenceProvider, useOptionalWorkspacePersistenceService, usePersistenceManager, useWorkspacePersistenceService };
14
+ export { PersistenceContext, PersistenceProvider, usePersistenceManager };
@@ -3,6 +3,3 @@ export * from "./PersistenceProvider.js";
3
3
  export * from "./LocalPersistenceManager.js";
4
4
  export * from "./RemotePersistenceManager.js";
5
5
  export * from "./StaticPersistenceManager.js";
6
- export * from "./WorkspacePersistenceService.js";
7
- export * from "./LocalWorkspacePersistenceService.js";
8
- export * from "./RemoteWorkspacePersistenceService.js";
@@ -2,30 +2,29 @@ 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);
6
5
  z-index: 1;
7
6
  transition: width .3s ease-in-out;
8
7
  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);
13
12
  --vuu-side-panel-shadow: -4px 4px 4px #0000001a;
14
13
  --vuu-side-panel-padding: var(--vuuContextPanel-padding, 24px);
14
+ --vuu-side-panel-width: var(--vuuContextPanel-width, 300px) !important;
15
15
 
16
- & .vuuContextPanel-inner {
16
+ & .vuuView.vuuContextPanel-inner {
17
17
  padding: 24px 8px 24px 18px;
18
18
  }
19
19
  }
20
20
 
21
21
  .vuuContextPanel-overlay {
22
- width: 0;
22
+ width: 0 !important;
23
23
  }
24
24
 
25
- .vuuContextPanel-inner {
25
+ .vuuView.vuuContextPanel-inner {
26
26
  background-color: inherit;
27
27
  box-shadow: var(--vuu-side-panel-shadow, none);
28
- min-width: 0;
29
28
  height: 100%;
30
29
  width: var(--vuu-side-panel-width, 0px);
31
30
  flex-direction: column;
@@ -33,18 +32,19 @@ const css = `
33
32
  transition-duration: .3s;
34
33
  transition-timing-function: ease-in-out;
35
34
  display: flex;
36
- position: absolute;
37
35
  top: 0;
38
36
  right: 0;
39
37
  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);
45
44
  justify-content: space-between;
46
45
  align-items: center;
47
46
  display: flex;
47
+ flex: 0 0 var(--header-height) !important;
48
48
  }
49
49
 
50
50
  .vuuContextPanel-title {
@@ -1,12 +1,14 @@
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";
2
5
  import { useComponentCssInjection } from "@salt-ds/styles";
3
6
  import { useWindow } from "@salt-ds/window";
4
- import { IconButton, useHideContextPanel } from "@vuu-ui/vuu-ui-controls";
5
7
  import clsx from "clsx";
6
- import { useCallback, useLayoutEffect, useRef } from "react";
8
+ import react, { useCallback, useLayoutEffect, useMemo, useRef } from "react";
7
9
  import ContextPanel from "./ContextPanel.css";
8
10
  const classBase = "vuuContextPanel";
9
- const ContextPanel_ContextPanel = ({ className, content, expanded = false, id, onClose, overlay = false, title })=>{
11
+ const ContextPanel_ContextPanel = ({ className: classNameProp, expanded = false, content: contentProp, id, onClose, overlay = false, title })=>{
10
12
  const targetWindow = useWindow();
11
13
  useComponentCssInjection({
12
14
  testId: "vuu-context-panel",
@@ -15,33 +17,49 @@ const ContextPanel_ContextPanel = ({ className, content, expanded = false, id, o
15
17
  });
16
18
  const hideContextPanel = useHideContextPanel();
17
19
  const closeButtonRef = useRef(null);
20
+ const dispatchLayoutAction = useLayoutProviderDispatch();
18
21
  const handleClose = useCallback(()=>{
19
- hideContextPanel?.();
20
- onClose?.();
22
+ if (hideContextPanel) hideContextPanel();
23
+ else dispatchLayoutAction({
24
+ path: `#${VuuShellLocation.ContextPanel}`,
25
+ propName: "expanded",
26
+ propValue: false,
27
+ type: "set-prop"
28
+ });
21
29
  }, [
22
- hideContextPanel,
23
- onClose
30
+ dispatchLayoutAction,
31
+ hideContextPanel
24
32
  ]);
25
- const handleKeyDown = useCallback((event)=>{
26
- if ("Escape" === event.key) handleClose();
33
+ const handleKeyDown = useCallback((e)=>{
34
+ if ("Escape" === e.key) handleClose();
27
35
  }, [
28
36
  handleClose
29
37
  ]);
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
+ ]);
30
47
  useLayoutEffect(()=>{
31
48
  if (expanded) closeButtonRef.current?.focus();
49
+ else onClose?.();
32
50
  }, [
33
- expanded
51
+ expanded,
52
+ onClose
34
53
  ]);
35
54
  return /*#__PURE__*/ jsx("div", {
36
55
  className: clsx(classBase, className, "vuuScrollable", {
37
- [`${classBase}-expanded`]: expanded,
38
- [`${classBase}-inline`]: !overlay,
39
- [`${classBase}-overlay`]: overlay
56
+ [`${classBase}-expanded`]: expanded
40
57
  }),
41
58
  id: id,
42
- onKeyDown: handleKeyDown,
43
- children: /*#__PURE__*/ jsxs("div", {
59
+ children: /*#__PURE__*/ jsxs(View, {
44
60
  className: `${classBase}-inner`,
61
+ header: false,
62
+ id: id,
45
63
  children: [
46
64
  /*#__PURE__*/ jsxs("div", {
47
65
  className: `${classBase}-header`,
@@ -52,11 +70,11 @@ const ContextPanel_ContextPanel = ({ className, content, expanded = false, id, o
52
70
  }),
53
71
  /*#__PURE__*/ jsx(IconButton, {
54
72
  appearance: "transparent",
55
- "aria-label": "Close context panel",
56
73
  className: `${classBase}-close`,
57
74
  "data-embedded": true,
58
75
  icon: "close",
59
76
  onClick: handleClose,
77
+ onKeyDown: handleKeyDown,
60
78
  ref: closeButtonRef,
61
79
  sentiment: "neutral",
62
80
  size: 16
@@ -65,7 +83,7 @@ const ContextPanel_ContextPanel = ({ className, content, expanded = false, id, o
65
83
  }),
66
84
  /*#__PURE__*/ jsx("div", {
67
85
  className: `${classBase}-content`,
68
- children: expanded ? content : null
86
+ children: content
69
87
  })
70
88
  ]
71
89
  })
@@ -1,2 +1 @@
1
1
  export * from "./ContextPanel.js";
2
- export * from "./ApplicationSettingsContextPanel.js";
@@ -1,58 +1,44 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { GridLayout, GridLayoutItem } from "@vuu-ui/grid-layout";
3
- import { ApplicationSettingsContextPanel } from "../context-panel/index.js";
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";
4
5
  import { SidePanel } from "../side-panel/index.js";
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"
19
- ]
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"
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
31
37
  })
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
- };
38
+ ]
39
+ }), [
40
+ LeftSidePanelProps,
41
+ appHeader,
42
+ htmlAttributes
43
+ ]);
58
44
  export { useFullHeightLeftPanel };