@vuu-ui/vuu-shell 0.13.4 → 0.13.5

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 (60) hide show
  1. package/package.json +19 -16
  2. package/types/ShellContextProvider.d.ts +7 -0
  3. package/types/app-header/AppHeader.d.ts +6 -0
  4. package/types/app-header/index.d.ts +1 -0
  5. package/types/app-status-bar/AppStatusBar.d.ts +1 -0
  6. package/types/app-status-bar/index.d.ts +1 -0
  7. package/types/application-provider/ApplicationContext.d.ts +11 -0
  8. package/types/application-provider/ApplicationProvider.d.ts +17 -0
  9. package/types/application-provider/index.d.ts +1 -0
  10. package/types/connection-status/ConnectionRetryCountdown.d.ts +3 -0
  11. package/types/connection-status/ConnectionStateDisplay.d.ts +9 -0
  12. package/types/connection-status/ConnectionStatusIndicator.d.ts +6 -0
  13. package/types/connection-status/index.d.ts +2 -0
  14. package/types/feature/Feature.d.ts +10 -0
  15. package/types/feature/FeatureErrorBoundary.d.ts +13 -0
  16. package/types/feature/Loader.d.ts +1 -0
  17. package/types/feature/index.d.ts +1 -0
  18. package/types/feature-and-layout-provider/FeatureAndLayoutProvider.d.ts +19 -0
  19. package/types/feature-and-layout-provider/index.d.ts +1 -0
  20. package/types/feature-list/FeatureList.d.ts +7 -0
  21. package/types/feature-list/index.d.ts +1 -0
  22. package/types/get-layout-history.d.ts +8 -0
  23. package/types/index.d.ts +15 -0
  24. package/types/left-nav/LeftNav.d.ts +14 -0
  25. package/types/left-nav/index.d.ts +1 -0
  26. package/types/login/LoginPanel.d.ts +7 -0
  27. package/types/login/VuuLogo.d.ts +1 -0
  28. package/types/login/index.d.ts +2 -0
  29. package/types/login/login-utils.d.ts +4 -0
  30. package/types/persistence-manager/LocalPersistenceManager.d.ts +21 -0
  31. package/types/persistence-manager/PersistenceManager.d.ts +66 -0
  32. package/types/persistence-manager/PersistenceProvider.d.ts +11 -0
  33. package/types/persistence-manager/RemotePersistenceManager.d.ts +23 -0
  34. package/types/persistence-manager/StaticPersistenceManager.d.ts +21 -0
  35. package/types/persistence-manager/index.d.ts +5 -0
  36. package/types/shell-layout-templates/context-panel/ContextPanel.d.ts +13 -0
  37. package/types/shell-layout-templates/context-panel/index.d.ts +1 -0
  38. package/types/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +2 -0
  39. package/types/shell-layout-templates/index.d.ts +3 -0
  40. package/types/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +2 -0
  41. package/types/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +2 -0
  42. package/types/shell-layout-templates/side-panel/SidePanel.d.ts +8 -0
  43. package/types/shell-layout-templates/side-panel/index.d.ts +1 -0
  44. package/types/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +2 -0
  45. package/types/shell-layout-templates/useShellLayout.d.ts +51 -0
  46. package/types/shell.d.ts +17 -0
  47. package/types/theme-switch/ThemeSwitch.d.ts +8 -0
  48. package/types/theme-switch/index.d.ts +1 -0
  49. package/types/use-force-render.d.ts +1 -0
  50. package/types/user-settings/SettingsForm.d.ts +46 -0
  51. package/types/user-settings/UserSettingsPanel.d.ts +3 -0
  52. package/types/user-settings/index.d.ts +2 -0
  53. package/types/workspace-management/LayoutList.d.ts +2 -0
  54. package/types/workspace-management/LayoutTile.d.ts +7 -0
  55. package/types/workspace-management/SaveLayoutPanel.d.ts +9 -0
  56. package/types/workspace-management/WorkspaceProvider.d.ts +52 -0
  57. package/types/workspace-management/defaultWorkspaceJSON.d.ts +10 -0
  58. package/types/workspace-management/index.d.ts +5 -0
  59. package/types/workspace-management/screenshot-utils.d.ts +6 -0
  60. package/types/workspace-management/useWorkspaceContextMenuItems.d.ts +5 -0
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
- "version": "0.13.4",
2
+ "version": "0.13.5",
3
3
  "description": "VUU UI Shell",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
