@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.
Files changed (143) hide show
  1. package/package.json +19 -20
  2. package/src/app-header/AppHeader.css.js +1 -1
  3. package/src/app-header/AppHeader.js +26 -36
  4. package/src/application-provider/ApplicationContext.js +5 -2
  5. package/src/application-provider/ApplicationProvider.js +59 -8
  6. package/src/feature/Feature.js +34 -3
  7. package/src/feature/FeatureErrorBoundary.js +33 -0
  8. package/src/feature/index.js +0 -1
  9. package/src/feature-list/FeatureList.css.js +5 -27
  10. package/src/feature-list/FeatureList.js +96 -117
  11. package/src/index.js +3 -3
  12. package/src/left-nav/LeftNav.css.js +4 -2
  13. package/src/left-nav/LeftNav.js +100 -139
  14. package/src/persistence-manager/PersistenceProvider.js +3 -10
  15. package/src/persistence-manager/index.js +0 -3
  16. package/src/shell-layout-templates/context-panel/ContextPanel.css.js +8 -8
  17. package/src/shell-layout-templates/context-panel/ContextPanel.js +35 -17
  18. package/src/shell-layout-templates/context-panel/index.js +0 -1
  19. package/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +40 -54
  20. package/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +64 -54
  21. package/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +28 -49
  22. package/src/shell-layout-templates/side-panel/SidePanel.css.js +1 -3
  23. package/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +35 -43
  24. package/src/shell.css.js +3 -86
  25. package/src/shell.js +70 -148
  26. package/src/user-settings/SettingsForm.css.js +10 -0
  27. package/src/user-settings/SettingsForm.js +141 -0
  28. package/src/user-settings/UserSettingsPanel.css.js +9 -0
  29. package/src/user-settings/UserSettingsPanel.js +29 -0
  30. package/src/user-settings/index.js +2 -0
  31. package/src/workspace-management/LayoutList.js +99 -59
  32. package/src/workspace-management/SaveLayoutPanel.js +3 -3
  33. package/src/workspace-management/WorkspaceProvider.js +178 -699
  34. package/src/workspace-management/index.js +0 -8
  35. package/src/workspace-management/useWorkspaceContextMenuItems.js +6 -12
  36. package/types/app-header/AppHeader.d.ts +2 -2
  37. package/types/application-provider/ApplicationContext.d.ts +6 -1
  38. package/types/application-provider/ApplicationProvider.d.ts +14 -5
  39. package/types/feature/Feature.d.ts +10 -2
  40. package/types/feature/FeatureErrorBoundary.d.ts +1 -1
  41. package/types/feature/Loader.d.ts +1 -1
  42. package/types/feature/index.d.ts +1 -2
  43. package/types/feature-list/FeatureList.d.ts +4 -4
  44. package/types/index.d.ts +3 -3
  45. package/types/left-nav/LeftNav.d.ts +1 -2
  46. package/types/login/LoginPanel.d.ts +1 -1
  47. package/types/login/VuuLogo.d.ts +1 -1
  48. package/types/persistence-manager/PersistenceProvider.d.ts +3 -7
  49. package/types/persistence-manager/index.d.ts +0 -3
  50. package/types/shell-layout-templates/context-panel/ContextPanel.d.ts +11 -9
  51. package/types/shell-layout-templates/context-panel/index.d.ts +0 -1
  52. package/types/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +1 -1
  53. package/types/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +1 -1
  54. package/types/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +1 -1
  55. package/types/shell-layout-templates/side-panel/SidePanel.d.ts +1 -1
  56. package/types/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +1 -1
  57. package/types/shell-layout-templates/useShellLayout.d.ts +2 -4
  58. package/types/shell.d.ts +15 -19
  59. package/types/theme-switch/ThemeSwitch.d.ts +1 -1
  60. package/types/workspace-management/LayoutList.d.ts +2 -2
  61. package/types/workspace-management/LayoutTile.d.ts +1 -1
  62. package/types/workspace-management/SaveLayoutPanel.d.ts +2 -2
  63. package/types/workspace-management/WorkspaceProvider.d.ts +50 -61
  64. package/types/workspace-management/defaultWorkspaceJSON.d.ts +6 -7
  65. package/types/workspace-management/index.d.ts +0 -8
  66. package/types/workspace-management/useWorkspaceContextMenuItems.d.ts +1 -1
  67. package/src/module-registry/getRegisteredModules.js +0 -12
  68. package/src/persistence-manager/LocalWorkspacePersistenceService.js +0 -129
  69. package/src/persistence-manager/RemoteWorkspacePersistenceService.js +0 -112
  70. package/src/persistence-manager/WorkspacePersistenceService.js +0 -9
  71. package/src/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.js +0 -24
  72. package/src/workspace-management/WorkspaceController.js +0 -73
  73. package/src/workspace-management/WorkspaceHost.js +0 -194
  74. package/src/workspace-management/WorkspacePersistentState.js +0 -67
  75. package/src/workspace-management/WorkspaceRepository.js +0 -127
  76. package/src/workspace-management/WorkspaceStartPanel.css.js +0 -44
  77. package/src/workspace-management/WorkspaceStartPanel.js +0 -34
  78. package/src/workspace-management/shell-workspace-components.js +0 -59
  79. package/src/workspace-management/workspace-component-registry.js +0 -30
  80. package/src/workspace-management/workspace-schemas.js +0 -257
  81. package/types/module-registry/getRegisteredModules.d.ts +0 -5
  82. package/types/persistence-manager/LocalWorkspacePersistenceService.d.ts +0 -18
  83. package/types/persistence-manager/RemoteWorkspacePersistenceService.d.ts +0 -25
  84. package/types/persistence-manager/WorkspacePersistenceService.d.ts +0 -27
  85. package/types/shell-layout-templates/context-panel/ApplicationSettingsContextPanel.d.ts +0 -1
  86. package/types/src/ShellContextProvider.d.ts +0 -7
  87. package/types/src/app-header/AppHeader.d.ts +0 -6
  88. package/types/src/app-header/index.d.ts +0 -1
  89. package/types/src/application-provider/ApplicationContext.d.ts +0 -11
  90. package/types/src/application-provider/ApplicationProvider.d.ts +0 -17
  91. package/types/src/application-provider/index.d.ts +0 -1
  92. package/types/src/feature/Feature.d.ts +0 -10
  93. package/types/src/feature/FeatureErrorBoundary.d.ts +0 -13
  94. package/types/src/feature/Loader.d.ts +0 -1
  95. package/types/src/feature/index.d.ts +0 -1
  96. package/types/src/feature-and-layout-provider/FeatureAndLayoutProvider.d.ts +0 -19
  97. package/types/src/feature-and-layout-provider/index.d.ts +0 -1
  98. package/types/src/feature-list/FeatureList.d.ts +0 -7
  99. package/types/src/feature-list/index.d.ts +0 -1
  100. package/types/src/get-layout-history.d.ts +0 -8
  101. package/types/src/index.d.ts +0 -14
  102. package/types/src/left-nav/LeftNav.d.ts +0 -14
  103. package/types/src/left-nav/index.d.ts +0 -1
  104. package/types/src/login/LoginPanel.d.ts +0 -6
  105. package/types/src/login/VuuLogo.d.ts +0 -1
  106. package/types/src/persistence-manager/LocalPersistenceManager.d.ts +0 -20
  107. package/types/src/persistence-manager/PersistenceManager.d.ts +0 -71
  108. package/types/src/persistence-manager/PersistenceProvider.d.ts +0 -11
  109. package/types/src/persistence-manager/RemotePersistenceManager.d.ts +0 -25
  110. package/types/src/persistence-manager/StaticPersistenceManager.d.ts +0 -25
  111. package/types/src/persistence-manager/index.d.ts +0 -5
  112. package/types/src/shell-layout-templates/context-panel/ContextPanel.d.ts +0 -13
  113. package/types/src/shell-layout-templates/context-panel/index.d.ts +0 -1
  114. package/types/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +0 -2
  115. package/types/src/shell-layout-templates/index.d.ts +0 -3
  116. package/types/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +0 -2
  117. package/types/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +0 -2
  118. package/types/src/shell-layout-templates/side-panel/SidePanel.d.ts +0 -8
  119. package/types/src/shell-layout-templates/side-panel/index.d.ts +0 -1
  120. package/types/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +0 -2
  121. package/types/src/shell-layout-templates/useShellLayout.d.ts +0 -51
  122. package/types/src/shell.d.ts +0 -17
  123. package/types/src/theme-switch/ThemeSwitch.d.ts +0 -8
  124. package/types/src/theme-switch/index.d.ts +0 -1
  125. package/types/src/user-settings/SettingsForm.d.ts +0 -46
  126. package/types/src/user-settings/UserSettingsPanel.d.ts +0 -3
  127. package/types/src/user-settings/index.d.ts +0 -2
  128. package/types/src/workspace-management/LayoutList.d.ts +0 -2
  129. package/types/src/workspace-management/LayoutTile.d.ts +0 -7
  130. package/types/src/workspace-management/SaveLayoutPanel.d.ts +0 -9
  131. package/types/src/workspace-management/WorkspaceProvider.d.ts +0 -52
  132. package/types/src/workspace-management/defaultWorkspaceJSON.d.ts +0 -10
  133. package/types/src/workspace-management/index.d.ts +0 -5
  134. package/types/src/workspace-management/screenshot-utils.d.ts +0 -6
  135. package/types/src/workspace-management/useWorkspaceContextMenuItems.d.ts +0 -5
  136. package/types/workspace-management/WorkspaceController.d.ts +0 -32
  137. package/types/workspace-management/WorkspaceHost.d.ts +0 -1
  138. package/types/workspace-management/WorkspacePersistentState.d.ts +0 -19
  139. package/types/workspace-management/WorkspaceRepository.d.ts +0 -13
  140. package/types/workspace-management/WorkspaceStartPanel.d.ts +0 -1
  141. package/types/workspace-management/shell-workspace-components.d.ts +0 -2
  142. package/types/workspace-management/workspace-component-registry.d.ts +0 -12
  143. package/types/workspace-management/workspace-schemas.d.ts +0 -69
