@vuu-ui/vuu-shell 3.3.5 → 3.3.7

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.3.5",
2
+ "version": "3.3.7",
3
3
  "description": "VUU UI Shell",
4
4
  "main": "./src/index.js",
5
5
  "author": "heswell",
@@ -10,23 +10,23 @@
10
10
  "type-defs": "node ../../scripts/build-type-defs.mjs"
11
11
  },
12
12
  "devDependencies": {
13
- "@vuu-ui/vuu-data-types": "3.3.5",
14
- "@vuu-ui/vuu-protocol-types": "3.3.5",
15
- "@vuu-ui/vuu-table-types": "3.3.5"
13
+ "@vuu-ui/vuu-data-types": "3.3.7",
14
+ "@vuu-ui/vuu-protocol-types": "3.3.7",
15
+ "@vuu-ui/vuu-table-types": "3.3.7"
16
16
  },
17
17
  "dependencies": {
18
18
  "@salt-ds/core": "1.54.1",
19
19
  "@salt-ds/styles": "0.2.1",
20
20
  "@salt-ds/window": "0.1.1",
21
- "@vuu-ui/vuu-context-menu": "3.3.5",
22
- "@vuu-ui/vuu-data-react": "3.3.5",
23
- "@vuu-ui/vuu-data-remote": "3.3.5",
24
- "@vuu-ui/vuu-icons": "3.3.5",
25
- "@vuu-ui/vuu-layout": "3.3.5",
26
- "@vuu-ui/vuu-notifications": "3.3.5",
27
- "@vuu-ui/vuu-table": "3.3.5",
28
- "@vuu-ui/vuu-ui-controls": "3.3.5",
29
- "@vuu-ui/vuu-utils": "3.3.5",
21
+ "@vuu-ui/vuu-context-menu": "3.3.7",
22
+ "@vuu-ui/vuu-data-react": "3.3.7",
23
+ "@vuu-ui/vuu-data-remote": "3.3.7",
24
+ "@vuu-ui/vuu-icons": "3.3.7",
25
+ "@vuu-ui/vuu-layout": "3.3.7",
26
+ "@vuu-ui/vuu-notifications": "3.3.7",
27
+ "@vuu-ui/vuu-table": "3.3.7",
28
+ "@vuu-ui/vuu-ui-controls": "3.3.7",
29
+ "@vuu-ui/vuu-utils": "3.3.7",
30
30
  "html-to-image": "^1.11.11"
31
31
  },
