@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
package/types/src/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from "./application-provider";
|
|
2
|
-
export * from "./app-header";
|
|
3
|
-
export * from "./feature";
|
|
4
|
-
export * from "./feature-and-layout-provider";
|
|
5
|
-
export * from "./left-nav";
|
|
6
|
-
export { LoginPanel, type LoginPanelProps } from "./login/LoginPanel";
|
|
7
|
-
export * from "./persistence-manager";
|
|
8
|
-
export * from "./shell";
|
|
9
|
-
export * from "./shell-layout-templates";
|
|
10
|
-
export * from "./ShellContextProvider";
|
|
11
|
-
export * from "./feature-list";
|
|
12
|
-
export * from "./theme-switch";
|
|
13
|
-
export * from "./user-settings";
|
|
14
|
-
export * from "./workspace-management";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "react";
|
|
2
|
-
export type NavDisplayStatus = "menu-full" | "menu-icons" | "menu-full-content" | "menu-icons-content";
|
|
3
|
-
export type NavDisplayStatusHandler = (navDisplayStatus: NavDisplayStatus) => void;
|
|
4
|
-
export interface LeftNavProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
"data-path"?: string;
|
|
6
|
-
defaultActiveTabIndex?: number;
|
|
7
|
-
defaultExpanded?: boolean;
|
|
8
|
-
onActiveChange?: (activeTabIndex: number) => void;
|
|
9
|
-
onTogglePrimaryMenu?: (expanded: boolean) => void;
|
|
10
|
-
sizeCollapsed?: number;
|
|
11
|
-
sizeContent?: number;
|
|
12
|
-
sizeExpanded?: number;
|
|
13
|
-
}
|
|
14
|
-
export declare const LeftNav: (props: LeftNavProps) => import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./LeftNav";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
2
|
-
export interface LoginPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSubmit"> {
|
|
3
|
-
appName?: string;
|
|
4
|
-
onSubmit: (username: string, password: string) => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const LoginPanel: ({ appName, className, onSubmit, ...htmlAttributes }: LoginPanelProps) => import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const VuuLogo: () => import("react").JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ApplicationJSON, LayoutJSON, Settings, Layout, LayoutMetadata, LayoutMetadataDto } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import { IPersistenceManager } from "./PersistenceManager";
|
|
3
|
-
export declare class LocalPersistenceManager implements IPersistenceManager {
|
|
4
|
-
#private;
|
|
5
|
-
constructor(userName: string, urlKey?: string);
|
|
6
|
-
clearUserSettings(): void;
|
|
7
|
-
createLayout(metadata: LayoutMetadataDto, layout: LayoutJSON): Promise<LayoutMetadata>;
|
|
8
|
-
updateLayout(id: string, newMetadata: LayoutMetadataDto, newLayout: LayoutJSON): Promise<void>;
|
|
9
|
-
deleteLayout(id: string): Promise<void>;
|
|
10
|
-
loadLayout(id: string): Promise<LayoutJSON>;
|
|
11
|
-
loadMetadata(): Promise<LayoutMetadata[]>;
|
|
12
|
-
loadApplicationJSON(): Promise<ApplicationJSON | undefined>;
|
|
13
|
-
saveApplicationJSON(applicationJSON: ApplicationJSON): Promise<void>;
|
|
14
|
-
loadLayouts: () => Promise<Layout[]>;
|
|
15
|
-
saveLayoutsWithMetadata: (layouts: Layout[], metadata: LayoutMetadata[]) => void;
|
|
16
|
-
validateIds: (id: string) => Promise<void>;
|
|
17
|
-
validateId: (id: string, dataType: "metadata" | "layout") => Promise<void>;
|
|
18
|
-
getUserSettings(): Promise<Settings>;
|
|
19
|
-
saveUserSettings(userSettings: Settings): void;
|
|
20
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { ApplicationJSON, LayoutJSON, LayoutMetadata, LayoutMetadataDto, Settings } from "@vuu-ui/vuu-utils";
|
|
2
|
-
export interface IPersistenceManager {
|
|
3
|
-
/**
|
|
4
|
-
* Clear saved user settings/preferences. Right now, this clears ALL saved
|
|
5
|
-
* settimgs for user. We will introduce a more fine grained scheme here.
|
|
6
|
-
*/
|
|
7
|
-
clearUserSettings: () => void;
|
|
8
|
-
/**
|
|
9
|
-
* Saves a new layout and its corresponding metadata
|
|
10
|
-
*
|
|
11
|
-
* @param metadata - Metadata about the layout to be saved
|
|
12
|
-
* @param layout - Full JSON representation of the layout to be saved
|
|
13
|
-
*
|
|
14
|
-
* @returns Unique identifier assigned to the saved layout
|
|
15
|
-
*/
|
|
16
|
-
createLayout: (metadata: LayoutMetadataDto, layout: LayoutJSON) => Promise<LayoutMetadata>;
|
|
17
|
-
/**
|
|
18
|
-
* Overwrites an existing layout and its corresponding metadata with the provided information
|
|
19
|
-
*
|
|
20
|
-
* @param id - Unique identifier of the existing layout to be updated
|
|
21
|
-
* @param metadata - Metadata describing the new layout to overwrite with
|
|
22
|
-
* @param layout - Full JSON representation of the new layout to overwrite with
|
|
23
|
-
*/
|
|
24
|
-
updateLayout: (id: string, metadata: LayoutMetadataDto, layout: LayoutJSON) => Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Deletes an existing layout and its corresponding metadata
|
|
27
|
-
*
|
|
28
|
-
* @param id - Unique identifier of the existing layout to be deleted
|
|
29
|
-
*/
|
|
30
|
-
deleteLayout: (id: string) => Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Retrieves an existing layout
|
|
33
|
-
*
|
|
34
|
-
* @param id - Unique identifier of the existing layout to be retrieved
|
|
35
|
-
*
|
|
36
|
-
* @returns Full JSON representation of the layout corresponding to the provided ID
|
|
37
|
-
*/
|
|
38
|
-
loadLayout: (id: string) => Promise<LayoutJSON>;
|
|
39
|
-
/**
|
|
40
|
-
* Retrieves metadata for all existing layouts
|
|
41
|
-
*
|
|
42
|
-
* @returns an array of all persisted layout metadata
|
|
43
|
-
*/
|
|
44
|
-
loadMetadata: () => Promise<LayoutMetadata[]>;
|
|
45
|
-
/**
|
|
46
|
-
* Retrieves the application JSON. This includes the application layout,
|
|
47
|
-
* which describes all layouts on screen
|
|
48
|
-
*
|
|
49
|
-
* @returns Full JSON representation of the application json
|
|
50
|
-
*/
|
|
51
|
-
loadApplicationJSON: () => Promise<ApplicationJSON | undefined>;
|
|
52
|
-
/**
|
|
53
|
-
* Saves the application JSON. This includes the application layout,
|
|
54
|
-
* which describes all layouts on screen
|
|
55
|
-
*
|
|
56
|
-
* @param layout - Full JSON representation of the application layout to be saved
|
|
57
|
-
*/
|
|
58
|
-
saveApplicationJSON: (layout: ApplicationJSON) => Promise<void>;
|
|
59
|
-
/**
|
|
60
|
-
* Save user settings. These get saved within the Application JSON.
|
|
61
|
-
*
|
|
62
|
-
* @param userSettings
|
|
63
|
-
*/
|
|
64
|
-
saveUserSettings: (userSettings: Settings) => void;
|
|
65
|
-
/**
|
|
66
|
-
* Get the user settings. These are stored within Application JSON.
|
|
67
|
-
*
|
|
68
|
-
* @returns userSettings
|
|
69
|
-
*/
|
|
70
|
-
getUserSettings: () => Promise<Settings>;
|
|
71
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from "react";
|
|
2
|
-
import { IPersistenceManager } from ".";
|
|
3
|
-
export interface PersistenceContextProps {
|
|
4
|
-
persistenceManager?: IPersistenceManager;
|
|
5
|
-
}
|
|
6
|
-
export declare const PersistenceContext: import("react").Context<PersistenceContextProps>;
|
|
7
|
-
export interface PersistenceProviderProps extends PersistenceContextProps {
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare const PersistenceProvider: ({ children, persistenceManager, }: PersistenceProviderProps) => ReactElement;
|
|
11
|
-
export declare const usePersistenceManager: () => IPersistenceManager | undefined;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ApplicationJSON, LayoutJSON, LayoutMetadata, LayoutMetadataDto, Settings } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import { IPersistenceManager } from "./PersistenceManager";
|
|
3
|
-
export type CreateLayoutResponseDto = {
|
|
4
|
-
metadata: LayoutMetadata;
|
|
5
|
-
};
|
|
6
|
-
export type GetLayoutResponseDto = {
|
|
7
|
-
definition: LayoutJSON;
|
|
8
|
-
};
|
|
9
|
-
export type GetApplicationResponseDto = {
|
|
10
|
-
definition: ApplicationJSON;
|
|
11
|
-
};
|
|
12
|
-
export declare class RemotePersistenceManager implements IPersistenceManager {
|
|
13
|
-
private userName;
|
|
14
|
-
constructor(userName: string);
|
|
15
|
-
createLayout(metadata: LayoutMetadataDto, layout: LayoutJSON): Promise<LayoutMetadata>;
|
|
16
|
-
clearUserSettings(): void;
|
|
17
|
-
updateLayout(id: string, metadata: LayoutMetadataDto, newLayoutJson: LayoutJSON): Promise<void>;
|
|
18
|
-
deleteLayout(id: string): Promise<void>;
|
|
19
|
-
loadLayout(id: string): Promise<LayoutJSON>;
|
|
20
|
-
loadMetadata(): Promise<LayoutMetadata[]>;
|
|
21
|
-
saveApplicationJSON(applicationJSON: ApplicationJSON): Promise<void>;
|
|
22
|
-
loadApplicationJSON(): Promise<ApplicationJSON>;
|
|
23
|
-
getUserSettings(): Promise<{}>;
|
|
24
|
-
saveUserSettings(userSettings: Settings): void;
|
|
25
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ApplicationJSON, LayoutJSON, LayoutMetadata, Settings } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import { IPersistenceManager } from "./PersistenceManager";
|
|
3
|
-
/**
|
|
4
|
-
* Use in Showcase examples only
|
|
5
|
-
*/
|
|
6
|
-
export declare class StaticPersistenceManager implements IPersistenceManager {
|
|
7
|
-
#private;
|
|
8
|
-
constructor({ applicationJSON, applicationLoadDelay, layoutMetadata, }: {
|
|
9
|
-
applicationJSON?: ApplicationJSON;
|
|
10
|
-
applicationLoadDelay?: number;
|
|
11
|
-
layoutMetadata?: LayoutMetadata[];
|
|
12
|
-
});
|
|
13
|
-
createLayout(): Promise<LayoutMetadata>;
|
|
14
|
-
clearUserSettings(): void;
|
|
15
|
-
updateLayout(): Promise<void>;
|
|
16
|
-
deleteLayout(): Promise<void>;
|
|
17
|
-
loadLayout(id: string): Promise<LayoutJSON<{
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
}>>;
|
|
20
|
-
loadMetadata(): Promise<LayoutMetadata[]>;
|
|
21
|
-
loadApplicationJSON(): Promise<ApplicationJSON | undefined>;
|
|
22
|
-
saveApplicationJSON(applicationJson: ApplicationJSON): Promise<void>;
|
|
23
|
-
getUserSettings(): Promise<Settings>;
|
|
24
|
-
saveUserSettings(userSettings: Settings): void;
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import React, { ReactElement, ReactNode } from "react";
|
|
3
|
-
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;
|
|
12
|
-
}
|
|
13
|
-
export declare const ContextPanel: ({ className: classNameProp, expanded, content: contentProp, id, onClose, overlay, title, }: ContextPanelProps) => React.JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./ContextPanel";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
2
|
-
export interface SidePanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
open?: boolean;
|
|
4
|
-
path?: string;
|
|
5
|
-
sizeOpen?: number;
|
|
6
|
-
sizeClosed?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare const SidePanel: ({ children, open, sizeClosed, sizeOpen, style: styleProp, ...htmlAttributes }: SidePanelProps) => import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./SidePanel";
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactElement, ReactNode } from "react";
|
|
2
|
-
import { SidePanelProps as ShellSidePanelProps } from "./side-panel";
|
|
3
|
-
declare const LayoutHook: {
|
|
4
|
-
"full-height": ShellLayoutTemplateHook;
|
|
5
|
-
inlay: ShellLayoutTemplateHook;
|
|
6
|
-
"left-main-tabs": ShellLayoutTemplateHook;
|
|
7
|
-
"simple-content-pane": ShellLayoutTemplateHook;
|
|
8
|
-
};
|
|
9
|
-
export type LayoutTemplateId = keyof typeof LayoutHook;
|
|
10
|
-
export type ShellLayoutTemplateProps = Omit<ShellLayoutProps, "layoutTemplateId">;
|
|
11
|
-
export type ShellToolbarProps = {
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
position?: "left";
|
|
14
|
-
width?: number;
|
|
15
|
-
};
|
|
16
|
-
export type ShellLayoutTemplateHook = (props: ShellLayoutTemplateProps) => ReactElement;
|
|
17
|
-
/**
|
|
18
|
-
* The Shell Layout is the outermost 'chrome' of the appliciation,
|
|
19
|
-
* enclosing the main content area. It will be rendered by one of
|
|
20
|
-
* two available templates, determined by the layoutTemplateId,
|
|
21
|
-
*/
|
|
22
|
-
export interface ShellLayoutProps {
|
|
23
|
-
/**
|
|
24
|
-
* App Header will be rendered in position determined by layout-template
|
|
25
|
-
*/
|
|
26
|
-
appHeader?: ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* HTML attributes that will be applied to root div.
|
|
29
|
-
*/
|
|
30
|
-
htmlAttributes?: HTMLAttributes<HTMLDivElement>;
|
|
31
|
-
/**
|
|
32
|
-
* identifier for shell layout template to be used. Default template
|
|
33
|
-
* will be "inlay"
|
|
34
|
-
*/
|
|
35
|
-
layoutTemplateId?: LayoutTemplateId;
|
|
36
|
-
/**
|
|
37
|
-
* If template renders SidePanel, these props will be provided
|
|
38
|
-
*/
|
|
39
|
-
SidePanelProps?: ShellSidePanelProps;
|
|
40
|
-
/**
|
|
41
|
-
* If template renders Toolbar, these props will be provided
|
|
42
|
-
*/
|
|
43
|
-
ToolbarProps?: ShellToolbarProps;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* This hook acts as a stub for the actual shell layout
|
|
47
|
-
* template hooks. It will delegate to the appropriate shell
|
|
48
|
-
* layout hook, based on the value of layoutTemplateId.
|
|
49
|
-
*/
|
|
50
|
-
export declare const useShellLayout: ({ layoutTemplateId, ...props }: ShellLayoutProps) => ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
51
|
-
export {};
|
package/types/src/shell.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { VuuUser } from "@vuu-ui/vuu-utils";
|
|
2
|
-
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;
|
|
16
|
-
}
|
|
17
|
-
export declare const Shell: ({ logout, user, userSettingsSchema, workspaceProps, ...props }: ShellProps) => import("react").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
2
|
-
import { ThemeMode } from "@vuu-ui/vuu-utils";
|
|
3
|
-
export interface ThemeSwitchProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
4
|
-
defaultMode?: ThemeMode;
|
|
5
|
-
mode?: ThemeMode;
|
|
6
|
-
onChange: (mode: ThemeMode) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const ThemeSwitch: ({ className: classNameProp, defaultMode: defaultModeProp, mode: modeProp, onChange, ...htmlAttributes }: ThemeSwitchProps) => import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./ThemeSwitch";
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
-
import { type Settings } from "@vuu-ui/vuu-utils";
|
|
3
|
-
import { type DropdownProps } from "@salt-ds/core";
|
|
4
|
-
import { type FormEventHandler, type HTMLAttributes } from "react";
|
|
5
|
-
export interface SettingsSchema {
|
|
6
|
-
properties: SettingsProperty[];
|
|
7
|
-
}
|
|
8
|
-
export type OptionType<T> = {
|
|
9
|
-
label: string;
|
|
10
|
-
value: T;
|
|
11
|
-
};
|
|
12
|
-
export declare const isOption: (value: OptionType<number | string> | number | string) => value is OptionType<number | string>;
|
|
13
|
-
export interface BaseProperty {
|
|
14
|
-
name: string;
|
|
15
|
-
label: string;
|
|
16
|
-
}
|
|
17
|
-
export interface StringProperty extends BaseProperty {
|
|
18
|
-
values?: string[] | OptionType<string>[];
|
|
19
|
-
defaultValue?: string;
|
|
20
|
-
type: "string";
|
|
21
|
-
}
|
|
22
|
-
export interface NumericProperty extends BaseProperty {
|
|
23
|
-
values?: number[] | OptionType<number>[];
|
|
24
|
-
defaultValue?: number;
|
|
25
|
-
type: "number";
|
|
26
|
-
}
|
|
27
|
-
export interface BooleanProperty extends BaseProperty {
|
|
28
|
-
defaultValue?: boolean;
|
|
29
|
-
type: "boolean";
|
|
30
|
-
}
|
|
31
|
-
export type SettingsProperty = StringProperty | NumericProperty | BooleanProperty;
|
|
32
|
-
export declare const isBooleanProperty: (property: SettingsProperty) => property is BooleanProperty;
|
|
33
|
-
export declare const isStringOrNumber: (value: unknown) => value is string | number;
|
|
34
|
-
export declare function FormControl({ property, changeHandler, selectHandler, inputHandler, currentValue, }: {
|
|
35
|
-
property: SettingsProperty;
|
|
36
|
-
changeHandler: FormEventHandler;
|
|
37
|
-
selectHandler: DropdownProps["onSelectionChange"];
|
|
38
|
-
inputHandler: FormEventHandler;
|
|
39
|
-
currentValue: VuuRowDataItemType;
|
|
40
|
-
}): import("react").JSX.Element | null;
|
|
41
|
-
export interface SettingsFormProps extends HTMLAttributes<HTMLDivElement> {
|
|
42
|
-
settingsSchema: SettingsSchema;
|
|
43
|
-
settings: Settings;
|
|
44
|
-
onSettingChanged: (propertyName: string, value: string | number | boolean) => void;
|
|
45
|
-
}
|
|
46
|
-
export declare const SettingsForm: ({ className, settingsSchema, settings, onSettingChanged, ...htmlAttributes }: SettingsFormProps) => import("react").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { LayoutJSON, LayoutMetadata, SystemLayoutMetadata } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import { HTMLAttributes } from "react";
|
|
3
|
-
export interface LayoutTileProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
metadata: LayoutMetadata | SystemLayoutMetadata;
|
|
5
|
-
onLoadLayout: (layoutId?: string, layoutJSON?: LayoutJSON) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const LayoutTile: ({ metadata, onLoadLayout, ...htmlAttributes }: LayoutTileProps) => import("react").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { LayoutMetadataDto } from "@vuu-ui/vuu-utils";
|
|
2
|
-
type SaveLayoutPanelProps = {
|
|
3
|
-
componentId?: string;
|
|
4
|
-
defaultTitle?: string;
|
|
5
|
-
onCancel: () => void;
|
|
6
|
-
onSave: (layoutMetadata: LayoutMetadataDto) => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const SaveLayoutPanel: (props: SaveLayoutPanelProps) => import("react").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
};
|
|
18
|
-
export interface WorkspaceProviderProps extends WorkspaceProps {
|
|
19
|
-
children: ReactElement | ReactElement[];
|
|
20
|
-
/**
|
|
21
|
-
* layoutPlaceholderJSON defines the layout to render when a new workspace layout is created.
|
|
22
|
-
*/
|
|
23
|
-
layoutPlaceholderJSON?: LayoutJSON;
|
|
24
|
-
}
|
|
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.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,10 +0,0 @@
|
|
|
1
|
-
import { StackProps } from "@vuu-ui/vuu-layout";
|
|
2
|
-
import { LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
3
|
-
export type WorkspaceStackProps = Pick<StackProps, "showTabs" | "TabstripProps">;
|
|
4
|
-
export declare const warningLayout: LayoutJSON;
|
|
5
|
-
export declare const loadingJSON: Readonly<LayoutJSON>;
|
|
6
|
-
export declare const defaultWorkspaceJSON: LayoutJSON<StackProps & {
|
|
7
|
-
preserve: boolean;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const getStackWorkspaceJSON: (activeLayoutIndex?: number) => LayoutJSON;
|
|
10
|
-
export declare const getWorkspaceWithLayoutJSON: (customWorkspaceJSON?: LayoutJSON | LayoutJSON[], layoutJSON?: LayoutJSON | LayoutJSON[], activeLayoutIndex?: number, stackProps?: WorkspaceStackProps) => LayoutJSON | LayoutJSON[];
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
-
import { type Settings } from "@vuu-ui/vuu-utils";
|
|
3
|
-
import { type DropdownProps } from "@salt-ds/core";
|
|
4
|
-
import { type FormEventHandler, type HTMLAttributes } from "react";
|
|
5
|
-
export interface SettingsSchema {
|
|
6
|
-
properties: SettingsProperty[];
|
|
7
|
-
}
|
|
8
|
-
export type OptionType<T> = {
|
|
9
|
-
label: string;
|
|
10
|
-
value: T;
|
|
11
|
-
};
|
|
12
|
-
export declare const isOption: (value: OptionType<number | string> | number | string) => value is OptionType<number | string>;
|
|
13
|
-
export interface BaseProperty {
|
|
14
|
-
name: string;
|
|
15
|
-
label: string;
|
|
16
|
-
}
|
|
17
|
-
export interface StringProperty extends BaseProperty {
|
|
18
|
-
values?: string[] | OptionType<string>[];
|
|
19
|
-
defaultValue?: string;
|
|
20
|
-
type: "string";
|
|
21
|
-
}
|
|
22
|
-
export interface NumericProperty extends BaseProperty {
|
|
23
|
-
values?: number[] | OptionType<number>[];
|
|
24
|
-
defaultValue?: number;
|
|
25
|
-
type: "number";
|
|
26
|
-
}
|
|
27
|
-
export interface BooleanProperty extends BaseProperty {
|
|
28
|
-
defaultValue?: boolean;
|
|
29
|
-
type: "boolean";
|
|
30
|
-
}
|
|
31
|
-
export type SettingsProperty = StringProperty | NumericProperty | BooleanProperty;
|
|
32
|
-
export declare const isBooleanProperty: (property: SettingsProperty) => property is BooleanProperty;
|
|
33
|
-
export declare const isStringOrNumber: (value: unknown) => value is string | number;
|
|
34
|
-
export declare function FormControl({ property, changeHandler, selectHandler, inputHandler, currentValue, }: {
|
|
35
|
-
property: SettingsProperty;
|
|
36
|
-
changeHandler: FormEventHandler;
|
|
37
|
-
selectHandler: DropdownProps["onSelectionChange"];
|
|
38
|
-
inputHandler: FormEventHandler;
|
|
39
|
-
currentValue: VuuRowDataItemType;
|
|
40
|
-
}): import("react").JSX.Element | null;
|
|
41
|
-
export interface SettingsFormProps extends HTMLAttributes<HTMLDivElement> {
|
|
42
|
-
settingsSchema: SettingsSchema;
|
|
43
|
-
settings: Settings;
|
|
44
|
-
onSettingChanged: (propertyName: string, value: string | number | boolean) => void;
|
|
45
|
-
}
|
|
46
|
-
export declare const SettingsForm: ({ className, settingsSchema, settings, onSettingChanged, ...htmlAttributes }: SettingsFormProps) => import("react").JSX.Element;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { GridLayoutDocumentController, type GridComponentRendererRegistry, type GridComponentSettingsRegistry, type GridLayoutDocument, type GridLayoutDocumentChange } from "@vuu-ui/grid-layout";
|
|
2
|
-
import type { WorkspacePersistenceService } from "../persistence-manager";
|
|
3
|
-
import { WorkspacePersistentStateStore } from "./WorkspacePersistentState";
|
|
4
|
-
import { WorkspaceRepository } from "./WorkspaceRepository";
|
|
5
|
-
import { type WorkspaceSnapshotV1 } from "./workspace-schemas";
|
|
6
|
-
export interface WorkspaceControllerOptions {
|
|
7
|
-
readonly definitionId?: string;
|
|
8
|
-
readonly instanceId: string;
|
|
9
|
-
name: string;
|
|
10
|
-
readonly onError: (error: Error) => void;
|
|
11
|
-
readonly renderers: GridComponentRendererRegistry;
|
|
12
|
-
readonly service: WorkspacePersistenceService;
|
|
13
|
-
readonly settingsCodecs: GridComponentSettingsRegistry;
|
|
14
|
-
readonly snapshot: WorkspaceSnapshotV1;
|
|
15
|
-
readonly revision?: number;
|
|
16
|
-
}
|
|
17
|
-
export declare class WorkspaceController {
|
|
18
|
-
#private;
|
|
19
|
-
readonly definitionId?: string;
|
|
20
|
-
readonly documentController: GridLayoutDocumentController;
|
|
21
|
-
readonly instanceId: string;
|
|
22
|
-
name: string;
|
|
23
|
-
readonly persistentState: WorkspacePersistentStateStore;
|
|
24
|
-
readonly renderers: GridComponentRendererRegistry;
|
|
25
|
-
readonly repository: WorkspaceRepository;
|
|
26
|
-
readonly settingsCodecs: GridComponentSettingsRegistry;
|
|
27
|
-
constructor(options: WorkspaceControllerOptions);
|
|
28
|
-
get snapshot(): WorkspaceSnapshotV1;
|
|
29
|
-
handleDocumentChange: (document: GridLayoutDocument, change: GridLayoutDocumentChange) => void;
|
|
30
|
-
rename(name: string): void;
|
|
31
|
-
dispose(): Promise<void>;
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const WorkspaceHost: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
-
import { type ComponentPersistentStateV1 } from "./workspace-schemas";
|
|
3
|
-
export type ComponentStateUpdate = ComponentPersistentStateV1 | ((current: ComponentPersistentStateV1 | undefined) => ComponentPersistentStateV1);
|
|
4
|
-
export declare class WorkspacePersistentStateStore {
|
|
5
|
-
#private;
|
|
6
|
-
constructor(initialState?: Readonly<Record<string, ComponentPersistentStateV1>>);
|
|
7
|
-
getSnapshot: () => Readonly<Record<string, ComponentPersistentStateV1>>;
|
|
8
|
-
subscribe: (listener: () => void) => (() => void);
|
|
9
|
-
get(componentInstanceId: string): ComponentPersistentStateV1 | undefined;
|
|
10
|
-
update(componentInstanceId: string, update: ComponentStateUpdate): void;
|
|
11
|
-
purge(componentInstanceId?: string): void;
|
|
12
|
-
}
|
|
13
|
-
export interface WorkspacePersistentStateProviderProps {
|
|
14
|
-
readonly children: ReactNode;
|
|
15
|
-
readonly store: WorkspacePersistentStateStore;
|
|
16
|
-
}
|
|
17
|
-
export declare const WorkspacePersistentStateProvider: ({ children, store, }: WorkspacePersistentStateProviderProps) => ReactElement;
|
|
18
|
-
export declare const useWorkspacePersistentStateStore: () => WorkspacePersistentStateStore;
|
|
19
|
-
export declare const useComponentPersistentState: (componentInstanceId: string) => readonly [ComponentPersistentStateV1 | undefined, (update: ComponentStateUpdate) => void, () => void];
|