Skip to content

Commit

Permalink
PR review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamlangford committed Jul 1, 2024
1 parent 7b83aee commit 12df107
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/pageEditor/pageEditorTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { type SessionRootState } from "@/pageEditor/slices/sessionSliceTypes";
import { type ModOptionsDefinition } from "@/types/modDefinitionTypes";
import { type Except } from "type-fest";
import {
type BaseFormStateV3,
type BaseFormStateV1,
type BaseFormStateV2,
} from "@/pageEditor/baseFormStateTypes";
Expand Down Expand Up @@ -340,16 +341,25 @@ export type EditorStateV3 = Except<
isPendingDraftModComponents: boolean;
};

/**
* @deprecated - Do not use versioned state types directly, exported for testing
*/
export type EditorStateV4 = Except<
EditorStateV3,
"modComponentFormStates" | "deletedModComponentFormStatesByModId"
> & {
modComponentFormStates: BaseFormStateV3[];
deletedModComponentFormStatesByModId: Record<string, BaseFormStateV3[]>;
};

export type EditorState = Except<
EditorStateV4,
"modComponentFormStates" | "deletedModComponentFormStatesByModId"
> & {
modComponentFormStates: ModComponentFormState[];
deletedModComponentFormStatesByModId: Record<string, ModComponentFormState[]>;
};

export type EditorState = EditorStateV4;

export type EditorRootState = {
editor: EditorState;
};
Expand Down
2 changes: 1 addition & 1 deletion src/pageEditor/sidebar/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ export function getModComponentItemId(item: ModComponentSidebarItem): UUID {
}

export function isModSidebarItem(item: SidebarItem): item is ModSidebarItem {
return "modMetadata" in item && "modComponents" in item;
return "modComponents" in item;
}

0 comments on commit 12df107

Please sign in to comment.