@@ -3,11 +3,3 @@ export * from "./LayoutList.js";
3
3
  export * from "./WorkspaceProvider.js";
4
4
  export * from "./defaultWorkspaceJSON.js";
5
5
  export * from "./useWorkspaceContextMenuItems.js";
6
- export * from "./workspace-schemas.js";
7
- export * from "./WorkspaceRepository.js";
8
- export * from "./WorkspacePersistentState.js";
9
- export * from "./WorkspaceController.js";
10
- export * from "./workspace-component-registry.js";
11
- export * from "./WorkspaceHost.js";
12
- export * from "./WorkspaceStartPanel.js";
13
- export * from "./shell-workspace-components.js";
@@ -4,7 +4,7 @@ import { useCallback, useMemo } from "react";
4
4
  import { SaveLayoutPanel } from "./SaveLayoutPanel.js";
5
5
  import { useWorkspace } from "./WorkspaceProvider.js";
6
6
  const useWorkspaceContextMenuItems = ()=>{
7
- const { activeWorkspace, closeWorkspace, saveActiveWorkspaceAs } = useWorkspace();
7
+ const { saveLayout } = useWorkspace();
8
8
  const { showDialog, closeDialog } = useModal();
9
9
  const handleCloseDialog = useCallback(()=>{
10
10
  closeDialog();
@@ -12,11 +12,11 @@ const useWorkspaceContextMenuItems = ()=>{
12
12
  closeDialog
13
13
  ]);
14
14
  const handleSave = useCallback((layoutMetadata)=>{
15
- saveActiveWorkspaceAs(layoutMetadata.name);
15
+ saveLayout(layoutMetadata);
16
16
  closeDialog();
17
17
  }, [
18
- closeDialog,
19
- saveActiveWorkspaceAs
18
+ saveLayout,
19
+ closeDialog
20
20
  ]);
21
21
  const [buildMenuOptions, handleMenuAction] = useMemo(()=>[
22
22
  (location, options)=>{
@@ -27,8 +27,8 @@ const useWorkspaceContextMenuItems = ()=>{
27
27
  id: "save-layout",
28
28
  options
29
29
  }, {
30
- label: "Close Workspace",
31
- id: "close-workspace",
30
+ label: "Layout Settings",
31
+ id: "layout-settings",
32
32
  options
33
33
  });
34
34
  return menuDescriptors;
@@ -43,15 +43,9 @@ const useWorkspaceContextMenuItems = ()=>{
43
43
  }), "Save Layout", [], true);
44
44
  return true;
45
45
  }
46
- if ("close-workspace" === menuItemId && activeWorkspace) {
47
- closeWorkspace(activeWorkspace.instanceId);
48
- return true;
49
- }
50
46
  return false;
51
47
  }