32
32
  "peerDependencies": {
@@ -0,0 +1,18 @@
1
+ import { type ApplicationSessionV1, type NamedWorkspaceDefinitionV1, type NamedWorkspaceMetadataV1, type WorkspaceSnapshotRecordV1 } from "../workspace-management/workspace-schemas";
2
+ import type { UserPersistenceScope, WorkspacePersistenceService } from "./WorkspacePersistenceService";
3
+ export declare class LocalWorkspacePersistenceService implements WorkspacePersistenceService {
4
+ #private;
5
+ readonly scope: UserPersistenceScope;
6
+ constructor(scope: UserPersistenceScope, storage?: Storage);
7
+ loadApplicationSession(): Promise<ApplicationSessionV1 | undefined>;
8
+ saveApplicationSession(session: ApplicationSessionV1): Promise<void>;
9
+ deleteApplicationSession(): Promise<void>;
10
+ listWorkspaceSnapshots(): Promise<readonly WorkspaceSnapshotRecordV1[]>;
11
+ loadWorkspaceSnapshot(workspaceInstanceId: string): Promise<WorkspaceSnapshotRecordV1 | undefined>;
12
+ saveWorkspaceSnapshot(snapshot: WorkspaceSnapshotRecordV1): Promise<void>;
13
+ deleteWorkspaceSnapshot(workspaceInstanceId: string): Promise<void>;
14
+ listNamedWorkspaceMetadata(): Promise<readonly NamedWorkspaceMetadataV1[]>;
15
+ loadNamedWorkspaceDefinition(id: string): Promise<NamedWorkspaceDefinitionV1 | undefined>;
16
+ saveNamedWorkspaceDefinition(definition: NamedWorkspaceDefinitionV1): Promise<void>;
17
+ deleteNamedWorkspaceDefinition(id: string): Promise<void>;
18
+ }
@@ -0,0 +1,25 @@
1
+ import { type ApplicationSessionV1, type NamedWorkspaceDefinitionV1, type NamedWorkspaceMetadataV1, type WorkspaceSnapshotRecordV1 } from "../workspace-management/workspace-schemas";
2
+ import type { UserPersistenceScope, WorkspacePersistenceService } from "./WorkspacePersistenceService";
3
+ export type WorkspaceRequestInitProvider = () => RequestInit | Promise<RequestInit>;
4
+ export interface RemoteWorkspacePersistenceOptions {
5
+ readonly baseUrl: string;
6
+ readonly requestInit?: RequestInit;
7
+ readonly requestInitProvider?: WorkspaceRequestInitProvider;
8
+ readonly fetch?: typeof fetch;
9
+ }
10
+ export declare class RemoteWorkspacePersistenceService implements WorkspacePersistenceService {
11
+ #private;
12
+ readonly scope: UserPersistenceScope;
13
+ constructor(scope: UserPersistenceScope, { baseUrl, requestInit, requestInitProvider, fetch: fetchImplementation, }: RemoteWorkspacePersistenceOptions);
14
+ loadApplicationSession(): Promise<ApplicationSessionV1 | undefined>;
15
+ saveApplicationSession(session: ApplicationSessionV1): Promise<void>;
16
+ deleteApplicationSession(): Promise<void>;
17
+ listWorkspaceSnapshots(): Promise<readonly WorkspaceSnapshotRecordV1[]>;
18
+ loadWorkspaceSnapshot(workspaceInstanceId: string): Promise<WorkspaceSnapshotRecordV1 | undefined>;
19
+ saveWorkspaceSnapshot(snapshot: WorkspaceSnapshotRecordV1): Promise<void>;
20
+ deleteWorkspaceSnapshot(workspaceInstanceId: string): Promise<void>;
21
+ listNamedWorkspaceMetadata(): Promise<readonly NamedWorkspaceMetadataV1[]>;
22
+ loadNamedWorkspaceDefinition(id: string): Promise<NamedWorkspaceDefinitionV1 | undefined>;
23
+ saveNamedWorkspaceDefinition(definition: NamedWorkspaceDefinitionV1): Promise<void>;
24
+ deleteNamedWorkspaceDefinition(id: string): Promise<void>;
25
+ }
@@ -0,0 +1,27 @@
1
+ import type { ApplicationSessionV1, NamedWorkspaceDefinitionV1, NamedWorkspaceMetadataV1, WorkspaceSnapshotRecordV1 } from "../workspace-management/workspace-schemas";
2
+ export interface PersistenceScope {
3
+ readonly applicationNamespace: string;
4
+ readonly applicationId: string;
5
+ }
6
+ export interface UserPersistenceScope extends PersistenceScope {
7
+ readonly userId: string;
8
+ }
9
+ export interface WorkspacePersistenceService {
10
+ readonly scope: UserPersistenceScope;
11
+ loadApplicationSession(): Promise<ApplicationSessionV1 | undefined>;
12
+ saveApplicationSession(session: ApplicationSessionV1): Promise<void>;
13
+ deleteApplicationSession(): Promise<void>;
14
+ listWorkspaceSnapshots(): Promise<readonly WorkspaceSnapshotRecordV1[]>;
15
+ loadWorkspaceSnapshot(workspaceInstanceId: string): Promise<WorkspaceSnapshotRecordV1 | undefined>;
16
+ saveWorkspaceSnapshot(snapshot: WorkspaceSnapshotRecordV1): Promise<void>;
17
+ deleteWorkspaceSnapshot(workspaceInstanceId: string): Promise<void>;
18
+ listNamedWorkspaceMetadata(): Promise<readonly NamedWorkspaceMetadataV1[]>;
19
+ loadNamedWorkspaceDefinition(id: string): Promise<NamedWorkspaceDefinitionV1 | undefined>;
20
+ saveNamedWorkspaceDefinition(definition: NamedWorkspaceDefinitionV1): Promise<void>;
21
+ deleteNamedWorkspaceDefinition(id: string): Promise<void>;
22
+ }
23
+ export declare class WorkspacePersistenceError extends Error {
24
+ readonly operation: string;
25
+ readonly status?: number | undefined;
26
+ constructor(message: string, operation: string, status?: number | undefined);
27
+ }
@@ -0,0 +1 @@
1
+ export declare const ApplicationSettingsContextPanel: () => import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { GridLayoutDocumentController, type GridComponentRendererRegistry, type GridComponentSettingsRegistry, type GridLayoutDocument, type GridLayoutDocumentChange } from "@heswell/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
+ }
@@ -0,0 +1 @@
1
+ export declare const WorkspaceHost: () => import("react").JSX.Element;
@@ -0,0 +1,19 @@
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];
@@ -0,0 +1,13 @@
1
+ import type { WorkspacePersistenceService } from "../persistence-manager";
2
+ import { type WorkspaceSnapshotRecordV1, type WorkspaceSnapshotV1 } from "./workspace-schemas";
3
+ export declare class WorkspaceRepositoryDisposedError extends Error {
4
+ constructor();
5
+ }
6
+ export declare class WorkspaceRepository {
7
+ #private;
8
+ constructor(service: WorkspacePersistenceService, workspaceInstanceId: string, initial?: WorkspaceSnapshotRecordV1);
9
+ get current(): WorkspaceSnapshotRecordV1 | undefined;
10
+ load(): Promise<WorkspaceSnapshotRecordV1 | undefined>;
11
+ save(snapshot: WorkspaceSnapshotV1): Promise<WorkspaceSnapshotRecordV1>;
12
+ dispose(): Promise<void>;
13
+ }
@@ -0,0 +1 @@
1
+ export declare const WorkspaceStartPanel: () => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { WorkspaceComponentRegistration } from "./workspace-component-registry";
2
+ export declare const shellWorkspaceComponentRegistrations: readonly WorkspaceComponentRegistration<unknown>[];
@@ -0,0 +1,12 @@
1
+ import { GridComponentRendererRegistry, GridComponentSettingsRegistry, type GridComponentRenderer, type GridComponentSettingsCodec, type JsonValue } from "@heswell/grid-layout";
2
+ export interface WorkspaceComponentRegistration<T> {
3
+ readonly codec: GridComponentSettingsCodec<T>;
4
+ readonly render: GridComponentRenderer<T>;
5
+ readonly type: string;
6
+ }
7
+ export interface WorkspaceComponentRegistries {
8
+ readonly renderers: GridComponentRendererRegistry;
9
+ readonly settingsCodecs: GridComponentSettingsRegistry;
10
+ }
11
+ export declare const createWorkspaceComponentRegistries: <T>(registrations: readonly WorkspaceComponentRegistration<T>[]) => WorkspaceComponentRegistries;
12
+ export declare const jsonValueWorkspaceComponentCodec: GridComponentSettingsCodec<JsonValue>;
@@ -0,0 +1,69 @@
1
+ import { type GridLayoutDocument, type JsonValue } from "@heswell/grid-layout";
2
+ export declare const WORKSPACE_SNAPSHOT_VERSION = 1;
3
+ export declare const APPLICATION_SESSION_VERSION = 1;
4
+ export declare const NAMED_WORKSPACE_DEFINITION_VERSION = 1;
5
+ export declare const WORKSPACE_SNAPSHOT_RECORD_VERSION = 1;
6
+ export interface ComponentPersistentStateV1 {
7
+ readonly componentType: string;
8
+ readonly schemaVersion: number;
9
+ readonly value: JsonValue;
10
+ }
11
+ export interface WorkspaceSnapshotV1 {
12
+ readonly version: typeof WORKSPACE_SNAPSHOT_VERSION;
13
+ readonly layout: GridLayoutDocument;
14
+ readonly componentState: Readonly<Record<string, ComponentPersistentStateV1>>;
15
+ }
16
+ export interface OpenWorkspaceInstanceV1 {
17
+ readonly instanceId: string;
18
+ readonly definitionId?: string;
19
+ readonly title?: string;
20
+ readonly snapshotId: string;
21
+ }
22
+ export interface ApplicationSessionV1 {
23
+ readonly version: typeof APPLICATION_SESSION_VERSION;
24
+ readonly openWorkspaces: readonly OpenWorkspaceInstanceV1[];
25
+ readonly workspaceOrder: readonly string[];
26
+ readonly activeWorkspaceInstanceId: string | null;
27
+ readonly settings: Readonly<Record<string, JsonValue>>;
28
+ }
29
+ export interface NamedWorkspaceDefinitionV1 {
30
+ readonly version: typeof NAMED_WORKSPACE_DEFINITION_VERSION;
31
+ readonly id: string;
32
+ readonly name: string;
33
+ readonly description?: string;
34
+ readonly createdAt: string;
35
+ readonly updatedAt: string;
36
+ readonly snapshot: WorkspaceSnapshotV1;
37
+ }
38
+ export interface NamedWorkspaceMetadataV1 {
39
+ readonly version: typeof NAMED_WORKSPACE_DEFINITION_VERSION;
40
+ readonly id: string;
41
+ readonly name: string;
42
+ readonly description?: string;
43
+ readonly createdAt: string;
44
+ readonly updatedAt: string;
45
+ }
46
+ export interface WorkspaceSnapshotRecordV1 {
47
+ readonly version: typeof WORKSPACE_SNAPSHOT_RECORD_VERSION;
48
+ readonly workspaceInstanceId: string;
49
+ readonly revision: number;
50
+ readonly snapshot: WorkspaceSnapshotV1;
51
+ }
52
+ export type WorkspaceSchemaName = "WorkspaceSnapshotV1" | "ApplicationSessionV1" | "NamedWorkspaceDefinitionV1" | "NamedWorkspaceMetadataV1" | "WorkspaceSnapshotRecordV1";
53
+ export interface WorkspaceValidationIssue {
54
+ readonly code: "INVALID_JSON_VALUE" | "INVALID_VALUE" | "UNEXPECTED_FIELD" | "UNSUPPORTED_VERSION";
55
+ readonly message: string;
56
+ readonly path: string;
57
+ }
58
+ export declare class WorkspaceValidationError extends Error {
59
+ readonly schema: WorkspaceSchemaName;
60
+ readonly issues: readonly WorkspaceValidationIssue[];
61
+ constructor(schema: WorkspaceSchemaName, issues: readonly WorkspaceValidationIssue[]);
62
+ }
63
+ export declare const validateWorkspaceSnapshotV1: (value: unknown) => WorkspaceSnapshotV1;
64
+ export declare const validateApplicationSessionV1: (value: unknown) => ApplicationSessionV1;
65
+ export declare const validateNamedWorkspaceDefinitionV1: (value: unknown) => NamedWorkspaceDefinitionV1;
66
+ export declare const validateNamedWorkspaceMetadataV1: (value: unknown) => NamedWorkspaceMetadataV1;
67
+ export declare const validateWorkspaceSnapshotRecordV1: (value: unknown) => WorkspaceSnapshotRecordV1;
68
+ export declare const workspaceMetadata: (definition: NamedWorkspaceDefinitionV1) => NamedWorkspaceMetadataV1;
69
+ export declare const cloneWorkspaceValue: <T>(value: T) => T;