diff --git a/apps/client/src/ee/base/atoms/base-atoms.ts b/apps/client/src/ee/base/atoms/base-atoms.ts index 213553fac..9404e0410 100644 --- a/apps/client/src/ee/base/atoms/base-atoms.ts +++ b/apps/client/src/ee/base/atoms/base-atoms.ts @@ -1,6 +1,6 @@ import { atom } from "jotai"; import { atomFamily } from "jotai/utils"; -import { EditingCell } from "@/ee/base/types/base.types"; +import { EditingCell, FocusedCell } from "@/ee/base/types/base.types"; // Atoms are scoped per-base via `pageId` so that two BaseTable instances on // the same page don't share UI state. @@ -41,3 +41,15 @@ export const selectedRowIdsAtomFamily = atomFamily((_pageId: string) => export const lastToggledRowIndexAtomFamily = atomFamily((_pageId: string) => atom(null), ); + +export const focusedCellAtomFamily = atomFamily((_pageId: string) => + atom(null), +); + +export type PendingTypeInsert = { + rowId: string; + propertyId: string; + char: string; +} | null; + +export const pendingTypeInsertAtom = atom(null); diff --git a/apps/client/src/ee/base/types/base.types.ts b/apps/client/src/ee/base/types/base.types.ts index f5efeca4b..444e401e3 100644 --- a/apps/client/src/ee/base/types/base.types.ts +++ b/apps/client/src/ee/base/types/base.types.ts @@ -251,10 +251,14 @@ export type IBase = { baseSchemaVersion: number; }; -export type EditingCell = { +export type CellCoord = { rowId: string; propertyId: string; -} | null; +}; + +export type EditingCell = CellCoord | null; + +export type FocusedCell = CellCoord | null; export type CreateBaseInput = { name: string;