52
48
  ], [
53
- activeWorkspace,
54
- closeWorkspace,
55
49
  handleCloseDialog,
56
50
  handleSave,
57
51
  showDialog
@@ -1,6 +1,6 @@
1
1
  import type { ThemeMode } from "@vuu-ui/vuu-utils";
2
- import { type HTMLAttributes } from "react";
2
+ import { 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.Element;
6
+ export declare const AppHeader: ({ className: classNameProp, themeMode: _, ...htmlAttributes }: AppHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,11 @@
1
- import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
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";
2
4
  export interface ApplicationContextProps {
3
5
  onUserSettingChanged: (propertyName: string, value: VuuRowDataItemType) => void;
4
6
  logout?: () => void;
7
+ userSettings?: Settings;
8
+ userSettingsSchema?: SettingsSchema;
9
+ user: VuuUser;
5
10
  }
6
11
  export declare const ApplicationContext: import("react").Context<ApplicationContextProps>;
@@ -1,8 +1,17 @@
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> {
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">> {
5
6
  children: ReactNode;
6
7
  density?: Density;
7
8
  }
8
- export declare const ApplicationProvider: ({ children, density: densityProp, logout, mode, theme, }: ApplicationProviderProps) => ReactElement | null;
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;
@@ -1,2 +1,10 @@
1
- /** @deprecated Use RemoteModule from @vuu-ui/core/portal. */
2
- export declare const Feature: import("react").MemoExoticComponent<(props: import("@vuu-ui/core/portal").RemoteModuleProps<object>) => import("react").JSX.Element>;
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 {};
@@ -9,5 +9,5 @@ export declare class FeatureErrorBoundary extends React.Component<FeatureErrorBo
9
9
  errorMessage: string;
10
10
  };
11
11
  componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
12
- render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
12
+ render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | null | undefined;
13
13
  }
@@ -1 +1 @@
1
- export declare const Loader: () => import("react").JSX.Element;
1
+ export declare const Loader: () => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1 @@
1
- export * from "./Feature";
2
- export { RemoteModule, type RemoteModuleProps, } from "@vuu-ui/core/portal";
1
+ export * from './Feature';
@@ -1,7 +1,7 @@
1
- import { type DynamicFeatureProps, type StaticFeatureDescriptor } from "@vuu-ui/vuu-utils";
2
- import { type HTMLAttributes } from "react";
1
+ import { DynamicFeatureProps, StaticFeatureDescriptor } from "@vuu-ui/vuu-utils";
2
+ import { 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
- readonly features: DynamicFeatureProps[] | GroupedFeatureProps | StaticFeatureDescriptor[];
5
+ features: DynamicFeatureProps[] | GroupedFeatureProps | StaticFeatureDescriptor[];
6
6
  }
7
- export declare const FeatureList: ({ features, title, ...htmlAttributes }: FeatureListProps) => import("react").JSX.Element;
7
+ export declare const FeatureList: ({ features, title, ...htmlAttributes }: FeatureListProps) => import("react/jsx-runtime").JSX.Element;
package/types/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- export * from "./app-header";
2
1
  export * from "./application-provider";
2
+ export * from "./app-header";
3
3
  export * from "./feature";
4
4
  export * from "./feature-and-layout-provider";
5
- export * from "./feature-list";
6
5
  export * from "./left-nav";
7
6
  export { LoginPanel, type LoginPanelProps } from "./login/LoginPanel";
8
- export { getRegisteredModules } from './module-registry/getRegisteredModules';
9
7
  export * from "./persistence-manager";
10
8
  export * from "./shell";
11
9
  export * from "./shell-layout-templates";
12
10
  export * from "./ShellContextProvider";
11
+ export * from "./feature-list";
13
12
  export * from "./theme-switch";
13
+ export * from "./user-settings";
14
14
  export * from "./workspace-management";
@@ -7,9 +7,8 @@ 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;
11
10
  sizeCollapsed?: number;
12
11
  sizeContent?: number;
13
12
  sizeExpanded?: number;
14
13
  }