7
- "@vuu-ui/vuu-data-types": "0.13.4",
8
- "@vuu-ui/vuu-protocol-types": "0.13.4",
9
- "@vuu-ui/vuu-table-types": "0.13.4"
7
+ "@vuu-ui/vuu-data-types": "0.13.5",
8
+ "@vuu-ui/vuu-protocol-types": "0.13.5",
9
+ "@vuu-ui/vuu-table-types": "0.13.5"
10
10
  },
11
11
  "dependencies": {
12
12
  "@salt-ds/core": "1.43.0",
13
13
  "@salt-ds/styles": "0.2.1",
14
14
  "@salt-ds/window": "0.1.1",
15
- "@vuu-ui/vuu-context-menu": "0.13.4",
16
- "@vuu-ui/vuu-data-react": "0.13.4",
17
- "@vuu-ui/vuu-data-remote": "0.13.4",
18
- "@vuu-ui/vuu-icons": "0.13.4",
19
- "@vuu-ui/vuu-layout": "0.13.4",
20
- "@vuu-ui/vuu-popups": "0.13.4",
21
- "@vuu-ui/vuu-table": "0.13.4",
22
- "@vuu-ui/vuu-ui-controls": "0.13.4",
23
- "@vuu-ui/vuu-utils": "0.13.4",
15
+ "@vuu-ui/vuu-context-menu": "0.13.5",
16
+ "@vuu-ui/vuu-data-react": "0.13.5",
17
+ "@vuu-ui/vuu-data-remote": "0.13.5",
18
+ "@vuu-ui/vuu-icons": "0.13.5",
19
+ "@vuu-ui/vuu-layout": "0.13.5",
20
+ "@vuu-ui/vuu-popups": "0.13.5",
21
+ "@vuu-ui/vuu-table": "0.13.5",
22
+ "@vuu-ui/vuu-ui-controls": "0.13.5",
23
+ "@vuu-ui/vuu-utils": "0.13.5",
24
24
  "html-to-image": "^1.11.11"
25
25
  },
26
26
  "peerDependencies": {
@@ -32,16 +32,19 @@
32
32
  "files": [
33
33
  "README.md",
34
34
  "esm",
35
- "cjs"
35
+ "cjs",
36
+ "/types"
36
37
  ],
37
38
  "exports": {
38
39
  ".": {
39
40
  "require": "./cjs/index.js",
40
- "import": "./esm/index.js"
41
+ "import": "./esm/index.js",
42
+ "types": "./types/index.d.ts"
41
43
  }
42
44
  },
43
45
  "main": "cjs/index.js",
44
46
  "module": "esm/index.js",
45
47
  "name": "@vuu-ui/vuu-shell",
46
- "type": "module"
48
+ "type": "module",
49
+ "types": "types/index.d.ts"
47
50
  }
