@vuu-ui/vuu-shell 4.0.0-alpha.9 → 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.
- package/package.json +19 -20
- package/src/app-header/AppHeader.css.js +1 -1
- package/src/app-header/AppHeader.js +26 -36
- package/src/application-provider/ApplicationContext.js +5 -2
- package/src/application-provider/ApplicationProvider.js +59 -8
- package/src/feature/Feature.js +34 -3
- package/src/feature/FeatureErrorBoundary.js +33 -0
- package/src/feature/index.js +0 -1
- package/src/feature-list/FeatureList.css.js +5 -27
- package/src/feature-list/FeatureList.js +96 -117
- package/src/index.js +3 -3
- package/src/left-nav/LeftNav.css.js +4 -2
- package/src/left-nav/LeftNav.js +100 -139
- package/src/persistence-manager/PersistenceProvider.js +3 -10
- package/src/persistence-manager/index.js +0 -3
- package/src/shell-layout-templates/context-panel/ContextPanel.css.js +8 -8
- package/src/shell-layout-templates/context-panel/ContextPanel.js +35 -17
- package/src/shell-layout-templates/context-panel/index.js +0 -1
- package/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +40 -54
- package/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +64 -54
- package/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +28 -49
- package/src/shell-layout-templates/side-panel/SidePanel.css.js +1 -3
- package/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +35 -43
- package/src/shell.css.js +3 -86
- package/src/shell.js +70 -148
- package/src/user-settings/SettingsForm.css.js +10 -0
- package/src/user-settings/SettingsForm.js +141 -0
- package/src/user-settings/UserSettingsPanel.css.js +9 -0
- package/src/user-settings/UserSettingsPanel.js +29 -0
- package/src/user-settings/index.js +2 -0
- package/src/workspace-management/LayoutList.js +99 -59
- package/src/workspace-management/SaveLayoutPanel.js +3 -3
- package/src/workspace-management/WorkspaceProvider.js +178 -699
- package/src/workspace-management/index.js +0 -8
- package/src/workspace-management/useWorkspaceContextMenuItems.js +6 -12
- package/types/app-header/AppHeader.d.ts +2 -2
- package/types/application-provider/ApplicationContext.d.ts +6 -1
- package/types/application-provider/ApplicationProvider.d.ts +14 -5
- package/types/feature/Feature.d.ts +10 -2
- package/types/feature/FeatureErrorBoundary.d.ts +1 -1
- package/types/feature/Loader.d.ts +1 -1
- package/types/feature/index.d.ts +1 -2
- package/types/feature-list/FeatureList.d.ts +4 -4
- package/types/index.d.ts +3 -3
- package/types/left-nav/LeftNav.d.ts +1 -2
- package/types/login/LoginPanel.d.ts +1 -1
- package/types/login/VuuLogo.d.ts +1 -1
- package/types/persistence-manager/PersistenceProvider.d.ts +3 -7
- package/types/persistence-manager/index.d.ts +0 -3
- package/types/shell-layout-templates/context-panel/ContextPanel.d.ts +11 -9
- package/types/shell-layout-templates/context-panel/index.d.ts +0 -1
- package/types/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +1 -1
- package/types/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +1 -1
- package/types/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +1 -1
- package/types/shell-layout-templates/side-panel/SidePanel.d.ts +1 -1
- package/types/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +1 -1
- package/types/shell-layout-templates/useShellLayout.d.ts +2 -4
- package/types/shell.d.ts +15 -19
- package/types/theme-switch/ThemeSwitch.d.ts +1 -1
- package/types/workspace-management/LayoutList.d.ts +2 -2
- package/types/workspace-management/LayoutTile.d.ts +1 -1
- package/types/workspace-management/SaveLayoutPanel.d.ts +2 -2
- package/types/workspace-management/WorkspaceProvider.d.ts +50 -61
- package/types/workspace-management/defaultWorkspaceJSON.d.ts +6 -7
- package/types/workspace-management/index.d.ts +0 -8
- package/types/workspace-management/useWorkspaceContextMenuItems.d.ts +1 -1
- package/src/module-registry/getRegisteredModules.js +0 -12
- package/src/persistence-manager/LocalWorkspacePersistenceService.js +0 -129
- package/src/persistence-manager/RemoteWorkspacePersistenceService.js +0 -112
- package/src/persistence-manager/WorkspacePersistenceService.js +0 -9
- package/src/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.js +0 -24
- package/src/workspace-management/WorkspaceController.js +0 -73
- package/src/workspace-management/WorkspaceHost.js +0 -194
- package/src/workspace-management/WorkspacePersistentState.js +0 -67
- package/src/workspace-management/WorkspaceRepository.js +0 -127
- package/src/workspace-management/WorkspaceStartPanel.css.js +0 -44
- package/src/workspace-management/WorkspaceStartPanel.js +0 -34
- package/src/workspace-management/shell-workspace-components.js +0 -59
- package/src/workspace-management/workspace-component-registry.js +0 -30
- package/src/workspace-management/workspace-schemas.js +0 -257
- package/types/module-registry/getRegisteredModules.d.ts +0 -5
- package/types/persistence-manager/LocalWorkspacePersistenceService.d.ts +0 -18
- package/types/persistence-manager/RemoteWorkspacePersistenceService.d.ts +0 -25
- package/types/persistence-manager/WorkspacePersistenceService.d.ts +0 -27
- package/types/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.d.ts +0 -1
- package/types/src/ShellContextProvider.d.ts +0 -7
- package/types/src/app-header/AppHeader.d.ts +0 -6
- package/types/src/app-header/index.d.ts +0 -1
- package/types/src/application-provider/ApplicationContext.d.ts +0 -11
- package/types/src/application-provider/ApplicationProvider.d.ts +0 -17
- package/types/src/application-provider/index.d.ts +0 -1
- package/types/src/feature/Feature.d.ts +0 -10
- package/types/src/feature/FeatureErrorBoundary.d.ts +0 -13
- package/types/src/feature/Loader.d.ts +0 -1
- package/types/src/feature/index.d.ts +0 -1
- package/types/src/feature-and-layout-provider/FeatureAndLayoutProvider.d.ts +0 -19
- package/types/src/feature-and-layout-provider/index.d.ts +0 -1
- package/types/src/feature-list/FeatureList.d.ts +0 -7
- package/types/src/feature-list/index.d.ts +0 -1
- package/types/src/get-layout-history.d.ts +0 -8
- package/types/src/index.d.ts +0 -14
- package/types/src/left-nav/LeftNav.d.ts +0 -14
- package/types/src/left-nav/index.d.ts +0 -1
- package/types/src/login/LoginPanel.d.ts +0 -6
- package/types/src/login/VuuLogo.d.ts +0 -1
- package/types/src/persistence-manager/LocalPersistenceManager.d.ts +0 -20
- package/types/src/persistence-manager/PersistenceManager.d.ts +0 -71
- package/types/src/persistence-manager/PersistenceProvider.d.ts +0 -11
- package/types/src/persistence-manager/RemotePersistenceManager.d.ts +0 -25
- package/types/src/persistence-manager/StaticPersistenceManager.d.ts +0 -25
- package/types/src/persistence-manager/index.d.ts +0 -5
- package/types/src/shell-layout-templates/context-panel/ContextPanel.d.ts +0 -13
- package/types/src/shell-layout-templates/context-panel/index.d.ts +0 -1
- package/types/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +0 -2
- package/types/src/shell-layout-templates/index.d.ts +0 -3
- package/types/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +0 -2
- package/types/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +0 -2
- package/types/src/shell-layout-templates/side-panel/SidePanel.d.ts +0 -8
- package/types/src/shell-layout-templates/side-panel/index.d.ts +0 -1
- package/types/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +0 -2
- package/types/src/shell-layout-templates/useShellLayout.d.ts +0 -51
- package/types/src/shell.d.ts +0 -17
- package/types/src/theme-switch/ThemeSwitch.d.ts +0 -8
- package/types/src/theme-switch/index.d.ts +0 -1
- package/types/src/user-settings/SettingsForm.d.ts +0 -46
- package/types/src/user-settings/UserSettingsPanel.d.ts +0 -3
- package/types/src/user-settings/index.d.ts +0 -2
- package/types/src/workspace-management/LayoutList.d.ts +0 -2
- package/types/src/workspace-management/LayoutTile.d.ts +0 -7
- package/types/src/workspace-management/SaveLayoutPanel.d.ts +0 -9
- package/types/src/workspace-management/WorkspaceProvider.d.ts +0 -52
- package/types/src/workspace-management/defaultWorkspaceJSON.d.ts +0 -10
- package/types/src/workspace-management/index.d.ts +0 -5
- package/types/src/workspace-management/screenshot-utils.d.ts +0 -6
- package/types/src/workspace-management/useWorkspaceContextMenuItems.d.ts +0 -5
- package/types/workspace-management/WorkspaceController.d.ts +0 -32
- package/types/workspace-management/WorkspaceHost.d.ts +0 -1
- package/types/workspace-management/WorkspacePersistentState.d.ts +0 -19
- package/types/workspace-management/WorkspaceRepository.d.ts +0 -13
- package/types/workspace-management/WorkspaceStartPanel.d.ts +0 -1
- package/types/workspace-management/shell-workspace-components.d.ts +0 -2
- package/types/workspace-management/workspace-component-registry.d.ts +0 -12
- 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:
|
|
67
|
+
z-index: -1;
|
|
66
68
|
display: none;
|
|
67
69
|
top: 0;
|
|
68
70
|
right: 0;
|
package/src/left-nav/LeftNav.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { VuuLogo } from "@vuu-ui/vuu-icons";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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,
|
|
9
|
+
import { useCallback, useMemo, useState } from "react";
|
|
10
10
|
import { FeatureList } from "../feature-list/index.js";
|
|
11
|
-
import { LayoutList
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
80
|
-
|
|
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 } =
|
|
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
|
-
|
|
109
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
setApplicationSetting,
|
|
116
|
-
visibleNavState
|
|
89
|
+
navState,
|
|
90
|
+
onActiveChange
|
|
117
91
|
]);
|
|
118
|
-
const displayStatus = getDisplayStatus(
|
|
92
|
+
const displayStatus = getDisplayStatus(navState.activeTabIndex, navState.expanded);
|
|
119
93
|
const toggleExpanded = useCallback(()=>{
|
|
120
|
-
const { activeTabIndex, expanded } =
|
|
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
|
-
|
|
129
|
-
|
|
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
|
-
|
|
134
|
-
|
|
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__*/
|
|
119
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
145
120
|
...htmlAttributes,
|
|
146
121
|
className: clsx(classBase, `${classBase}-${displayStatus}`),
|
|
147
122
|
style: style,
|
|
148
|
-
children:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
208
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
})
|
|
181
|
+
}),
|
|
182
|
+
/*#__PURE__*/ jsx(FeatureList, {
|
|
223
183
|
features: tableFeaturesByGroup,
|
|
224
184
|
title: "VUU TABLES"
|
|
225
|
-
})
|
|
185
|
+
}),
|
|
186
|
+
/*#__PURE__*/ jsx(LayoutList, {
|
|
226
187
|
title: "MY LAYOUTS"
|
|
227
|
-
})
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
23
|
-
|
|
30
|
+
dispatchLayoutAction,
|
|
31
|
+
hideContextPanel
|
|
24
32
|
]);
|
|
25
|
-
const handleKeyDown = useCallback((
|
|
26
|
-
if ("Escape" ===
|
|
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
|
-
|
|
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:
|
|
86
|
+
children: content
|
|
69
87
|
})
|
|
70
88
|
]
|
|
71
89
|
})
|
|
@@ -1,58 +1,44 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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 };
|