@vuu-ui/vuu-shell 4.1.0 → 5.0.0-alpha.2
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 +20 -18
- package/src/app-header/AppHeader.js +36 -26
- package/src/application-provider/ApplicationContext.js +2 -5
- package/src/application-provider/ApplicationProvider.js +8 -59
- package/src/feature/Feature.js +3 -34
- package/src/feature/index.js +1 -0
- package/src/feature-list/FeatureList.css.js +27 -5
- package/src/feature-list/FeatureList.js +117 -96
- package/src/index.js +3 -3
- package/src/left-nav/LeftNav.css.js +2 -4
- package/src/left-nav/LeftNav.js +139 -100
- package/src/module-registry/getRegisteredModules.js +12 -0
- package/src/persistence-manager/PersistenceProvider.js +9 -4
- package/src/persistence-manager/index.js +1 -0
- package/src/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.js +24 -0
- package/src/shell-layout-templates/context-panel/ContextPanel.css.js +8 -8
- package/src/shell-layout-templates/context-panel/ContextPanel.js +17 -35
- package/src/shell-layout-templates/context-panel/index.js +1 -0
- package/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +54 -40
- package/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +54 -64
- package/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +49 -28
- package/src/shell-layout-templates/side-panel/SidePanel.css.js +3 -1
- package/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +43 -35
- package/src/shell.css.js +85 -2
- package/src/shell.js +148 -70
- package/src/workspace-management/LayoutList.js +60 -100
- package/src/workspace-management/SaveLayoutPanel.js +3 -3
- package/src/workspace-management/index.js +2 -1
- package/src/workspace-management/shell-workspace-components.js +59 -0
- package/src/workspace-management/useWorkspaceContextMenuItems.js +13 -8
- package/types/app-header/AppHeader.d.ts +1 -1
- package/types/application-provider/ApplicationContext.d.ts +1 -6
- package/types/application-provider/ApplicationProvider.d.ts +5 -14
- package/types/feature/Feature.d.ts +2 -10
- package/types/feature/index.d.ts +2 -1
- package/types/feature-list/FeatureList.d.ts +3 -3
- package/types/index.d.ts +3 -3
- package/types/left-nav/LeftNav.d.ts +1 -0
- package/types/persistence-manager/PersistenceProvider.d.ts +6 -3
- package/types/persistence-manager/index.d.ts +1 -0
- package/types/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.d.ts +1 -1
- package/types/shell-layout-templates/context-panel/ContextPanel.d.ts +9 -11
- package/types/shell-layout-templates/context-panel/index.d.ts +1 -0
- 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/simple-content-pane/useSimpleContentPane.d.ts +1 -1
- package/types/shell-layout-templates/useShellLayout.d.ts +4 -2
- package/types/shell.d.ts +19 -15
- package/types/workspace-management/LayoutList.d.ts +1 -1
- package/types/workspace-management/SaveLayoutPanel.d.ts +1 -1
- package/types/workspace-management/defaultWorkspaceJSON.d.ts +7 -6
- package/types/workspace-management/index.d.ts +6 -1
- package/types/workspace-management/useWorkspaceContextMenuItems.d.ts +1 -1
- package/src/feature/FeatureErrorBoundary.js +0 -33
- package/src/user-settings/SettingsForm.css.js +0 -10
- package/src/user-settings/SettingsForm.js +0 -141
- package/src/user-settings/UserSettingsPanel.css.js +0 -9
- package/src/user-settings/UserSettingsPanel.js +0 -29
- package/src/user-settings/index.js +0 -2
- package/src/workspace-management/WorkspaceProvider.js +0 -209
- package/types/feature/FeatureErrorBoundary.d.ts +0 -13
- 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/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/user-settings/SettingsForm.d.ts +0 -46
- package/types/user-settings/UserSettingsPanel.d.ts +0 -3
- package/types/user-settings/index.d.ts +0 -2
- 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/WorkspaceProvider.d.ts +0 -52
- package/types/workspace-management/WorkspaceRepository.d.ts +0 -13
- package/types/workspace-management/WorkspaceStartPanel.d.ts +0 -1
- package/types/workspace-management/workspace-component-registry.d.ts +0 -12
- package/types/workspace-management/workspace-schemas.d.ts +0 -69
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createElement, useCallback, useMemo } from "react";
|
|
3
|
-
import { IconButton } from "@vuu-ui/vuu-ui-controls";
|
|
4
2
|
import { ListBox, Option } from "@salt-ds/core";
|
|
5
|
-
import { VuuShellLocation } from "@vuu-ui/vuu-utils";
|
|
6
3
|
import { useComponentCssInjection } from "@salt-ds/styles";
|
|
7
4
|
import { useWindow } from "@salt-ds/window";
|
|
5
|
+
import { IconButton } from "@vuu-ui/vuu-ui-controls";
|
|
8
6
|
import clsx from "clsx";
|
|
9
|
-
import {
|
|
10
|
-
import { useWorkspace } from "./WorkspaceProvider.js";
|
|
11
|
-
import { useLayouts } from "../feature-and-layout-provider/index.js";
|
|
12
|
-
import { layoutFromJson, useLayoutProviderDispatch } from "@vuu-ui/vuu-layout";
|
|
7
|
+
import { useWorkspace } from "@vuu-ui/core";
|
|
13
8
|
import LayoutList from "./LayoutList.css";
|
|
14
9
|
const classBase = "vuuLayoutList";
|
|
15
10
|
const NO_SELECTION = [];
|
|
@@ -20,108 +15,73 @@ const LayoutList_LayoutList = ({ className, title, ...htmlAttributes })=>{
|
|
|
20
15
|
css: LayoutList,
|
|
21
16
|
window: targetWindow
|
|
22
17
|
});
|
|
23
|
-
const {
|
|
24
|
-
const { systemLayouts } = useLayouts();
|
|
25
|
-
const handleLoadLayout = useCallback((layoutId)=>{
|
|
26
|
-
if (layoutId) loadLayoutById(layoutId);
|
|
27
|
-
}, [
|
|
28
|
-
loadLayoutById
|
|
29
|
-
]);
|
|
30
|
-
const dispatch = useLayoutProviderDispatch();
|
|
31
|
-
const handleLoadSysLayout = (layoutId, layoutJSON)=>{
|
|
32
|
-
if (layoutJSON) dispatch({
|
|
33
|
-
type: "add",
|
|
34
|
-
path: `#${VuuShellLocation.Workspace}`,
|
|
35
|
-
component: layoutFromJson(layoutJSON, "0")
|
|
36
|
-
});
|
|
37
|
-
else throw Error("layoutJSON is required for system layouts");
|
|
38
|
-
};
|
|
39
|
-
const layoutsByGroup = layoutMetadata.reduce((acc, cur)=>{
|
|
40
|
-
if (acc[cur.group]) return {
|
|
41
|
-
...acc,
|
|
42
|
-
[cur.group]: [
|
|
43
|
-
...acc[cur.group],
|
|
44
|
-
cur
|
|
45
|
-
]
|
|
46
|
-
};
|
|
47
|
-
return {
|
|
48
|
-
...acc,
|
|
49
|
-
[cur.group]: [
|
|
50
|
-
cur
|
|
51
|
-
]
|
|
52
|
-
};
|
|
53
|
-
}, {});
|
|
54
|
-
let sysContent = [];
|
|
55
|
-
if (systemLayouts) sysContent = [
|
|
56
|
-
/*#__PURE__*/ jsxs("div", {
|
|
57
|
-
className: `${classBase}-group`,
|
|
58
|
-
children: [
|
|
59
|
-
/*#__PURE__*/ jsx("div", {
|
|
60
|
-
className: `${classBase}-groupHeader`,
|
|
61
|
-
children: "System Layout"
|
|
62
|
-
}),
|
|
63
|
-
/*#__PURE__*/ jsx(ListBox, {
|
|
64
|
-
selected: NO_SELECTION,
|
|
65
|
-
children: systemLayouts.map((layout)=>/*#__PURE__*/ jsx(Option, {
|
|
66
|
-
value: layout,
|
|
67
|
-
children: /*#__PURE__*/ createElement(LayoutTile, {
|
|
68
|
-
...htmlAttributes,
|
|
69
|
-
key: layout.id,
|
|
70
|
-
metadata: layout,
|
|
71
|
-
onLoadLayout: handleLoadSysLayout
|
|
72
|
-
})
|
|
73
|
-
}, layout.id))
|
|
74
|
-
})
|
|
75
|
-
]
|
|
76
|
-
}, 0)
|
|
77
|
-
];
|
|
78
|
-
const content = useMemo(()=>Object.entries(layoutsByGroup).map(([heading, layoutMetadata], index)=>/*#__PURE__*/ jsxs("div", {
|
|
79
|
-
className: `${classBase}-group`,
|
|
80
|
-
children: [
|
|
81
|
-
/*#__PURE__*/ jsx("div", {
|
|
82
|
-
className: `${classBase}-groupHeader`,
|
|
83
|
-
children: heading
|
|
84
|
-
}),
|
|
85
|
-
/*#__PURE__*/ jsx(ListBox, {
|
|
86
|
-
selected: NO_SELECTION,
|
|
87
|
-
children: layoutMetadata.map((layout)=>/*#__PURE__*/ jsxs(Option, {
|
|
88
|
-
value: layout,
|
|
89
|
-
children: [
|
|
90
|
-
/*#__PURE__*/ createElement(LayoutTile, {
|
|
91
|
-
...htmlAttributes,
|
|
92
|
-
key: layout.id,
|
|
93
|
-
metadata: layout,
|
|
94
|
-
onLoadLayout: handleLoadLayout
|
|
95
|
-
}),
|
|
96
|
-
/*#__PURE__*/ jsx(IconButton, {
|
|
97
|
-
className: `${classBase}-menu`,
|
|
98
|
-
"data-embedded": true,
|
|
99
|
-
icon: "more-vert",
|
|
100
|
-
appearance: "transparent",
|
|
101
|
-
sentiment: "neutral"
|
|
102
|
-
})
|
|
103
|
-
]
|
|
104
|
-
}, layout.id))
|
|
105
|
-
})
|
|
106
|
-
]
|
|
107
|
-
}, index)), [
|
|
108
|
-
handleLoadLayout,
|
|
109
|
-
htmlAttributes,
|
|
110
|
-
layoutsByGroup
|
|
111
|
-
]);
|
|
18
|
+
const { deleteNamedWorkspace, namedWorkspaces, openNamedWorkspace, openSystemWorkspace, status, systemWorkspaces } = useWorkspace();
|
|
112
19
|
return /*#__PURE__*/ jsxs("div", {
|
|
113
20
|
...htmlAttributes,
|
|
114
|
-
className: clsx(classBase, "vuuScrollable"),
|
|
21
|
+
className: clsx(classBase, className, "vuuScrollable"),
|
|
115
22
|
children: [
|
|
116
23
|
/*#__PURE__*/ jsx("div", {
|
|
117
24
|
className: `${classBase}-header`,
|
|
118
25
|
children: title
|
|
119
26
|
}),
|
|
120
|
-
/*#__PURE__*/
|
|
27
|
+
/*#__PURE__*/ jsxs("div", {
|
|
121
28
|
className: `${classBase}-content`,
|
|
122
29
|
children: [
|
|
123
|
-
|
|
124
|
-
|
|
30
|
+
"loading" === status ? /*#__PURE__*/ jsx("div", {
|
|
31
|
+
role: "status",
|
|
32
|
+
children: "Loading layouts…"
|
|
33
|
+
}) : null,
|
|
34
|
+
systemWorkspaces.length > 0 ? /*#__PURE__*/ jsxs("div", {
|
|
35
|
+
className: `${classBase}-group`,
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ jsx("div", {
|
|
38
|
+
className: `${classBase}-groupHeader`,
|
|
39
|
+
children: "System Layouts"
|
|
40
|
+
}),
|
|
41
|
+
/*#__PURE__*/ jsx(ListBox, {
|
|
42
|
+
selected: NO_SELECTION,
|
|
43
|
+
children: systemWorkspaces.map((definition)=>/*#__PURE__*/ jsx(Option, {
|
|
44
|
+
value: definition.id,
|
|
45
|
+
children: /*#__PURE__*/ jsx("button", {
|
|
46
|
+
onClick: ()=>void openSystemWorkspace(definition),
|
|
47
|
+
type: "button",
|
|
48
|
+
children: definition.name
|
|
49
|
+
})
|
|
50
|
+
}, definition.id))
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
}) : null,
|
|
54
|
+
/*#__PURE__*/ jsxs("div", {
|
|
55
|
+
className: `${classBase}-group`,
|
|
56
|
+
children: [
|
|
57
|
+
/*#__PURE__*/ jsx("div", {
|
|
58
|
+
className: `${classBase}-groupHeader`,
|
|
59
|
+
children: "My Layouts"
|
|
60
|
+
}),
|
|
61
|
+
0 === namedWorkspaces.length && "loading" !== status ? /*#__PURE__*/ jsx("div", {
|
|
62
|
+
children: "No saved workspaces"
|
|
63
|
+
}) : /*#__PURE__*/ jsx(ListBox, {
|
|
64
|
+
selected: NO_SELECTION,
|
|
65
|
+
children: namedWorkspaces.map((definition)=>/*#__PURE__*/ jsxs(Option, {
|
|
66
|
+
value: definition.id,
|
|
67
|
+
children: [
|
|
68
|
+
/*#__PURE__*/ jsx("button", {
|
|
69
|
+
onClick: ()=>void openNamedWorkspace(definition.id),
|
|
70
|
+
type: "button",
|
|
71
|
+
children: definition.name
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ jsx(IconButton, {
|
|
74
|
+
"aria-label": `Delete ${definition.name}`,
|
|
75
|
+
appearance: "transparent",
|
|
76
|
+
icon: "delete",
|
|
77
|
+
onClick: ()=>void deleteNamedWorkspace(definition.id),
|
|
78
|
+
sentiment: "neutral"
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}, definition.id))
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
})
|
|
125
85
|
]
|
|
126
86
|
})
|
|
127
87
|
]
|
|
@@ -2,10 +2,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button, ComboBox, FormField, FormFieldLabel, Input, Option, Text } from "@salt-ds/core";
|
|
3
3
|
import { useComponentCssInjection } from "@salt-ds/styles";
|
|
4
4
|
import { useWindow } from "@salt-ds/window";
|
|
5
|
+
import { useAuthenticatedUser } from "@vuu-ui/core";
|
|
5
6
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
6
7
|
import { takeScreenshot } from "./screenshot-utils.js";
|
|
7
8
|
import SaveLayoutPanel from "./SaveLayoutPanel.css";
|
|
8
|
-
import { useApplicationUser } from "../application-provider/index.js";
|
|
9
9
|
const classBase = "vuuSaveLayoutPanel";
|
|
10
10
|
const groups = [
|
|
11
11
|
"Group 1",
|
|
@@ -26,7 +26,7 @@ const SaveLayoutPanel_SaveLayoutPanel = (props)=>{
|
|
|
26
26
|
const [group, setGroup] = useState("");
|
|
27
27
|
const [screenshot, setScreenshot] = useState();
|
|
28
28
|
const [screenshotErrorMessage, setScreenshotErrorMessage] = useState();
|
|
29
|
-
const {
|
|
29
|
+
const { userName } = useAuthenticatedUser();
|
|
30
30
|
useEffect(()=>{
|
|
31
31
|
if (componentId) takeScreenshot(document.getElementById(componentId)).then((screenshot)=>{
|
|
32
32
|
setScreenshot(screenshot);
|
|
@@ -41,7 +41,7 @@ const SaveLayoutPanel_SaveLayoutPanel = (props)=>{
|
|
|
41
41
|
name: layoutName,
|
|
42
42
|
group,
|
|
43
43
|
screenshot: screenshot ?? "",
|
|
44
|
-
user:
|
|
44
|
+
user: userName
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
const screenshotContent = useMemo(()=>{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./SaveLayoutPanel.js";
|
|
2
2
|
export * from "./LayoutList.js";
|
|
3
|
-
export * from "./WorkspaceProvider.js";
|
|
4
3
|
export * from "./defaultWorkspaceJSON.js";
|
|
5
4
|
export * from "./useWorkspaceContextMenuItems.js";
|
|
5
|
+
export * from "./shell-workspace-components.js";
|
|
6
|
+
export { APPLICATION_SESSION_VERSION, NAMED_WORKSPACE_DEFINITION_VERSION, StaleWorkspaceScopeError, WORKSPACE_SNAPSHOT_RECORD_VERSION, WORKSPACE_SNAPSHOT_VERSION, WorkspaceController, WorkspaceHost, WorkspacePersistentStateProvider, WorkspacePersistentStateStore, WorkspaceProvider, WorkspaceRepository, WorkspaceRepositoryDisposedError, WorkspaceStartPanel, WorkspaceValidationError, cloneWorkspaceValue, createWorkspaceComponentRegistries, emptyWorkspaceSnapshot, jsonValueWorkspaceComponentCodec, useComponentPersistentState, useWorkspace, useWorkspacePersistentStateStore, validateApplicationSessionV1, validateNamedWorkspaceDefinitionV1, validateNamedWorkspaceMetadataV1, validateWorkspaceSnapshotRecordV1, validateWorkspaceSnapshotV1, workspaceMetadata } from "@vuu-ui/core";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { featureFromJson } from "@vuu-ui/vuu-utils";
|
|
3
|
+
import { Feature } from "../feature/index.js";
|
|
4
|
+
const isRecord = (value)=>"object" == typeof value && null !== value && !Array.isArray(value);
|
|
5
|
+
const dynamicFeatureCodec = {
|
|
6
|
+
decode: (value)=>isRecord(value) && "string" == typeof value.mfComponent && "string" == typeof value.mfScope && "string" == typeof value.mfUrl ? {
|
|
7
|
+
ok: true,
|
|
8
|
+
value: value
|
|
9
|
+
} : {
|
|
10
|
+
error: {
|
|
11
|
+
code: "INVALID_DYNAMIC_FEATURE",
|
|
12
|
+
message: "dynamic feature settings require mfComponent, mfScope and mfUrl",
|
|
13
|
+
path: "$"
|
|
14
|
+
},
|
|
15
|
+
ok: false
|
|
16
|
+
},
|
|
17
|
+
encode: (value)=>({
|
|
18
|
+
ok: true,
|
|
19
|
+
value
|
|
20
|
+
}),
|
|
21
|
+
isSettings: (value)=>"object" == typeof value && null !== value && "mfComponent" in value && "mfScope" in value && "mfUrl" in value && "string" == typeof value.mfComponent && "string" == typeof value.mfScope && "string" == typeof value.mfUrl,
|
|
22
|
+
version: 1
|
|
23
|
+
};
|
|
24
|
+
const staticFeatureCodec = {
|
|
25
|
+
decode: (value)=>isRecord(value) && "string" == typeof value.type ? {
|
|
26
|
+
ok: true,
|
|
27
|
+
value: {
|
|
28
|
+
type: value.type
|
|
29
|
+
}
|
|
30
|
+
} : {
|
|
31
|
+
error: {
|
|
32
|
+
code: "INVALID_STATIC_FEATURE",
|
|
33
|
+
message: "static feature settings require a component type",
|
|
34
|
+
path: "$.type"
|
|
35
|
+
},
|
|
36
|
+
ok: false
|
|
37
|
+
},
|
|
38
|
+
encode: (value)=>({
|
|
39
|
+
ok: true,
|
|
40
|
+
value
|
|
41
|
+
}),
|
|
42
|
+
isSettings: (value)=>"object" == typeof value && null !== value && "type" in value && "string" == typeof value.type,
|
|
43
|
+
version: 1
|
|
44
|
+
};
|
|
45
|
+
const shellWorkspaceComponentRegistrations = [
|
|
46
|
+
{
|
|
47
|
+
codec: dynamicFeatureCodec,
|
|
48
|
+
render: (settings)=>/*#__PURE__*/ jsx(Feature, {
|
|
49
|
+
...settings
|
|
50
|
+
}),
|
|
51
|
+
type: "vuu-dynamic-feature"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
codec: staticFeatureCodec,
|
|
55
|
+
render: (settings)=>featureFromJson(settings),
|
|
56
|
+
type: "vuu-static-feature"
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
export { shellWorkspaceComponentRegistrations };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useModal } from "@vuu-ui/
|
|
2
|
+
import { useModal, useWorkspace } from "@vuu-ui/core";
|
|
3
3
|
import { useCallback, useMemo } from "react";
|
|
4
4
|
import { SaveLayoutPanel } from "./SaveLayoutPanel.js";
|
|
5
|
-
import { useWorkspace } from "./WorkspaceProvider.js";
|
|
6
5
|
const useWorkspaceContextMenuItems = ()=>{
|
|
7
|
-
const {
|
|
6
|
+
const { activeWorkspace, closeWorkspace, saveActiveWorkspaceAs } = useWorkspace();
|
|
8
7
|
const { showDialog, closeDialog } = useModal();
|
|
9
8
|
const handleCloseDialog = useCallback(()=>{
|
|
10
9
|
closeDialog();
|
|
@@ -12,11 +11,11 @@ const useWorkspaceContextMenuItems = ()=>{
|
|
|
12
11
|
closeDialog
|
|
13
12
|
]);
|
|
14
13
|
const handleSave = useCallback((layoutMetadata)=>{
|
|
15
|
-
|
|
14
|
+
saveActiveWorkspaceAs(layoutMetadata.name);
|
|
16
15
|
closeDialog();
|
|
17
16
|
}, [
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
closeDialog,
|
|
18
|
+
saveActiveWorkspaceAs
|
|
20
19
|
]);
|
|
21
20
|
const [buildMenuOptions, handleMenuAction] = useMemo(()=>[
|
|
22
21
|
(location, options)=>{
|
|
@@ -27,8 +26,8 @@ const useWorkspaceContextMenuItems = ()=>{
|
|
|
27
26
|
id: "save-layout",
|
|
28
27
|
options
|
|
29
28
|
}, {
|
|
30
|
-
label: "
|
|
31
|
-
id: "
|
|
29
|
+
label: "Close Workspace",
|
|
30
|
+
id: "close-workspace",
|
|
32
31
|
options
|
|
33
32
|
});
|
|
34
33
|
return menuDescriptors;
|
|
@@ -43,9 +42,15 @@ const useWorkspaceContextMenuItems = ()=>{
|
|
|
43
42
|
}), "Save Layout", [], true);
|
|
44
43
|
return true;
|
|
45
44
|
}
|
|
45
|
+
if ("close-workspace" === menuItemId && activeWorkspace) {
|
|
46
|
+
closeWorkspace(activeWorkspace.instanceId);
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
46
49
|
return false;
|
|
47
50
|
}
|
|
48
51
|
], [
|
|
52
|
+
activeWorkspace,
|
|
53
|
+
closeWorkspace,
|
|
49
54
|
handleCloseDialog,
|
|
50
55
|
handleSave,
|
|
51
56
|
showDialog
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
import { SettingsSchema } from "../user-settings";
|
|
1
|
+
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
4
2
|
export interface ApplicationContextProps {
|
|
5
3
|
onUserSettingChanged: (propertyName: string, value: VuuRowDataItemType) => void;
|
|
6
4
|
logout?: () => void;
|
|
7
|
-
userSettings?: Settings;
|
|
8
|
-
userSettingsSchema?: SettingsSchema;
|
|
9
|
-
user: VuuUser;
|
|
10
5
|
}
|
|
11
6
|
export declare const ApplicationContext: import("react").Context<ApplicationContextProps>;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export interface ApplicationProviderProps extends Partial<Pick<ThemeContextProps, "theme" | "mode">>, Partial<Omit<ApplicationContextProps, "userSettings">> {
|
|
1
|
+
import { type Density, type ThemeContextProps } from "@salt-ds/core";
|
|
2
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
3
|
+
import { type ApplicationContextProps } from "./ApplicationContext";
|
|
4
|
+
export interface ApplicationProviderProps extends Partial<Pick<ThemeContextProps, "theme" | "mode">>, Partial<ApplicationContextProps> {
|
|
6
5
|
children: ReactNode;
|
|
7
6
|
density?: Density;
|
|
8
7
|
}
|
|
9
|
-
export declare const ApplicationProvider: ({ children, density: densityProp, logout, mode, theme,
|
|
10
|
-
export declare const useApplicationUser: () => import("@vuu-ui/vuu-utils").VuuUser;
|
|
11
|
-
export declare const useApplicationSettings: () => {
|
|
12
|
-
onUserSettingChanged: (propertyName: string, value: VuuRowDataItemType) => void;
|
|
13
|
-
userSettings: import("@vuu-ui/vuu-utils").Settings | undefined;
|
|
14
|
-
userSettingsSchema: import("..").SettingsSchema | undefined;
|
|
15
|
-
};
|
|
16
|
-
export declare const useUserSetting: () => import("@vuu-ui/vuu-utils").Settings | undefined;
|
|
17
|
-
export declare const useLogout: () => (() => void) | undefined;
|
|
8
|
+
export declare const ApplicationProvider: ({ children, density: densityProp, logout, mode, theme, }: ApplicationProviderProps) => ReactElement | null;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
declare function RawFeature<Params extends object | undefined>({ url, css, ComponentProps: params, ...props }: DynamicFeatureProps<Params>): React.JSX.Element;
|
|
4
|
-
/**
|
|
5
|
-
Feature is a wrapper around React Lazy Loading. It will load a component
|
|
6
|
-
from the given url. That url must resolve to a javascript bundle with a
|
|
7
|
-
single default export. That export must be a React component.
|
|
8
|
-
*/
|
|
9
|
-
export declare const Feature: React.MemoExoticComponent<typeof RawFeature>;
|
|
10
|
-
export {};
|
|
1
|
+
/** @deprecated Use RemoteModule from @vuu-ui/core/portal. */
|
|
2
|
+
export declare const Feature: import("react").MemoExoticComponent<(props: import("@vuu-ui/core/portal").RemoteModuleProps) => import("react").JSX.Element>;
|
package/types/feature/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./Feature";
|
|
2
|
+
export { RemoteModule, type RemoteModuleProps, } from "@vuu-ui/core/portal";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DynamicFeatureProps, StaticFeatureDescriptor } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import { HTMLAttributes } from "react";
|
|
1
|
+
import { type DynamicFeatureProps, type StaticFeatureDescriptor } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { type HTMLAttributes } from "react";
|
|
3
3
|
export type GroupedFeatureProps<P extends object | undefined = object> = Record<string, DynamicFeatureProps<P>[]>;
|
|
4
4
|
export interface FeatureListProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
features: DynamicFeatureProps[] | GroupedFeatureProps | StaticFeatureDescriptor[];
|
|
5
|
+
readonly features: DynamicFeatureProps[] | GroupedFeatureProps | StaticFeatureDescriptor[];
|
|
6
6
|
}
|
|
7
7
|
export declare const FeatureList: ({ features, title, ...htmlAttributes }: FeatureListProps) => import("react").JSX.Element;
|
package/types/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from "./application-provider";
|
|
2
1
|
export * from "./app-header";
|
|
2
|
+
export * from "./application-provider";
|
|
3
3
|
export * from "./feature";
|
|
4
4
|
export * from "./feature-and-layout-provider";
|
|
5
|
+
export * from "./feature-list";
|
|
5
6
|
export * from "./left-nav";
|
|
6
7
|
export { LoginPanel, type LoginPanelProps } from "./login/LoginPanel";
|
|
8
|
+
export { getRegisteredModules } from './module-registry/getRegisteredModules';
|
|
7
9
|
export * from "./persistence-manager";
|
|
8
10
|
export * from "./shell";
|
|
9
11
|
export * from "./shell-layout-templates";
|
|
10
12
|
export * from "./ShellContextProvider";
|
|
11
|
-
export * from "./feature-list";
|
|
12
13
|
export * from "./theme-switch";
|
|
13
|
-
export * from "./user-settings";
|
|
14
14
|
export * from "./workspace-management";
|
|
@@ -7,6 +7,7 @@ export interface LeftNavProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
defaultExpanded?: boolean;
|
|
8
8
|
onActiveChange?: (activeTabIndex: number) => void;
|
|
9
9
|
onTogglePrimaryMenu?: (expanded: boolean) => void;
|
|
10
|
+
onWidthChange?: (width: number) => void;
|
|
10
11
|
sizeCollapsed?: number;
|
|
11
12
|
sizeContent?: number;
|
|
12
13
|
sizeExpanded?: number;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type WorkspacePersistenceService } from "@vuu-ui/core";
|
|
2
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
3
|
+
import type { IPersistenceManager } from "./PersistenceManager";
|
|
4
|
+
export { useOptionalWorkspacePersistenceService, useWorkspacePersistenceService, } from "@vuu-ui/core";
|
|
3
5
|
export interface PersistenceContextProps {
|
|
4
6
|
persistenceManager?: IPersistenceManager;
|
|
7
|
+
workspacePersistenceService?: WorkspacePersistenceService;
|
|
5
8
|
}
|
|
6
9
|
export declare const PersistenceContext: import("react").Context<PersistenceContextProps>;
|
|
7
10
|
export interface PersistenceProviderProps extends PersistenceContextProps {
|
|
8
11
|
children: ReactNode;
|
|
9
12
|
}
|
|
10
|
-
export declare const PersistenceProvider: ({ children, persistenceManager, }: PersistenceProviderProps) => ReactElement;
|
|
13
|
+
export declare const PersistenceProvider: ({ children, persistenceManager, workspacePersistenceService, }: PersistenceProviderProps) => ReactElement;
|
|
11
14
|
export declare const usePersistenceManager: () => IPersistenceManager | undefined;
|
|
@@ -3,3 +3,4 @@ export * from "./PersistenceProvider";
|
|
|
3
3
|
export * from "./LocalPersistenceManager";
|
|
4
4
|
export * from "./RemotePersistenceManager";
|
|
5
5
|
export * from "./StaticPersistenceManager";
|
|
6
|
+
export { LocalWorkspacePersistenceService, type PersistenceScope, type RemoteWorkspacePersistenceOptions, RemoteWorkspacePersistenceService, type UserPersistenceScope, WorkspacePersistenceError, type WorkspacePersistenceService, type WorkspaceRequestInitProvider, } from "@vuu-ui/core";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ApplicationSettingsContextPanel: () => import("react
|
|
1
|
+
export declare const ApplicationSettingsContextPanel: () => import("react").JSX.Element;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { ReactElement, ReactNode } from "react";
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
3
2
|
export interface ContextPanelProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
title?: ReactNode;
|
|
3
|
+
readonly className?: string;
|
|
4
|
+
readonly content?: ReactElement;
|
|
5
|
+
readonly expanded?: boolean;
|
|
6
|
+
readonly id?: string;
|
|
7
|
+
readonly onClose?: () => void;
|
|
8
|
+
readonly overlay?: boolean;
|
|
9
|
+
readonly title?: ReactNode;
|
|
12
10
|
}
|
|
13
|
-
export declare const ContextPanel: ({ className
|
|
11
|
+
export declare const ContextPanel: ({ className, content, expanded, id, onClose, overlay, title, }: ContextPanelProps) => import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ShellLayoutTemplateHook } from "../useShellLayout";
|
|
1
|
+
import type { ShellLayoutTemplateHook } from "../useShellLayout";
|
|
2
2
|
export declare const useFullHeightLeftPanel: ShellLayoutTemplateHook;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ShellLayoutTemplateHook } from "../useShellLayout";
|
|
1
|
+
import type { ShellLayoutTemplateHook } from "../useShellLayout";
|
|
2
2
|
export declare const useInlayLeftPanel: ShellLayoutTemplateHook;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ShellLayoutTemplateHook } from "../useShellLayout";
|
|
1
|
+
import type { ShellLayoutTemplateHook } from "../useShellLayout";
|
|
2
2
|
export declare const useLeftMainTabs: ShellLayoutTemplateHook;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ShellLayoutTemplateHook } from "../useShellLayout";
|
|
1
|
+
import type { ShellLayoutTemplateHook } from "../useShellLayout";
|
|
2
2
|
export declare const useSimpleContentPane: ShellLayoutTemplateHook;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactElement, ReactNode } from "react";
|
|
2
|
-
import { SidePanelProps as ShellSidePanelProps } from "./side-panel";
|
|
1
|
+
import type { HTMLAttributes, ReactElement, ReactNode } from "react";
|
|
2
|
+
import type { SidePanelProps as ShellSidePanelProps } from "./side-panel";
|
|
3
3
|
declare const LayoutHook: {
|
|
4
4
|
"full-height": ShellLayoutTemplateHook;
|
|
5
5
|
inlay: ShellLayoutTemplateHook;
|
|
@@ -41,6 +41,8 @@ export interface ShellLayoutProps {
|
|
|
41
41
|
* If template renders Toolbar, these props will be provided
|
|
42
42
|
*/
|
|
43
43
|
ToolbarProps?: ShellToolbarProps;
|
|
44
|
+
/** Supplied by Shell; application code should not normally set this. */
|
|
45
|
+
workspaceHost?: ReactNode;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* This hook acts as a stub for the actual shell layout
|
package/types/shell.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { VuuUser } from "@vuu-ui/vuu-utils";
|
|
2
1
|
import { type HTMLAttributes, type ReactNode } from "react";
|
|
3
|
-
import { ShellLayoutProps } from "./shell-layout-templates";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
user: VuuUser;
|
|
2
|
+
import { type ShellLayoutProps } from "./shell-layout-templates";
|
|
3
|
+
import { type WorkspaceProps } from "./workspace-management";
|
|
4
|
+
export interface ShellProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
5
|
+
readonly appHeader?: ReactNode;
|
|
6
|
+
readonly children?: ReactNode;
|
|
7
|
+
readonly leftNavWidth?: number;
|
|
8
|
+
readonly logout?: () => void;
|
|
9
|
+
readonly saveUrl?: string;
|
|
10
|
+
readonly serverUrl?: string;
|
|
11
|
+
/** @deprecated The shell now uses one canonical static GridLayout structure. */
|
|
12
|
+
readonly shellLayoutProps?: ShellLayoutProps;
|
|
13
|
+
readonly workspaceProps?: WorkspaceProps;
|
|
16
14
|
}
|
|
17
|
-
export
|
|
15
|
+
export interface StaticShellLayoutProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
16
|
+
readonly appHeader?: ReactNode;
|
|
17
|
+
readonly leftNavWidth?: number;
|
|
18
|
+
readonly workspaceHost?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare const StaticShellLayout: ({ appHeader, className, leftNavWidth: initialLeftNavWidth, style, workspaceHost, ...htmlAttributes }: StaticShellLayoutProps) => import("react").JSX.Element;
|
|
21
|
+
export declare const Shell: ({ appHeader, children, leftNavWidth, logout, saveUrl: _saveUrl, serverUrl: _serverUrl, shellLayoutProps, workspaceProps, ...htmlAttributes }: ShellProps) => import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
2
|
export declare const LayoutList: ({ className, title, ...htmlAttributes }: HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
3
|
-
export
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
import { type LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
3
|
+
export interface WorkspaceStackProps {
|
|
4
|
+
readonly showTabs?: boolean | "left" | "right";
|
|
5
|
+
readonly TabstripProps?: HTMLAttributes<HTMLDivElement>;
|
|
6
|
+
}
|
|
4
7
|
export declare const warningLayout: LayoutJSON;
|
|
5
8
|
export declare const loadingJSON: Readonly<LayoutJSON>;
|
|
6
|
-
export declare const defaultWorkspaceJSON: LayoutJSON
|
|
7
|
-
preserve: boolean;
|
|
8
|
-
}>;
|
|
9
|
+
export declare const defaultWorkspaceJSON: LayoutJSON;
|
|
9
10
|
export declare const getStackWorkspaceJSON: (activeLayoutIndex?: number) => LayoutJSON;
|
|
10
11
|
export declare const getWorkspaceWithLayoutJSON: (customWorkspaceJSON?: LayoutJSON | LayoutJSON[], layoutJSON?: LayoutJSON | LayoutJSON[], activeLayoutIndex?: number, stackProps?: WorkspaceStackProps) => LayoutJSON | LayoutJSON[];
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export * from "./SaveLayoutPanel";
|
|
2
2
|
export * from "./LayoutList";
|
|
3
|
-
export * from "./WorkspaceProvider";
|
|
4
3
|
export * from "./defaultWorkspaceJSON";
|
|
5
4
|
export * from "./useWorkspaceContextMenuItems";
|
|
5
|
+
export * from "./shell-workspace-components";
|
|
6
|
+
/**
|
|
7
|
+
* The workspace model now lives in @vuu-ui/core. These re-exports keep
|
|
8
|
+
* existing @vuu-ui/vuu-shell imports working.
|
|
9
|
+
*/
|
|
10
|
+
export { APPLICATION_SESSION_VERSION, type ApplicationSessionV1, type ComponentPersistentStateV1, type ComponentStateUpdate, cloneWorkspaceValue, createWorkspaceComponentRegistries, emptyWorkspaceSnapshot, jsonValueWorkspaceComponentCodec, NAMED_WORKSPACE_DEFINITION_VERSION, type NamedWorkspaceDefinitionV1, type NamedWorkspaceMetadataV1, type OpenWorkspaceInstanceV1, StaleWorkspaceScopeError, useComponentPersistentState, useWorkspace, useWorkspacePersistentStateStore, validateApplicationSessionV1, validateNamedWorkspaceDefinitionV1, validateNamedWorkspaceMetadataV1, validateWorkspaceSnapshotRecordV1, validateWorkspaceSnapshotV1, WORKSPACE_SNAPSHOT_RECORD_VERSION, WORKSPACE_SNAPSHOT_VERSION, type WorkspaceComponentRegistration, type WorkspaceComponentRegistries, type WorkspaceContextValue, WorkspaceController, type WorkspaceControllerOptions, WorkspaceHost, type WorkspaceKind, workspaceMetadata, WorkspacePersistentStateProvider, type WorkspacePersistentStateProviderProps, WorkspacePersistentStateStore, type WorkspaceProps, WorkspaceProvider, type WorkspaceProviderProps, WorkspaceRepository, WorkspaceRepositoryDisposedError, type WorkspaceSchemaName, type WorkspaceSnapshotRecordV1, type WorkspaceSnapshotV1, WorkspaceStartPanel, type WorkspaceStatus, type WorkspaceSummary, WorkspaceValidationError, type WorkspaceValidationIssue, } from "@vuu-ui/core";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-context-menu";
|
|
1
|
+
import type { MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-context-menu";
|
|
2
2
|
export declare const useWorkspaceContextMenuItems: () => {
|
|
3
3
|
buildMenuOptions: MenuBuilder;
|
|
4
4
|
handleMenuAction: MenuActionHandler;
|