@vuu-ui/vuu-shell 4.0.1 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/package.json +20 -18
  2. package/src/app-header/AppHeader.js +36 -26
  3. package/src/application-provider/ApplicationContext.js +2 -5
  4. package/src/application-provider/ApplicationProvider.js +8 -59
  5. package/src/feature/Feature.js +3 -34
  6. package/src/feature/index.js +1 -0
  7. package/src/feature-list/FeatureList.css.js +27 -5
  8. package/src/feature-list/FeatureList.js +117 -96
  9. package/src/index.js +3 -3
  10. package/src/left-nav/LeftNav.css.js +2 -4
  11. package/src/left-nav/LeftNav.js +139 -100
  12. package/src/module-registry/getRegisteredModules.js +12 -0
  13. package/src/persistence-manager/PersistenceProvider.js +9 -4
  14. package/src/persistence-manager/index.js +1 -0
  15. package/src/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.js +24 -0
  16. package/src/shell-layout-templates/context-panel/ContextPanel.css.js +8 -8
  17. package/src/shell-layout-templates/context-panel/ContextPanel.js +17 -35
  18. package/src/shell-layout-templates/context-panel/index.js +1 -0
  19. package/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +54 -40
  20. package/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +54 -64
  21. package/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +49 -28
  22. package/src/shell-layout-templates/side-panel/SidePanel.css.js +3 -1
  23. package/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +43 -35
  24. package/src/shell.css.js +85 -2
  25. package/src/shell.js +148 -70
  26. package/src/workspace-management/LayoutList.js +60 -100
  27. package/src/workspace-management/SaveLayoutPanel.js +3 -3
  28. package/src/workspace-management/index.js +2 -1
  29. package/src/workspace-management/shell-workspace-components.js +59 -0
  30. package/src/workspace-management/useWorkspaceContextMenuItems.js +13 -8
  31. package/types/app-header/AppHeader.d.ts +2 -2
  32. package/types/application-provider/ApplicationContext.d.ts +1 -6
  33. package/types/application-provider/ApplicationProvider.d.ts +5 -14
  34. package/types/feature/Feature.d.ts +2 -10
  35. package/types/feature/Loader.d.ts +1 -1
  36. package/types/feature/index.d.ts +2 -1
  37. package/types/feature-list/FeatureList.d.ts +4 -4
  38. package/types/index.d.ts +3 -3
  39. package/types/left-nav/LeftNav.d.ts +2 -1
  40. package/types/login/LoginPanel.d.ts +1 -1
  41. package/types/login/VuuLogo.d.ts +1 -1
  42. package/types/persistence-manager/PersistenceProvider.d.ts +6 -3
  43. package/types/persistence-manager/index.d.ts +1 -0
  44. package/types/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.d.ts +1 -1
  45. package/types/shell-layout-templates/context-panel/ContextPanel.d.ts +9 -11
  46. package/types/shell-layout-templates/context-panel/index.d.ts +1 -0
  47. package/types/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +1 -1
  48. package/types/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +1 -1
  49. package/types/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +1 -1
  50. package/types/shell-layout-templates/side-panel/SidePanel.d.ts +1 -1
  51. package/types/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +1 -1
  52. package/types/shell-layout-templates/useShellLayout.d.ts +4 -2
  53. package/types/shell.d.ts +19 -15
  54. package/types/theme-switch/ThemeSwitch.d.ts +1 -1
  55. package/types/workspace-management/LayoutList.d.ts +2 -2
  56. package/types/workspace-management/LayoutTile.d.ts +1 -1
  57. package/types/workspace-management/SaveLayoutPanel.d.ts +2 -2
  58. package/types/workspace-management/defaultWorkspaceJSON.d.ts +7 -6
  59. package/types/workspace-management/index.d.ts +6 -1
  60. package/types/workspace-management/useWorkspaceContextMenuItems.d.ts +1 -1
  61. package/src/feature/FeatureErrorBoundary.js +0 -33
  62. package/src/user-settings/SettingsForm.css.js +0 -10
  63. package/src/user-settings/SettingsForm.js +0 -141
  64. package/src/user-settings/UserSettingsPanel.css.js +0 -9
  65. package/src/user-settings/UserSettingsPanel.js +0 -29
  66. package/src/user-settings/index.js +0 -2
  67. package/src/workspace-management/WorkspaceProvider.js +0 -209
  68. package/types/feature/FeatureErrorBoundary.d.ts +0 -13
  69. package/types/persistence-manager/LocalWorkspacePersistenceService.d.ts +0 -18
  70. package/types/persistence-manager/RemoteWorkspacePersistenceService.d.ts +0 -25
  71. package/types/persistence-manager/WorkspacePersistenceService.d.ts +0 -27
  72. package/types/src/ShellContextProvider.d.ts +0 -7
  73. package/types/src/app-header/AppHeader.d.ts +0 -6
  74. package/types/src/app-header/index.d.ts +0 -1
  75. package/types/src/application-provider/ApplicationContext.d.ts +0 -11
  76. package/types/src/application-provider/ApplicationProvider.d.ts +0 -17
  77. package/types/src/application-provider/index.d.ts +0 -1
  78. package/types/src/feature/Feature.d.ts +0 -10
  79. package/types/src/feature/FeatureErrorBoundary.d.ts +0 -13
  80. package/types/src/feature/Loader.d.ts +0 -1
  81. package/types/src/feature/index.d.ts +0 -1
  82. package/types/src/feature-and-layout-provider/FeatureAndLayoutProvider.d.ts +0 -19
  83. package/types/src/feature-and-layout-provider/index.d.ts +0 -1
  84. package/types/src/feature-list/FeatureList.d.ts +0 -7
  85. package/types/src/feature-list/index.d.ts +0 -1
  86. package/types/src/get-layout-history.d.ts +0 -8
  87. package/types/src/index.d.ts +0 -14
  88. package/types/src/left-nav/LeftNav.d.ts +0 -14
  89. package/types/src/left-nav/index.d.ts +0 -1
  90. package/types/src/login/LoginPanel.d.ts +0 -6
  91. package/types/src/login/VuuLogo.d.ts +0 -1
  92. package/types/src/persistence-manager/LocalPersistenceManager.d.ts +0 -20
  93. package/types/src/persistence-manager/PersistenceManager.d.ts +0 -71
  94. package/types/src/persistence-manager/PersistenceProvider.d.ts +0 -11
  95. package/types/src/persistence-manager/RemotePersistenceManager.d.ts +0 -25
  96. package/types/src/persistence-manager/StaticPersistenceManager.d.ts +0 -25
  97. package/types/src/persistence-manager/index.d.ts +0 -5
  98. package/types/src/shell-layout-templates/context-panel/ContextPanel.d.ts +0 -13
  99. package/types/src/shell-layout-templates/context-panel/index.d.ts +0 -1
  100. package/types/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +0 -2
  101. package/types/src/shell-layout-templates/index.d.ts +0 -3
  102. package/types/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +0 -2
  103. package/types/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +0 -2
  104. package/types/src/shell-layout-templates/side-panel/SidePanel.d.ts +0 -8
  105. package/types/src/shell-layout-templates/side-panel/index.d.ts +0 -1
  106. package/types/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +0 -2
  107. package/types/src/shell-layout-templates/useShellLayout.d.ts +0 -51
  108. package/types/src/shell.d.ts +0 -17
  109. package/types/src/theme-switch/ThemeSwitch.d.ts +0 -8
  110. package/types/src/theme-switch/index.d.ts +0 -1
  111. package/types/src/user-settings/SettingsForm.d.ts +0 -46
  112. package/types/src/user-settings/UserSettingsPanel.d.ts +0 -3
  113. package/types/src/user-settings/index.d.ts +0 -2
  114. package/types/src/workspace-management/LayoutList.d.ts +0 -2
  115. package/types/src/workspace-management/LayoutTile.d.ts +0 -7
  116. package/types/src/workspace-management/SaveLayoutPanel.d.ts +0 -9
  117. package/types/src/workspace-management/WorkspaceProvider.d.ts +0 -52
  118. package/types/src/workspace-management/defaultWorkspaceJSON.d.ts +0 -10
  119. package/types/src/workspace-management/index.d.ts +0 -5
  120. package/types/src/workspace-management/screenshot-utils.d.ts +0 -6
  121. package/types/src/workspace-management/useWorkspaceContextMenuItems.d.ts +0 -5
  122. package/types/user-settings/SettingsForm.d.ts +0 -46
  123. package/types/user-settings/UserSettingsPanel.d.ts +0 -3
  124. package/types/user-settings/index.d.ts +0 -2
  125. package/types/workspace-management/WorkspaceController.d.ts +0 -32
  126. package/types/workspace-management/WorkspaceHost.d.ts +0 -1
  127. package/types/workspace-management/WorkspacePersistentState.d.ts +0 -19
  128. package/types/workspace-management/WorkspaceProvider.d.ts +0 -52
  129. package/types/workspace-management/WorkspaceRepository.d.ts +0 -13
  130. package/types/workspace-management/WorkspaceStartPanel.d.ts +0 -1
  131. package/types/workspace-management/workspace-component-registry.d.ts +0 -12
  132. 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 { LayoutTile } from "./LayoutTile.js";
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 { layoutMetadata, loadLayoutById } = useWorkspace();
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__*/ jsx("div", {
27
+ /*#__PURE__*/ jsxs("div", {
121
28
  className: `${classBase}-content`,
122
29
  children: [
123
- sysContent,
124
- ...content
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 { username } = useApplicationUser();
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: username
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/vuu-ui-controls";
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 { saveLayout } = useWorkspace();
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
- saveLayout(layoutMetadata);
14
+ saveActiveWorkspaceAs(layoutMetadata.name);
16
15
  closeDialog();
17
16
  }, [
18
- saveLayout,
19
- closeDialog
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: "Layout Settings",
31
- id: "layout-settings",
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,6 +1,6 @@
1
1
  import type { ThemeMode } from "@vuu-ui/vuu-utils";
2
- import { HTMLAttributes } from "react";
2
+ import { type HTMLAttributes } from "react";
3
3
  export interface AppHeaderProps extends HTMLAttributes<HTMLDivElement> {
4
4
  themeMode?: ThemeMode;
5
5
  }
6
- export declare const AppHeader: ({ className: classNameProp, themeMode: _, ...htmlAttributes }: AppHeaderProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const AppHeader: ({ className: classNameProp, themeMode: _, ...htmlAttributes }: AppHeaderProps) => import("react").JSX.Element;
@@ -1,11 +1,6 @@
1
- import type { Settings, VuuUser } from "@vuu-ui/vuu-utils";
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 { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
2
- import { Density, ThemeContextProps } from "@salt-ds/core";
3
- import { ReactElement, ReactNode } from "react";
4
- import { ApplicationContextProps } from "./ApplicationContext";
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, userSettingsSchema: userSettingsSchema, user, }: ApplicationProviderProps) => ReactElement | null;
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
- import { type DynamicFeatureProps } from "@vuu-ui/vuu-utils";
2
- import React from "react";
3
- declare function RawFeature<Params extends object | undefined>({ url, css, ComponentProps: params, ...props }: DynamicFeatureProps<Params>): import("react/jsx-runtime").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>;
@@ -1 +1 @@
1
- export declare const Loader: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const Loader: () => import("react").JSX.Element;
@@ -1 +1,2 @@
1
- export * from './Feature';
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
- export declare const FeatureList: ({ features, title, ...htmlAttributes }: FeatureListProps) => import("react/jsx-runtime").JSX.Element;
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,8 +7,9 @@ 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;
13
14
  }
14
- export declare const LeftNav: (props: LeftNavProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const LeftNav: (props: LeftNavProps) => import("react").JSX.Element;
@@ -3,4 +3,4 @@ export interface LoginPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, "o
3
3
  appName?: string;
4
4
  onSubmit: (username: string, password: string) => void;
5
5
  }
6
- export declare const LoginPanel: ({ appName, className, onSubmit, ...htmlAttributes }: LoginPanelProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const LoginPanel: ({ appName, className, onSubmit, ...htmlAttributes }: LoginPanelProps) => import("react").JSX.Element;
@@ -1 +1 @@
1
- export declare const VuuLogo: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const VuuLogo: () => import("react").JSX.Element;
@@ -1,11 +1,14 @@
1
- import { ReactElement, ReactNode } from "react";
2
- import { IPersistenceManager } from ".";
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/jsx-runtime").JSX.Element;
1
+ export declare const ApplicationSettingsContextPanel: () => import("react").JSX.Element;
@@ -1,13 +1,11 @@
1
- import { LayoutJSON } from "@vuu-ui/vuu-utils";
2
- import { ReactElement, ReactNode } from "react";
1
+ import { type ReactElement, type ReactNode } from "react";
3
2
  export interface ContextPanelProps {
4
- [key: string]: unknown;
5
- className?: string;
6
- content?: ReactElement | LayoutJSON;
7
- expanded?: boolean;
8
- id?: string;
9
- onClose?: () => void;
10
- overlay?: boolean;
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: classNameProp, expanded, content: contentProp, id, onClose, overlay, title, }: ContextPanelProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const ContextPanel: ({ className, content, expanded, id, onClose, overlay, title, }: ContextPanelProps) => import("react").JSX.Element;
@@ -1 +1,2 @@
1
1
  export * from "./ContextPanel";
2
+ export * from "./ApplicationSettingsContextPanel";
@@ -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;
@@ -5,4 +5,4 @@ export interface SidePanelProps extends HTMLAttributes<HTMLDivElement> {
5
5
  sizeOpen?: number;
6
6
  sizeClosed?: number;
7
7
  }
8
- export declare const SidePanel: ({ children, open, sizeClosed, sizeOpen, style: styleProp, ...htmlAttributes }: SidePanelProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const SidePanel: ({ children, open, sizeClosed, sizeOpen, style: styleProp, ...htmlAttributes }: SidePanelProps) => import("react").JSX.Element;
@@ -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 { SettingsSchema } from "./user-settings";
5
- import { WorkspaceProps } from "./workspace-management";
6
- export type LayoutTemplateName = "full-height" | "inlay";
7
- export interface ShellProps extends HTMLAttributes<HTMLDivElement> {
8
- shellLayoutProps?: ShellLayoutProps;
9
- userSettingsSchema?: SettingsSchema;
10
- workspaceProps?: WorkspaceProps;
11
- children?: ReactNode;
12
- logout?: () => void;
13
- saveUrl?: string;
14
- serverUrl?: string;
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 declare const Shell: ({ logout, user, userSettingsSchema, workspaceProps, ...props }: ShellProps) => import("react/jsx-runtime").JSX.Element;
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;
@@ -5,4 +5,4 @@ export interface ThemeSwitchProps extends Omit<HTMLAttributes<HTMLDivElement>, "
5
5
  mode?: ThemeMode;
6
6
  onChange: (mode: ThemeMode) => void;
7
7
  }
8
- export declare const ThemeSwitch: ({ className: classNameProp, defaultMode: defaultModeProp, mode: modeProp, onChange, ...htmlAttributes }: ThemeSwitchProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const ThemeSwitch: ({ className: classNameProp, defaultMode: defaultModeProp, mode: modeProp, onChange, ...htmlAttributes }: ThemeSwitchProps) => import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
- import { HTMLAttributes } from "react";
2
- export declare const LayoutList: ({ className, title, ...htmlAttributes }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
1
+ import type { HTMLAttributes } from "react";
2
+ export declare const LayoutList: ({ className, title, ...htmlAttributes }: HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
@@ -4,4 +4,4 @@ export interface LayoutTileProps extends HTMLAttributes<HTMLDivElement> {
4
4
  metadata: LayoutMetadata | SystemLayoutMetadata;
5
5
  onLoadLayout: (layoutId?: string, layoutJSON?: LayoutJSON) => void;
6
6
  }
7
- export declare const LayoutTile: ({ metadata, onLoadLayout, ...htmlAttributes }: LayoutTileProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const LayoutTile: ({ metadata, onLoadLayout, ...htmlAttributes }: LayoutTileProps) => import("react").JSX.Element;