@@ -0,0 +1,7 @@
1
+ import { ShellContextProps } from "@vuu-ui/vuu-utils";
2
+ import { ReactElement, ReactNode } from "react";
3
+ export interface ShellProviderProps {
4
+ children: ReactNode;
5
+ value?: ShellContextProps;
6
+ }
7
+ export declare const ShellContextProvider: ({ children, value, }: ShellProviderProps) => ReactElement;
@@ -0,0 +1,6 @@
1
+ import type { ThemeMode } from "@vuu-ui/vuu-utils";
2
+ import { HTMLAttributes } from "react";
3
+ export interface AppHeaderProps extends HTMLAttributes<HTMLDivElement> {
4
+ themeMode?: ThemeMode;
5
+ }
6
+ export declare const AppHeader: ({ className: classNameProp, themeMode: _, ...htmlAttributes }: AppHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './AppHeader';
@@ -0,0 +1 @@
1
+ export declare const ApplicationStatusBar: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./AppStatusBar";
@@ -0,0 +1,11 @@
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";
4
+ export interface ApplicationContextProps {
5
+ onUserSettingChanged: (propertyName: string, value: VuuRowDataItemType) => void;
6
+ loginUrl?: string;
7
+ userSettings?: Settings;
8
+ userSettingsSchema?: SettingsSchema;
9
+ user: VuuUser;
10
+ }
11
+ export declare const ApplicationContext: import("react").Context<ApplicationContextProps>;
@@ -0,0 +1,17 @@
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">> {
6
+ children: ReactNode;
7
+ density?: Density;
8
+ }
9
+ export declare const ApplicationProvider: ({ children, density: densityProp, loginUrl, mode, theme, userSettingsSchema: userSettingsSchema, user, }: ApplicationProviderProps) => ReactElement | null;
10
+ export declare const useApplicationUser: () => import("@vuu-ui/vuu-utils").VuuUser;
11
+ export declare const useLoginUrl: () => string | undefined;
12
+ export declare const useApplicationSettings: () => {
13
+ onUserSettingChanged: (propertyName: string, value: VuuRowDataItemType) => void;
14
+ userSettings: import("@vuu-ui/vuu-utils").Settings | undefined;
15
+ userSettingsSchema: import("..").SettingsSchema | undefined;
16
+ };
17
+ export declare const useUserSetting: () => import("@vuu-ui/vuu-utils").Settings | undefined;
@@ -0,0 +1 @@
1
+ export * from "./ApplicationProvider";
@@ -0,0 +1,3 @@
1
+ export declare const ConnectionRetryCountdown: ({ seconds: secondsProp, }: {
2
+ seconds: number;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { WebSocketConnectionState } from "@vuu-ui/vuu-data-remote/src/WebSocketConnection";
2
+ import { HTMLAttributes } from "react";
3
+ interface ConnectionStateDisplayProps extends HTMLAttributes<HTMLDivElement> {
4
+ className?: string;
5
+ connectionState?: WebSocketConnectionState;
6
+ showText?: boolean;
7
+ }
8
+ export declare const ConnectionStateDisplay: ({ connectionState: connectionStateProp, showText, ...htmlAttributes }: ConnectionStateDisplayProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { WebSocketConnectionState } from "@vuu-ui/vuu-data-remote";
2
+ interface ConnectionStatusIndicatorProps {
3
+ connectionState: WebSocketConnectionState;
4
+ }
5
+ export declare const ConnectionStatusIndicator: ({ connectionState, }: ConnectionStatusIndicatorProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./ConnectionStateDisplay";
2
+ export * from "./ConnectionStatusIndicator";
@@ -0,0 +1,10 @@
1
+ import { 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 {};
@@ -0,0 +1,13 @@
1
+ import { DynamicFeatureProps } from "@vuu-ui/vuu-utils";
2
+ import React, { ErrorInfo, ReactNode } from "react";
3
+ export interface FeatureErrorBoundaryProps extends DynamicFeatureProps {
4
+ children: ReactNode;
5
+ }
6
+ export declare class FeatureErrorBoundary extends React.Component<FeatureErrorBoundaryProps, any> {
7
+ constructor(props: FeatureErrorBoundaryProps);
8
+ static getDerivedStateFromError(error: Error): {
9
+ errorMessage: string;
10
+ };
11
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
12
+ render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
13
+ }
@@ -0,0 +1 @@
1
+ export declare const Loader: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Feature';
@@ -0,0 +1,19 @@
1
+ import { DynamicFeatureDescriptor, DynamicFeatureProps, FilterTableFeatureProps, StaticFeatureDescriptor, SystemLayoutMetadata } from "@vuu-ui/vuu-utils";
2
+ import { ReactElement, ReactNode } from "react";
3
+ export interface FeatureContextProps {
4
+ dynamicFeatures?: DynamicFeatureProps[];
5
+ tableFeatures?: DynamicFeatureProps<FilterTableFeatureProps>[];
6
+ staticFeatures?: StaticFeatureDescriptor[];
7
+ }
8
+ export interface LayoutContextProps {
9
+ systemLayouts?: SystemLayoutMetadata[];
10
+ }
11
+ export interface FeatureAndLayoutProviderProps extends Partial<FeatureContextProps> {
12
+ children: ReactNode;
13
+ dynamicFeatures?: DynamicFeatureDescriptor[];
14
+ staticFeatures?: StaticFeatureDescriptor[];
15
+ systemLayouts?: SystemLayoutMetadata[];
16
+ }
17
+ export declare const FeatureAndLayoutProvider: ({ children, dynamicFeatures: dynamicFeaturesProp, staticFeatures, systemLayouts, }: FeatureAndLayoutProviderProps) => ReactElement;
18
+ export declare const useFeatures: () => FeatureContextProps;
19
+ export declare const useLayouts: () => LayoutContextProps;
@@ -0,0 +1 @@
1
+ export * from "./FeatureAndLayoutProvider";
@@ -0,0 +1,7 @@
1
+ import { DynamicFeatureProps, StaticFeatureDescriptor } from "@vuu-ui/vuu-utils";
2
+ import { HTMLAttributes } from "react";
3
+ export type GroupedFeatureProps<P extends object | undefined = object> = Record<string, DynamicFeatureProps<P>[]>;
4
+ export interface FeatureListProps extends HTMLAttributes<HTMLDivElement> {
5
+ features: DynamicFeatureProps[] | GroupedFeatureProps | StaticFeatureDescriptor[];
6
+ }
7
+ export declare const FeatureList: ({ features, title, ...htmlAttributes }: FeatureListProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./FeatureList";
@@ -0,0 +1,8 @@
1
+ import type { VuuUser } from "@vuu-ui/vuu-utils";
2
+ export interface LayoutHistoryItem {
3
+ user: string;
4
+ id: string;
5
+ uniqueId: string;
6
+ lastUpdate: number;
7
+ }
8
+ export declare const getLayoutHistory: (user: VuuUser) => Promise<LayoutHistoryItem[]>;
@@ -0,0 +1,15 @@
1
+ export * from "./application-provider";
2
+ export * from "./app-header";
3
+ export * from "./connection-status";
4
+ export * from "./feature";
5
+ export * from "./feature-and-layout-provider";
6
+ export * from "./left-nav";
7
+ export * from "./login";
8
+ export * from "./persistence-manager";
9
+ export * from "./shell";
10
+ export * from "./shell-layout-templates";
11
+ export * from "./ShellContextProvider";
12
+ export * from "./feature-list";
13
+ export * from "./theme-switch";
14
+ export * from "./user-settings";
15
+ export * from "./workspace-management";
@@ -0,0 +1,14 @@
1
+ import { 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-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./LeftNav";
@@ -0,0 +1,7 @@
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
+ requirePassword?: boolean;
6
+ }
7
+ export declare const LoginPanel: ({ appName, className, requirePassword, onSubmit, ...htmlAttributes }: LoginPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const VuuLogo: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './LoginPanel';
2
+ export * from './login-utils';
@@ -0,0 +1,4 @@
1
+ export declare const getAuthModeFromCookies: () => string;
2
+ export declare const getAuthDetailsFromCookies: () => [string, string];
3
+ export declare const redirectToLogin: (loginUrl?: string) => void;
4
+ export declare const logout: (loginUrl?: string) => void;
@@ -0,0 +1,21 @@
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
+ metadataSaveLocation: string;
6
+ layoutsSaveLocation: string;
7
+ constructor(urlKey?: string);
8
+ createLayout(metadata: LayoutMetadataDto, layout: LayoutJSON): Promise<LayoutMetadata>;
9
+ updateLayout(id: string, newMetadata: LayoutMetadataDto, newLayout: LayoutJSON): Promise<void>;
10
+ deleteLayout(id: string): Promise<void>;
11
+ loadLayout(id: string): Promise<LayoutJSON>;
12
+ loadMetadata(): Promise<LayoutMetadata[]>;
13
+ loadApplicationJSON(): Promise<ApplicationJSON | undefined>;
14
+ saveApplicationJSON(applicationJSON: ApplicationJSON): Promise<void>;
15
+ loadLayouts: () => Promise<Layout[]>;
16
+ saveLayoutsWithMetadata: (layouts: Layout[], metadata: LayoutMetadata[]) => void;
17
+ validateIds: (id: string) => Promise<void>;
18
+ validateId: (id: string, dataType: "metadata" | "layout") => Promise<void>;
19
+ getUserSettings(): Promise<Settings>;
20
+ saveUserSettings(userSettings: Settings): void;
21
+ }
@@ -0,0 +1,66 @@
1
+ import type { ApplicationJSON, LayoutJSON, LayoutMetadata, LayoutMetadataDto, Settings } from "@vuu-ui/vuu-utils";
2
+ export interface IPersistenceManager {
3
+ /**
4
+ * Saves a new layout and its corresponding metadata
5
+ *
6
+ * @param metadata - Metadata about the layout to be saved
7
+ * @param layout - Full JSON representation of the layout to be saved
8
+ *
9
+ * @returns Unique identifier assigned to the saved layout
10
+ */
11
+ createLayout: (metadata: LayoutMetadataDto, layout: LayoutJSON) => Promise<LayoutMetadata>;
12
+ /**
13
+ * Overwrites an existing layout and its corresponding metadata with the provided information
14
+ *
15
+ * @param id - Unique identifier of the existing layout to be updated
16
+ * @param metadata - Metadata describing the new layout to overwrite with
17
+ * @param layout - Full JSON representation of the new layout to overwrite with
18
+ */
19
+ updateLayout: (id: string, metadata: LayoutMetadataDto, layout: LayoutJSON) => Promise<void>;
20
+ /**
21
+ * Deletes an existing layout and its corresponding metadata
22
+ *
23
+ * @param id - Unique identifier of the existing layout to be deleted
24
+ */
25
+ deleteLayout: (id: string) => Promise<void>;
26
+ /**
27
+ * Retrieves an existing layout
28
+ *
29
+ * @param id - Unique identifier of the existing layout to be retrieved
30
+ *
31
+ * @returns Full JSON representation of the layout corresponding to the provided ID
32
+ */
33
+ loadLayout: (id: string) => Promise<LayoutJSON>;
34
+ /**
35
+ * Retrieves metadata for all existing layouts
36
+ *
37
+ * @returns an array of all persisted layout metadata
38
+ */
39
+ loadMetadata: () => Promise<LayoutMetadata[]>;
40
+ /**
41
+ * Retrieves the application JSON. This includes the application layout,
42
+ * which describes all layouts on screen
43
+ *
44
+ * @returns Full JSON representation of the application json
45
+ */
46
+ loadApplicationJSON: () => Promise<ApplicationJSON | undefined>;
47
+ /**
48
+ * Saves the application JSON. This includes the application layout,
49
+ * which describes all layouts on screen
50
+ *
51
+ * @param layout - Full JSON representation of the application layout to be saved
52
+ */
53
+ saveApplicationJSON: (layout: ApplicationJSON) => Promise<void>;
54
+ /**
55
+ * Save user settings. These get saved within the Application JSON.
56
+ *
57
+ * @param userSettings
58
+ */
59
+ saveUserSettings: (userSettings: Settings) => void;
60
+ /**
61
+ * Get the user settings. These are stored within Application JSON.
62
+ *
63
+ * @returns userSettings
64
+ */
65
+ getUserSettings: () => Promise<Settings>;
66
+ }
@@ -0,0 +1,11 @@
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;
@@ -0,0 +1,23 @@
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
+ username: string;
14
+ createLayout(metadata: LayoutMetadataDto, layout: LayoutJSON): Promise<LayoutMetadata>;
15
+ updateLayout(id: string, metadata: LayoutMetadataDto, newLayoutJson: LayoutJSON): Promise<void>;
16
+ deleteLayout(id: string): Promise<void>;
17
+ loadLayout(id: string): Promise<LayoutJSON>;
18
+ loadMetadata(): Promise<LayoutMetadata[]>;
19
+ saveApplicationJSON(applicationJSON: ApplicationJSON): Promise<void>;
20
+ loadApplicationJSON(): Promise<ApplicationJSON>;
21
+ getUserSettings(): Promise<{}>;
22
+ saveUserSettings(userSettings: Settings): void;
23
+ }
@@ -0,0 +1,21 @@
1
+ import { ApplicationJSON, LayoutJSON, LayoutMetadata, Settings } from "@vuu-ui/vuu-utils";
2
+ import { IPersistenceManager } from "./PersistenceManager";
3
+ export declare class StaticPersistenceManager implements IPersistenceManager {
4
+ #private;
5
+ constructor({ applicationJSON, applicationLoadDelay, layoutMetadata, }: {
6
+ applicationJSON?: ApplicationJSON;
7
+ applicationLoadDelay?: number;
8
+ layoutMetadata?: LayoutMetadata[];
9
+ });
10
+ createLayout(): Promise<LayoutMetadata>;
11
+ updateLayout(): Promise<void>;
12
+ deleteLayout(): Promise<void>;
13
+ loadLayout(id: string): Promise<LayoutJSON<{
14
+ [key: string]: any;
15
+ }>>;
16
+ loadMetadata(): Promise<LayoutMetadata[]>;
17
+ loadApplicationJSON(): Promise<ApplicationJSON | undefined>;
18
+ saveApplicationJSON(applicationJson: ApplicationJSON): Promise<void>;
19
+ getUserSettings(): Promise<Settings>;
20
+ saveUserSettings(userSettings: Settings): void;
21
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./PersistenceManager";
2
+ export * from "./PersistenceProvider";
3
+ export * from "./LocalPersistenceManager";
4
+ export * from "./RemotePersistenceManager";
5
+ export * from "./StaticPersistenceManager";
@@ -0,0 +1,13 @@
1
+ import { LayoutJSON } from "@vuu-ui/vuu-utils";
2
+ import { ReactNode } from "react";
3
+ export interface ContextPanelProps {
4
+ [key: string]: unknown;
5
+ className?: string;
6
+ content?: 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) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./ContextPanel";
@@ -0,0 +1,2 @@
1
+ import { ShellLayoutTemplateHook } from "../useShellLayout";
2
+ export declare const useFullHeightLeftPanel: ShellLayoutTemplateHook;
@@ -0,0 +1,3 @@
1
+ export * from "./context-panel";
2
+ export * from "./useShellLayout";
3
+ export * from "./side-panel";
@@ -0,0 +1,2 @@
1
+ import { ShellLayoutTemplateHook } from "../useShellLayout";
2
+ export declare const useInlayLeftPanel: ShellLayoutTemplateHook;
@@ -0,0 +1,2 @@
1
+ import { ShellLayoutTemplateHook } from "../useShellLayout";
2
+ export declare const useLeftMainTabs: ShellLayoutTemplateHook;
@@ -0,0 +1,8 @@
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-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./SidePanel";
@@ -0,0 +1,2 @@
1
+ import { ShellLayoutTemplateHook } from "../useShellLayout";
2
+ export declare const useSimpleContentPane: ShellLayoutTemplateHook;
@@ -0,0 +1,51 @@
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 {};
@@ -0,0 +1,17 @@
1
+ import { VuuUser } from "@vuu-ui/vuu-utils";
2
+ import { HTMLAttributes, 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
+ loginUrl?: string;
13
+ saveUrl?: string;
14
+ serverUrl?: string;
15
+ user: VuuUser;
16
+ }
17
+ export declare const Shell: ({ loginUrl, user, userSettingsSchema, workspaceProps, ...props }: ShellProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
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-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./ThemeSwitch";
@@ -0,0 +1 @@
1
+ export function useForceRender(): import("react").Dispatch<import("react").SetStateAction<{}>>;
@@ -0,0 +1,46 @@
1
+ import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
2
+ import { Settings } from "@vuu-ui/vuu-utils";
3
+ import { DropdownProps } from "@salt-ds/core";
4
+ import { FormEventHandler, HTMLAttributes } from "react";
5
+ export interface SettingsSchema {
6
+ properties: SettingsProperty[];
7
+ }
8
+ export type Option<T> = {
9
+ label: string;
10
+ value: T;
11
+ };
12
+ export declare const isOption: (value: Option<number | string> | number | string) => value is Option<number | string>;
13
+ export interface BaseProperty {
14
+ name: string;
15
+ label: string;
16
+ }
17
+ export interface StringProperty extends BaseProperty {
18
+ values?: string[] | Option<string>[];
19
+ defaultValue?: string;
20
+ type: "string";
21
+ }
22
+ export interface NumericProperty extends BaseProperty {
23
+ values?: number[] | Option<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-runtime").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-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes } from "react";
2
+ export type UserSettingsPanelProps = HTMLAttributes<HTMLDivElement>;
3
+ export declare const UserSettingsPanel: ({ ...htmlAttributes }: UserSettingsPanelProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ export * from "./UserSettingsPanel";
2
+ export * from "./SettingsForm";
@@ -0,0 +1,2 @@
1
+ import { HTMLAttributes } from "react";
2
+ export declare const LayoutList: ({ className, title, ...htmlAttributes }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
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-runtime").JSX.Element;
@@ -0,0 +1,9 @@
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-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,52 @@
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-runtime").JSX.Element;
39
+ export declare const useWorkspace: () => {
40
+ workspaceJSON: LayoutJSON<{
41
+ [key: string]: any;
42
+ }> | LayoutJSON<{
43
+ [key: string]: any;
44
+ }>[];
45
+ layoutMetadata: LayoutMetadata[];
46
+ layoutPlaceholderJSON?: LayoutJSON;
47
+ getApplicationSettings: (key?: keyof ApplicationSettings) => ApplicationSettings | ApplicationSetting | undefined;
48
+ loadLayoutById: (id: string) => void;
49
+ saveApplicationSettings: (settings: ApplicationSettings | ApplicationSetting, key?: keyof ApplicationSettings) => void;
50
+ saveLayout: (n: LayoutMetadataDto) => void;
51
+ saveApplicationLayout: (layout: LayoutJSON) => void;
52
+ };
@@ -0,0 +1,10 @@
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[];
@@ -0,0 +1,5 @@
1
+ export * from "./SaveLayoutPanel";
2
+ export * from "./LayoutList";
3
+ export * from "./WorkspaceProvider";
4
+ export * from "./defaultWorkspaceJSON";
5
+ export * from "./useWorkspaceContextMenuItems";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Takes a screenshot of the given node and returns the base64 encoded image url
3
+ * @param node HTMLElement to take screenshot of
4
+ * @returns Base64 encoded image url
5
+ */
6
+ export declare const takeScreenshot: (node: HTMLElement) => Promise<string>;
@@ -0,0 +1,5 @@
1
+ import { MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-context-menu";
2
+ export declare const useWorkspaceContextMenuItems: () => {
3
+ buildMenuOptions: MenuBuilder;
4
+ handleMenuAction: MenuActionHandler;
5
+ };