15
- export declare const LeftNav: (props: LeftNavProps) => import("react").JSX.Element;
14
+ export declare const LeftNav: (props: LeftNavProps) => import("react/jsx-runtime").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.Element;
6
+ export declare const LoginPanel: ({ appName, className, onSubmit, ...htmlAttributes }: LoginPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export declare const VuuLogo: () => import("react").JSX.Element;
1
+ export declare const VuuLogo: () => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,11 @@
1
- import { type ReactElement, type ReactNode } from "react";
2
- import type { IPersistenceManager } from "./PersistenceManager";
3
- import type { WorkspacePersistenceService } from "./WorkspacePersistenceService";
1
+ import { ReactElement, ReactNode } from "react";
2
+ import { IPersistenceManager } from ".";
4
3
  export interface PersistenceContextProps {
5
4
  persistenceManager?: IPersistenceManager;
6
- workspacePersistenceService?: WorkspacePersistenceService;
7
5
  }
8
6
  export declare const PersistenceContext: import("react").Context<PersistenceContextProps>;
9
7
  export interface PersistenceProviderProps extends PersistenceContextProps {
10
8
  children: ReactNode;
11
9
  }
12
- export declare const PersistenceProvider: ({ children, persistenceManager, workspacePersistenceService, }: PersistenceProviderProps) => ReactElement;
10
+ export declare const PersistenceProvider: ({ children, persistenceManager, }: PersistenceProviderProps) => ReactElement;
13
11
  export declare const usePersistenceManager: () => IPersistenceManager | undefined;
14
- export declare const useWorkspacePersistenceService: () => WorkspacePersistenceService;
15
- export declare const useOptionalWorkspacePersistenceService: () => WorkspacePersistenceService | undefined;
@@ -3,6 +3,3 @@ export * from "./PersistenceProvider";
3
3
  export * from "./LocalPersistenceManager";
4
4
  export * from "./RemotePersistenceManager";
5
5
  export * from "./StaticPersistenceManager";
6
- export * from "./WorkspacePersistenceService";
7
- export * from "./LocalWorkspacePersistenceService";
8
- export * from "./RemoteWorkspacePersistenceService";
@@ -1,11 +1,13 @@
1
- import { type ReactElement, type ReactNode } from "react";
1
+ import { LayoutJSON } from "@vuu-ui/vuu-utils";
2
+ import { ReactElement, ReactNode } from "react";
2
3
  export interface ContextPanelProps {
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;
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;
10
12
  }
11
- export declare const ContextPanel: ({ className, content, expanded, id, onClose, overlay, title, }: ContextPanelProps) => import("react").JSX.Element;
13
+ export declare const ContextPanel: ({ className: classNameProp, expanded, content: contentProp, id, onClose, overlay, title, }: ContextPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1 @@
1
1
  export * from "./ContextPanel";
2
- export * from "./ApplicationSettingsContextPanel";
@@ -1,2 +1,2 @@
1
- import type { ShellLayoutTemplateHook } from "../useShellLayout";
1
+ import { ShellLayoutTemplateHook } from "../useShellLayout";
2
2
  export declare const useFullHeightLeftPanel: ShellLayoutTemplateHook;
@@ -1,2 +1,2 @@
1
- import type { ShellLayoutTemplateHook } from "../useShellLayout";
1
+ import { ShellLayoutTemplateHook } from "../useShellLayout";
2
2
  export declare const useInlayLeftPanel: ShellLayoutTemplateHook;
@@ -1,2 +1,2 @@
1
- import type { ShellLayoutTemplateHook } from "../useShellLayout";
1
+ import { 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.Element;
8
+ export declare const SidePanel: ({ children, open, sizeClosed, sizeOpen, style: styleProp, ...htmlAttributes }: SidePanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import type { ShellLayoutTemplateHook } from "../useShellLayout";
1
+ import { ShellLayoutTemplateHook } from "../useShellLayout";
2
2
  export declare const useSimpleContentPane: ShellLayoutTemplateHook;
@@ -1,5 +1,5 @@
1
- import type { HTMLAttributes, ReactElement, ReactNode } from "react";
2
- import type { SidePanelProps as ShellSidePanelProps } from "./side-panel";
1
+ import { HTMLAttributes, ReactElement, ReactNode } from "react";
2
+ import { SidePanelProps as ShellSidePanelProps } from "./side-panel";
3
3
  declare const LayoutHook: {
4
4
  "full-height": ShellLayoutTemplateHook;
5
5
  inlay: ShellLayoutTemplateHook;
@@ -41,8 +41,6 @@ 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;
46
44
  }
47
45
  /**
48
46
  * This hook acts as a stub for the actual shell layout
package/types/shell.d.ts CHANGED
@@ -1,21 +1,17 @@
1
+ import { VuuUser } from "@vuu-ui/vuu-utils";
1
2
  import { type HTMLAttributes, type ReactNode } from "react";
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;
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;
14
16
  }
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;
17
+ export declare const Shell: ({ logout, user, userSettingsSchema, workspaceProps, ...props }: ShellProps) => import("react/jsx-runtime").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.Element;
8
+ export declare const ThemeSwitch: ({ className: classNameProp, defaultMode: defaultModeProp, mode: modeProp, onChange, ...htmlAttributes }: ThemeSwitchProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import type { HTMLAttributes } from "react";
2
- export declare const LayoutList: ({ className, title, ...htmlAttributes }: HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
1
+ import { HTMLAttributes } from "react";
2
+ export declare const LayoutList: ({ className, title, ...htmlAttributes }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").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.Element;
7
+ export declare const LayoutTile: ({ metadata, onLoadLayout, ...htmlAttributes }: LayoutTileProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
- import type { LayoutMetadataDto } from "@vuu-ui/vuu-utils";
1
+ import { LayoutMetadataDto } from "@vuu-ui/vuu-utils";
2
2
  type SaveLayoutPanelProps = {
3
3
  componentId?: string;
4
4
  defaultTitle?: string;
5
5
  onCancel: () => void;
6
6
  onSave: (layoutMetadata: LayoutMetadataDto) => void;
7
7
  };
8
- export declare const SaveLayoutPanel: (props: SaveLayoutPanelProps) => import("react").JSX.Element;
8
+ export declare const SaveLayoutPanel: (props: SaveLayoutPanelProps) => import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -1,63 +1,52 @@
1
- import { type GridComponentRendererRegistry, type GridComponentSettingsRegistry, type JsonValue } from "@vuu-ui/grid-layout";
2
- import type { LayoutJSON } from "@vuu-ui/vuu-utils";
3
- import { type ReactElement, type ReactNode } from "react";
4
- import { type WorkspacePersistenceService } from "../persistence-manager";
5
- import { WorkspaceController } from "./WorkspaceController";
6
- import { type NamedWorkspaceDefinitionV1, type NamedWorkspaceMetadataV1, type WorkspaceSnapshotV1 } from "./workspace-schemas";
7
- export declare const emptyWorkspaceSnapshot: WorkspaceSnapshotV1;
8
- export type WorkspaceStatus = "empty" | "error" | "loading" | "ready";
9
- export interface WorkspaceProps {
10
- /** @deprecated Migrate this layout to defaultWorkspace. */
11
- readonly activeLayoutIndex?: number;
12
- readonly componentRenderers?: GridComponentRendererRegistry;
13
- readonly defaultWorkspace?: WorkspaceSnapshotV1;
14
- /** @deprecated Migrate this layout to defaultWorkspace. */
15
- readonly layoutJSON?: LayoutJSON | readonly LayoutJSON[];
16
- /** @deprecated Workspace snapshots contain their own placeholders. */
17
- readonly layoutPlaceholderJSON?: LayoutJSON;
18
- readonly settingsCodecs?: GridComponentSettingsRegistry;
19
- /** @deprecated Tabs are managed by WorkspaceHost. */
20
- readonly showTabs?: boolean | "left" | "right";
21
- readonly systemWorkspaces?: readonly NamedWorkspaceDefinitionV1[];
22
- /** @deprecated Tabs are managed by WorkspaceHost. */
23
- readonly TabstripProps?: Readonly<Record<string, unknown>>;
24
- /** @deprecated Migrate this layout to defaultWorkspace. */
25
- readonly workspaceJSON?: LayoutJSON | readonly LayoutJSON[];
26
- }
1
+ import { LayoutMetadata, LayoutMetadataDto, type ApplicationSetting, type ApplicationSettings, type LayoutJSON } from "@vuu-ui/vuu-utils";
2
+ import { ReactElement } from "react";
3
+ import { type WorkspaceStackProps } from "./defaultWorkspaceJSON";
4
+ export type WorkspaceProps = WorkspaceStackProps & {
5
+ layoutPlaceholderJSON?: LayoutJSON;
6
+ /**
7
+ * layoutJSON defines the default layout to render on first load and until such time as
8
+ * layout state has been persisted. After that, the persisted state will be rendered.
9
+ */
10
+ layoutJSON?: LayoutJSON | LayoutJSON[];
11
+ activeLayoutIndex?: number;
12
+ /**
13
+ * The Vuu workspace is the container into which layouts are loaded. By default, it will be
14
+ * a Tabbed Panel (Stack + Tabstrip), showing a tab per Layout.
15
+ */
16
+ workspaceJSON?: LayoutJSON | LayoutJSON[];
17
+ };
27
18
  export interface WorkspaceProviderProps extends WorkspaceProps {
28
- readonly children: ReactNode;
29
- readonly persistenceService?: WorkspacePersistenceService;
30
- readonly userId?: string;
31
- }
32
- export interface WorkspaceContextValue {
33
- readonly activeWorkspace?: WorkspaceController;
34
- readonly activeWorkspaceInstanceId: string | null;
35
- readonly closeWorkspace: (instanceId: string) => Promise<void>;
36
- readonly componentRenderers?: GridComponentRendererRegistry;
37
- readonly controllers: readonly WorkspaceController[];
38
- readonly createWorkspaceFromSnapshot: (snapshot: WorkspaceSnapshotV1, title?: string) => Promise<string>;
39
- readonly deleteNamedWorkspace: (definitionId: string) => Promise<void>;
40
- readonly error?: Error;
41
- readonly getApplicationSetting: (key: string) => JsonValue | undefined;
42
- readonly getApplicationSettings: (key?: string) => JsonValue | Readonly<Record<string, JsonValue>> | undefined;
43
- readonly namedWorkspaces: readonly NamedWorkspaceMetadataV1[];
44
- readonly openNamedWorkspace: (definitionId: string) => Promise<void>;
45
- readonly openSystemWorkspace: (definition: NamedWorkspaceDefinitionV1) => Promise<void>;
46
- readonly renameWorkspace: (instanceId: string, title: string) => Promise<void>;
47
- readonly saveActiveWorkspaceAs: (name: string, description?: string) => Promise<void>;
48
- readonly saveApplicationSettings: (settings: JsonValue, key?: string) => Promise<void>;
49
- readonly selectWorkspace: (instanceId: string) => Promise<void>;
50
- readonly setApplicationSetting: (key: string, value: JsonValue) => Promise<void>;
51
- readonly settings: Readonly<Record<string, JsonValue>>;
52
- readonly settingsCodecs?: GridComponentSettingsRegistry;
53
- /** Identifies the authenticated persistence scope. Changes synchronously on a scope transition. */
54
- readonly scopeIdentity: string;
55
- readonly status: WorkspaceStatus;
56
- readonly systemWorkspaces: readonly NamedWorkspaceDefinitionV1[];
57
- readonly resetApplication: () => Promise<void>;
58
- }
59
- export declare class StaleWorkspaceScopeError extends Error {
60
- constructor();
19
+ children: ReactElement | ReactElement[];
20
+ /**
21
+ * layoutPlaceholderJSON defines the layout to render when a new workspace layout is created.
22
+ */
23
+ layoutPlaceholderJSON?: LayoutJSON;
61
24
  }
62
- export declare const WorkspaceProvider: ({ activeLayoutIndex, children, componentRenderers, defaultWorkspace, layoutJSON, layoutPlaceholderJSON, persistenceService: serviceProp, settingsCodecs, showTabs, systemWorkspaces, TabstripProps, userId, workspaceJSON, }: WorkspaceProviderProps) => ReactElement;
63
- export declare const useWorkspace: () => WorkspaceContextValue;
25
+ /**
26
+ * LayoutManagementProvider supplies an API for loading and saving layout documents.
27
+ * Initial layout is automatically loaded on startup. Because this hook is responsible
28
+ * only for loading and saving layouts, it only triggers a render when content is loaded.
29
+ *
30
+ * Initial layout displays a loading state
31
+ * User may supply a default layout. This will not be displayed until call has been made to
32
+ * persistenceManager to retrieve stored layout state. If no stored state is returned, the
33
+ * default layout provided by user will be set as current state (and hence rendered). If no
34
+ * default layout has been provided by user, the sysem default will be used (simple PlaceHolder)
35
+ * If saved layout state has been returned, that will be set as current state (and rendered)
36
+ *
37
+ */
38
+ export declare const WorkspaceProvider: ({ TabstripProps, children, layoutJSON, activeLayoutIndex, layoutPlaceholderJSON, showTabs, workspaceJSON: customWorkspaceJSON, }: WorkspaceProviderProps) => import("react/jsx-runtime").JSX.Element;
39
+ export declare const useWorkspace: () => {
40
+ layoutMetadata: LayoutMetadata[];
41
+ layoutPlaceholderJSON?: LayoutJSON;
42
+ getApplicationSettings: (key?: keyof ApplicationSettings) => ApplicationSettings | ApplicationSetting | undefined;
43
+ loadLayoutById: (id: string) => void;
44
+ saveApplicationSettings: (settings: ApplicationSettings | ApplicationSetting, key?: keyof ApplicationSettings) => void;
45
+ saveLayout: (n: LayoutMetadataDto) => void;
46
+ saveApplicationLayout: (layout: LayoutJSON) => void;
47
+ workspaceJSON: LayoutJSON<{
48
+ [key: string]: any;
49
+ }>[] | LayoutJSON<{
50
+ [key: string]: any;
51
+ }>;
52
+ };
@@ -1,11 +1,10 @@
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
- }
1
+ import { StackProps } from "@vuu-ui/vuu-layout";
2
+ import { LayoutJSON } from "@vuu-ui/vuu-utils";
3
+ export type WorkspaceStackProps = Pick<StackProps, "showTabs" | "TabstripProps">;
7
4
  export declare const warningLayout: LayoutJSON;
8
5
  export declare const loadingJSON: Readonly<LayoutJSON>;
9
- export declare const defaultWorkspaceJSON: LayoutJSON;
6
+ export declare const defaultWorkspaceJSON: LayoutJSON<StackProps & {
7
+ preserve: boolean;
8
+ }>;
10
9
  export declare const getStackWorkspaceJSON: (activeLayoutIndex?: number) => LayoutJSON;
11
10
  export declare const getWorkspaceWithLayoutJSON: (customWorkspaceJSON?: LayoutJSON | LayoutJSON[], layoutJSON?: LayoutJSON | LayoutJSON[], activeLayoutIndex?: number, stackProps?: WorkspaceStackProps) => LayoutJSON | LayoutJSON[];
@@ -3,11 +3,3 @@ export * from "./LayoutList";
3
3
  export * from "./WorkspaceProvider";
4
4
  export * from "./defaultWorkspaceJSON";
5
5
  export * from "./useWorkspaceContextMenuItems";
6
- export * from "./workspace-schemas";
7
- export * from "./WorkspaceRepository";
8
- export * from "./WorkspacePersistentState";
9
- export * from "./WorkspaceController";
10
- export * from "./workspace-component-registry";
11
- export * from "./WorkspaceHost";
12
- export * from "./WorkspaceStartPanel";
13
- export * from "./shell-workspace-components";
@@ -1,4 +1,4 @@
1
- import type { MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-context-menu";
1
+ import { MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-context-menu";
2
2
  export declare const useWorkspaceContextMenuItems: () => {
3
3
  buildMenuOptions: MenuBuilder;
4
4
  handleMenuAction: MenuActionHandler;
@@ -1,12 +0,0 @@
1
- const getRegisteredModules = async (registryUrl, bearerToken)=>{
2
- console.log(`getRegisteredModules ${registryUrl}`);
3
- const response = await fetch(registryUrl, {
4
- cache: "no-store",
5
- headers: {
6
- Authorization: `Bearer ${bearerToken}`
7
- }
8
- });
9
- if (!response.ok) throw Error("bad return from module registry");
10
- return await response.json();
11
- };
12
- export { getRegisteredModules };