feat(ee): bases

Table and kanban UI, formula engine package, and the base-embed editor extension
This commit is contained in:
Philipinho
2026-06-14 01:29:06 +01:00
parent d86d51c27e
commit 4e5bff6d55
233 changed files with 22278 additions and 141 deletions
@@ -0,0 +1,22 @@
import { createContext, useContext, type ReactNode } from "react";
const BaseEditableContext = createContext<boolean>(true);
export function BaseEditableProvider({
editable,
children,
}: {
editable: boolean;
children: ReactNode;
}) {
return (
<BaseEditableContext.Provider value={editable}>
{children}
</BaseEditableContext.Provider>
);
}
/** Whether the current base subtree is editable. Defaults to true outside a provider. */
export function useBaseEditable(): boolean {
return useContext(BaseEditableContext);
}
@@ -0,0 +1,12 @@
import { createContext, useContext } from "react";
// Row order is only needed at interaction time (shift-select range math), so
// rows subscribe to a stable getter instead of the array itself — appending a
// page must not re-render every mounted row.
const GridRowOrderContext = createContext<() => string[]>(() => []);
export const GridRowOrderProvider = GridRowOrderContext.Provider;
export function useGridRowOrder(): () => string[] {
return useContext(GridRowOrderContext);
}
@@ -0,0 +1,11 @@
import { createContext, useContext } from "react";
// Rows only need the handler at click time; a stable context value keeps the
// expand affordance out of every GridRow/GridCell memo equality check.
const RowExpandContext = createContext<((rowId: string) => void) | null>(null);
export const RowExpandProvider = RowExpandContext.Provider;
export function useRowExpand(): ((rowId: string) => void) | null {
return useContext(RowExpandContext);
}