diff --git a/build/api/admin.api.md b/build/api/admin.api.md index 02a9690112..4c057a1e2a 100644 --- a/build/api/admin.api.md +++ b/build/api/admin.api.md @@ -14,7 +14,6 @@ import { AnchorButtonProps } from '@contember/ui'; import { AnchorHTMLAttributes } from 'react'; import type { AsyncBatchUpdatesOptions } from '@contember/react-binding'; import { BaseEditor } from 'slate'; -import { BaseSyntheticEvent } from 'react'; import { BoxOwnProps } from '@contember/ui'; import { ButtonProps } from '@contember/ui'; import { ChildrenAnalyzer } from '@contember/react-multipass-rendering'; @@ -22,8 +21,8 @@ import { ChoiceFieldDictionary } from '@contember/react-choice-field-ui'; import { ComponentType } from 'react'; import { ContemberClientProps } from '@contember/react-client'; import type { CreateNewEntityButtonProps } from '@contember/react-binding-ui'; +import { CurrentRequestContext } from '@contember/react-routing'; import { DataBindingProviderStateComponent } from '@contember/react-binding'; -import { DataBindingStateComponentProps } from '@contember/react-binding'; import { DataGridCellsDictionary } from '@contember/react-datagrid-ui'; import { DataGridColumnHidingPublicProps } from '@contember/react-datagrid-ui'; import { DataGridContainerProps } from '@contember/react-datagrid-ui'; @@ -32,7 +31,6 @@ import { DataGridDictionary } from '@contember/react-datagrid-ui'; import { DataGridFullFiltersPublicProps } from '@contember/react-datagrid-ui'; import { DataGridLayoutControlPublicProps } from '@contember/react-datagrid-ui'; import { DataGridProps } from '@contember/react-datagrid-ui'; -import { DataGridRenderingCommonProps } from '@contember/react-datagrid-ui'; import { DataGridTableRowPublicProps } from '@contember/react-datagrid-ui'; import { DataGridTilesPublicProps } from '@contember/react-datagrid-ui'; import { Descendant } from 'slate'; @@ -50,7 +48,6 @@ import { EmptyMessageOuterProps } from '@contember/react-binding-ui'; import { EntityAccessor } from '@contember/react-binding'; import { EntityId } from '@contember/react-binding'; import { EntityListAccessor } from '@contember/react-binding'; -import { EntityListBaseProps } from '@contember/react-binding'; import { EntityListSubTreeAdditionalProps } from '@contember/react-binding'; import { EntitySubTreeAdditionalCreationProps } from '@contember/react-binding'; import { EntitySubTreeAdditionalProps } from '@contember/react-binding'; @@ -72,9 +69,14 @@ import type { GraphQlClient } from '@contember/client'; import { GraphQlClientRequestOptions } from '@contember/react-client'; import { GraphQlClientVariables } from '@contember/react-client'; import { GraphQlClientVariables as GraphQlClientVariables_2 } from '@contember/client'; +import { HasRole } from '@contember/react-identity'; import { HistoryEditor } from 'slate-history'; import { IconSourceSpecification } from '@contember/ui'; +import { Identity } from '@contember/react-identity'; +import { identityEnvironmentExtension } from '@contember/react-identity'; +import { IncompleteRequestState } from '@contember/react-routing'; import { InputHTMLAttributes } from 'react'; +import { isRoutingLinkTarget } from '@contember/react-routing'; import { JsonObject } from '@contember/react-binding'; import { JsonValue } from '@contember/binding'; import { JsonValue as JsonValue_2 } from '@contember/react-binding'; @@ -82,6 +84,7 @@ import { JSX as JSX_2 } from 'react/jsx-runtime'; import type { KeyboardEvent as KeyboardEvent_2 } from 'react'; import { LabelMiddleware } from '@contember/react-binding'; import { LayoutPageProps } from '@contember/ui'; +import { LazyPageModule } from '@contember/react-routing'; import { Location as Location_2 } from 'slate'; import { MessageDictionaryByLocaleCode } from '@contember/react-i18n'; import type { MessageFormatter } from '@contember/react-i18n'; @@ -89,11 +92,23 @@ import { MouseEvent as MouseEvent_2 } from 'react'; import { Node as Node_2 } from 'slate'; import { NodeEntry } from 'slate'; import type { OptionallyVariableFieldValue } from '@contember/react-binding'; +import { Page } from '@contember/react-routing'; +import { PageModule } from '@contember/react-routing'; +import { PageNotFound } from '@contember/react-routing'; +import { PageProps } from '@contember/react-routing'; +import { PageProvider } from '@contember/react-routing'; +import { PageProviderElement } from '@contember/react-routing'; +import { PageRequest } from '@contember/react-routing'; +import { PagesMap } from '@contember/react-routing'; +import { PagesMapElement } from '@contember/react-routing'; +import { PagesProps } from '@contember/react-routing'; +import { parseLinkTarget } from '@contember/react-routing'; import { Path } from 'slate'; import { PathRef } from 'slate'; import { PersistFeedbackDictionary } from '@contember/react-binding-ui'; import type { PersistSuccessOptions } from '@contember/react-binding'; import { Point } from 'slate'; +import { projectEnvironmentExtension } from '@contember/react-identity'; import { PropsWithChildren } from 'react'; import { ProvidersProps } from '@contember/ui'; import { PureComponent } from 'react'; @@ -108,10 +123,21 @@ import { RemovalType } from '@contember/react-binding'; import { RenderElementProps } from 'slate-react'; import { RenderLeafProps } from 'slate-react'; import { RepeaterItemContainerProps } from '@contember/ui'; +import { RequestChange } from '@contember/react-routing'; +import { RequestProvider } from '@contember/react-routing'; +import { RequestState } from '@contember/react-routing'; +import { RouteMap } from '@contember/react-routing'; +import { RoutingContext } from '@contember/react-routing'; +import { RoutingContextValue } from '@contember/react-routing'; +import { RoutingLink as RoutingLinkBase } from '@contember/react-routing'; +import { RoutingLinkProps as RoutingLinkPropsBase } from '@contember/react-routing'; +import { RoutingLinkTarget } from '@contember/react-routing'; +import { RoutingParameter } from '@contember/react-routing'; import type { S3FileUploader } from '@contember/client'; import { SaveButtonProps } from '@contember/ui'; import type { Scalar } from '@contember/react-binding'; import { Scheme } from '@contember/ui'; +import { SelectedDimension } from '@contember/react-routing'; import { SelectEntityButtonProps } from '@contember/react-binding-ui'; import { Selection as Selection_2 } from 'slate'; import { SetStateAction } from 'react'; @@ -135,6 +161,13 @@ import { TableProps } from '@contember/ui'; import { TableRowProps } from '@contember/ui'; import { Text as Text_2 } from 'slate'; import { UnsugarableSingleEntityEventListeners } from '@contember/react-binding'; +import { useCurrentRequest } from '@contember/react-routing'; +import { useLinkFactory } from '@contember/react-routing'; +import { useLogout } from '@contember/react-identity'; +import { useIdentity as useOptionalIdentity } from '@contember/react-identity'; +import { useRedirect } from '@contember/react-routing'; +import { useRouting } from '@contember/react-routing'; +import { useRoutingLinkFactory } from '@contember/react-routing'; import { VisuallyDependentControlProps } from '@contember/ui'; // @public (undocumented) @@ -356,7 +389,7 @@ export interface AvatarProps { export const Block: FunctionComponent; // @public (undocumented) -export const blockAnalyzer: ChildrenAnalyzer; +export const blockAnalyzer: ChildrenAnalyzer>; // @public export const BlockEditor: FunctionComponent & { @@ -621,9 +654,6 @@ export interface CreateApiKeyFormProps { rolesConfig?: RolesConfig; } -// @public (undocumented) -export const createBindingLinkParametersResolver: (entity: EntityAccessor | undefined) => RoutingParameterResolver; - // @public (undocumented) export interface CreateEditorOptions extends OverrideCreateElementReferenceOptions, ReferenceElementOptions, OverrideInsertDataOptions, OverrideInsertElementWithReferenceOptions, CreateEditorPublicOptions { } @@ -721,8 +751,7 @@ export type CreateScopeProps = Omit; +export { CurrentRequestContext } // @public (undocumented) export interface CustomElementPlugin { @@ -795,7 +824,7 @@ export type DataGridPageProps = DataGridProps & { export const DataGridPageRenderer: React.NamedExoticComponent | undefined; -} & DataGridTableRowPublicProps & EntityListBaseProps & DataGridTilesPublicProps & DataGridRenderingCommonProps>; +} & DataGridTableRowPublicProps & DataGridTilesPublicProps>; // @public (undocumented) export type DataGridPageRendererProps = LayoutRendererProps & DataGridContainerProps; @@ -948,9 +977,6 @@ export type DisplayTextFieldProps = Omit JSX_2.Element; -// @public (undocumented) -export type DynamicRequestParameters = RequestParameters; - // @public (undocumented) export const EditIdentity: FC; @@ -1468,16 +1494,7 @@ export type GQLVariableValues; - -// @public (undocumented) -export interface HasRoleProps { - // (undocumented) - children?: ReactNode; - // (undocumented) - role: RoleCondition; -} +export { HasRole } // @public (undocumented) export interface HeadingElement extends Element_2 { @@ -1658,41 +1675,9 @@ export interface HtmlDeserializerPlugin { // @public (undocumented) export type HybridFileKindProps = DiscriminatedFileKindsProps | SingleKindFileProps; -// @public (undocumented) -export interface Identity { - // @deprecated (undocumented) - email?: string; - // (undocumented) - id: string; - // @deprecated (undocumented) - otpEnabled?: boolean; - // (undocumented) - permissions: { - canCreateProject: boolean; - }; - // (undocumented) - person?: Person; - // @deprecated (undocumented) - personId?: string; - // (undocumented) - projects: IdentityProject[]; -} +export { Identity } -// @public (undocumented) -export const IdentityContext: React.Context; - -// @public (undocumented) -export interface IdentityContextValue { - // (undocumented) - clearIdentity: () => void; - // (undocumented) - identity: Identity; -} - -// @public (undocumented) -export const identityEnvironmentExtension: Environment.Extension; +export { identityEnvironmentExtension } // @public (undocumented) export const IdentityMembership: FC; @@ -1705,16 +1690,6 @@ export interface IdentityMembershipProps { RoleRenderer: RoleRenderer; } -// @public (undocumented) -export interface IdentityProject { - // (undocumented) - name: string; - // (undocumented) - roles: string[]; - // (undocumented) - slug: string; -} - // @public (undocumented) export const IdentityProvider: React.FC; @@ -1728,9 +1703,6 @@ export interface IdentityProviderProps { onInvalidIdentity?: () => void; } -// @public (undocumented) -export const IdentityRefreshContext: React.Context<() => void>; - // @public (undocumented) export interface IDP { // (undocumented) @@ -1837,10 +1809,7 @@ export type ImmutableEntityListTablePageRendererProps> & { - pageName: string; -} | null; +export { IncompleteRequestState } // @public (undocumented) export const initBlockEditor: ({ editor, ...options }: CreateEditorOptions & { @@ -1887,11 +1856,9 @@ export interface InitSignInIDPResult { // @public (undocumented) export interface InnerRoutingLinkProps extends Omit { // (undocumented) - active: boolean; + href?: string; // (undocumented) - href: string; - // (undocumented) - onClick: (e?: MouseEvent_2) => void; + onClick?: (e?: MouseEvent_2) => void; } // @public (undocumented) @@ -1994,8 +1961,7 @@ export const isParagraphElement: (element: Node_2, suchThat?: Partial node is ReferenceElement; -// @public (undocumented) -export const isRoutingLinkTarget: (value: unknown) => value is RoutingLinkTarget; +export { isRoutingLinkTarget } // @public (undocumented) export const isScrollTargetElement: (element: Node_2) => element is ScrollTargetElement; @@ -2039,8 +2005,7 @@ export const LayoutRenderer: FunctionComponent; export interface LayoutRendererProps extends LayoutPageProps { } -// @public (undocumented) -export type LazyPageModule = () => Promise; +export { LazyPageModule } // @public (undocumented) export const LegacyDeprecatedEditorFormerlyKnownAsRichTextField: FunctionComponent; @@ -2050,7 +2015,7 @@ export interface LegacyDeprecatedEditorFormerlyKnownAsRichTextFieldProps extends } // @public (undocumented) -export const Link: React.NamedExoticComponent; +export const Link: React.NamedExoticComponent, "href"> & Omit>; // @public export const LinkButton: React.NamedExoticComponent; @@ -2059,11 +2024,7 @@ export const LinkButton: React.NamedExoticComponent; export type LinkButtonProps = LinkProps & AnchorButtonProps; // @public (undocumented) -export interface LinkProps extends Omit, 'href'>, Omit { -} - -// @public (undocumented) -export type LinkTarget = RoutingLinkTarget; +export type LinkProps = Omit, 'href'> & Omit; // @public (undocumented) export interface ListElementProperties { @@ -2474,80 +2435,34 @@ export interface OverrideInsertElementWithReferenceOptions { insertElementWithReference: InsertElementWithReference; } -// @public -export const Page: { -

(props: PageProps

): JSX_2.Element | null; - displayName: string; - getPageName(props: PageProps): string; -}; +export { Page } // @public (undocumented) export type PageComponent = T & PageProvider any ? P : never>; -// @public @deprecated (undocumented) -export const PageLink: React.NamedExoticComponent; - // @public @deprecated (undocumented) export const PageLinkButton: React.NamedExoticComponent; -// @public (undocumented) -export interface PageModule { - // (undocumented) - [action: string]: ComponentType | ReactElement | undefined; -} +export { PageModule } -// @public (undocumented) -export class PageNotFound extends Error { - constructor(reason?: string); -} +export { PageNotFound } -// @public (undocumented) -export interface PageProps

{ - // (undocumented) - children: FunctionComponent

| ReactNode; - // (undocumented) - name: string; -} +export { PageProps } -// @public (undocumented) -export interface PageProvider

{ - // (undocumented) - getPageName(props: P, fallback?: string): string; -} - -// @public (undocumented) -export type PageProviderElement = ReactElement & PageProvider>; +export { PageProvider } -// @public (undocumented) -export interface PageRequest

= RequestParameters> { - // (undocumented) - dimensions: SelectedDimension; - // (undocumented) - pageName: string; - // (undocumented) - parameters: P; -} +export { PageProviderElement } -// @public -export const Pages: ({ children, layout, bindingFeedbackRenderer }: PagesProps) => JSX_2.Element; +export { PageRequest } // @public (undocumented) -export type PagesMap = Record; +export const Pages: (props: PagesProps) => JSX_2.Element; -// @public (undocumented) -export type PagesMapElement = LazyPageModule | PageModule | ComponentType | ReactElement | PageProviderElement; +export { PagesMap } -// @public (undocumented) -export interface PagesProps { - // (undocumented) - bindingFeedbackRenderer?: ComponentType; - // (undocumented) - children: PagesMap | PageProviderElement[] | PageProviderElement; - // (undocumented) - layout?: ComponentType<{ - children?: ReactNode; - }>; -} +export { PagesMapElement } + +export { PagesProps } // @public (undocumented) export interface ParagraphElement extends Element_2 { @@ -2585,31 +2500,17 @@ export interface ParagraphRendererProps extends Omit; -// @public (undocumented) -export const parseLinkTarget: (to: LinkTarget, env: Environment) => Exclude; +export { parseLinkTarget } // @public (undocumented) export type PasswordResetErrors = 'TOKEN_NOT_FOUND' | 'TOKEN_USED' | 'TOKEN_EXPIRED' | 'PASSWORD_TOO_WEAK'; -// @public (undocumented) -export const pathToRequestState: (routing: RoutingContextValue, path: string, query: string) => RequestState; - // @public export const PersistButton: React.MemoExoticComponent>>; // @public (undocumented) export type PersistButtonProps = Omit; -// @public (undocumented) -export interface Person { - // (undocumented) - email: string; - // (undocumented) - id: string; - // (undocumented) - otpEnabled: boolean; -} - // @public (undocumented) export interface PlainTextFieldBackedElement { // (undocumented) @@ -2634,9 +2535,6 @@ export interface PopulateEmbedDataOptions { source: string; } -// @public (undocumented) -export const populateRequest: (routing: RoutingContextValue, location: Location) => RequestState; - // @public (undocumented) export const prepareElementForInsertion: (editor: Editor_2, node: Node_2) => Path; @@ -2672,10 +2570,7 @@ export interface Project { // @public (undocumented) export const PROJECT_ROLES_FRAGMENT = "\n\tfragment ProjectRoles on Project {\n\t\troles {\n\t\t\tname\n\t\t\tvariables {\n\t\t\t\t... on RoleEntityVariableDefinition {\n\t\t\t\t\tname\n\t\t\t\t\tentityName\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"; -// @public (undocumented) -export const projectEnvironmentExtension: Environment.Extension; +export { projectEnvironmentExtension } // @public (undocumented) export interface ProjectGridProps { @@ -2719,9 +2614,6 @@ export type PublicSingleKindFileRepeaterProps = CommonFileKindProps & SelectFileInputSelectionComponentProps & FileInputPublicProps; -// @public (undocumented) -export const PushRequestContext: React.Context<(req: RequestState) => void>; - // @public (undocumented) export interface QueryRequestObject { // (undocumented) @@ -2909,27 +2801,11 @@ export interface RepeaterItemProps extends Omit extends SugaredRelativeEntityList, Omit, 'accessor'> { } -// @public (undocumented) -export type RequestChange = (currentState: RequestState) => IncompleteRequestState | string; - -// @public (undocumented) -export const requestChangeFactory:

(pageName: string, parameters?: P | undefined) => (currentState: RequestState) => PageRequest

; +export { RequestChange } -// @public (undocumented) -export type RequestParameters = { - [K in string]?: RequestParameterValue | Extra; -}; +export { RequestProvider } -// @public (undocumented) -export type RequestParameterValue = number | string; - -// @public (undocumented) -export const RequestProvider: FC<{ - children: ReactNode; -}>; - -// @public (undocumented) -export type RequestState = RequestParameters> = PageRequest | null; +export { RequestState } // @public (undocumented) export interface RequestStateError { @@ -2955,9 +2831,6 @@ export interface RequestStateOk { state: 'success'; } -// @public (undocumented) -export const requestStateToPath: (routing: RoutingContextValue, request: RequestState) => string; - // @public (undocumented) export interface RequestStateUninitialized { // (undocumented) @@ -3058,9 +2931,6 @@ export interface RichTextFieldProps extends FieldBasicProps, Omit) => boolean); - // @public (undocumented) export interface RoleConfig { // (undocumented) @@ -3118,106 +2988,33 @@ export interface RoleVariableDefinitionBase { name: string; } -// @public (undocumented) -export type RouteConfig = RouteConfigWithMapping | RouteConfigWithoutMapping; - -// @public (undocumented) -export interface RouteConfigWithMapping { - // (undocumented) - objectToParams: (params: N) => T; - // (undocumented) - paramsToObject: (params: T) => { - [K in Exclude]: N[K]; - }; - // (undocumented) - path: string; -} - -// @public (undocumented) -export interface RouteConfigWithoutMapping { - // (undocumented) - objectToParams?: undefined; - // (undocumented) - paramsToObject?: undefined; - // (undocumented) - path: string; -} - -// @public (undocumented) -export type RouteMap = { - [K in N]: RouteConfig>; -}; - -// @public (undocumented) -export type RouteName = string; - -// @public (undocumented) -export type RouteParams = any; - -// @public (undocumented) -export type RouteParamsByName = T extends { - name: K; -} ? T : never; - -// @public (undocumented) -export const ROUTING_BINDING_PARAMETER_PREFIX = "entity."; +export { RouteMap } -// @public (undocumented) -export const RoutingContext: React.Context; +export { RoutingContext } -// @public (undocumented) -export interface RoutingContextValue { - // (undocumented) - basePath: string; - // (undocumented) - defaultDimensions?: SelectedDimension; - // (undocumented) - pageInQuery?: boolean; - // (undocumented) - routes: RouteMap; -} +export { RoutingContextValue } // @public -export const RoutingLink: React.NamedExoticComponent & PublicAnchorProps>; +export const RoutingLink: React.NamedExoticComponent & { + children?: ReactNode; + Component?: ComponentType | undefined; + componentProps?: {} | undefined; +} & PublicAnchorProps>; -// @public (undocumented) -export interface RoutingLinkParams { - // (undocumented) - href: string; - // (undocumented) - isActive: boolean; - // (undocumented) - navigate: (e?: BaseSyntheticEvent) => void; -} +export { RoutingLinkBase } // @public (undocumented) -export interface RoutingLinkProps { - // (undocumented) +export type RoutingLinkProps = Omit & { children?: ReactNode; - // (undocumented) Component?: ComponentType; - // (undocumented) componentProps?: T; - // (undocumented) - parameters?: RequestParameters; - // (undocumented) - parametersResolver?: RoutingParameterResolver; - // (undocumented) - to: RoutingLinkTarget; -} +}; -// @public (undocumented) -export type RoutingLinkTarget = string | RequestChange | IncompleteRequestState; +export { RoutingLinkPropsBase } -// @public (undocumented) -export class RoutingParameter { - constructor(name: string); - // (undocumented) - readonly name: string; -} +export { RoutingLinkTarget } -// @public (undocumented) -export type RoutingParameterResolver = (name: string) => RequestParameterValue | undefined; +export { RoutingParameter } // @public (undocumented) export const runReactApp: (reactElement: ReactElement, domRoot?: HTMLElement | string | null, render?: ReactRenderer) => void; @@ -3250,11 +3047,7 @@ export interface ScrollTargetRendererProps extends Omit; -// @public (undocumented) -export interface SelectedDimension { - // (undocumented) - [key: string]: string[]; -} +export { SelectedDimension } // @public (undocumented) export type SelectedDimensionRenderer = (dimensionData: StatefulDimensionDatum[]) => ReactNode; @@ -3532,9 +3325,6 @@ export const tableRowElementType: "tableRow"; // @public (undocumented) export const tableToolbarButton: ElementToolbarButton; -// @public (undocumented) -export const targetToRequest: (target: RoutingLinkTarget, currentRequest: RequestState) => IncompleteRequestState | null; - // @public (undocumented) export interface TenantMutationErrorResponse { // (undocumented) @@ -3688,9 +3478,6 @@ export const useAuthedTenantMutation: (quer // @public (undocumented) export const useAuthedTenantQuery: (query: string, variables: V) => QueryRequestObject; -// @public (undocumented) -export const useBindingLinkParametersResolver: () => RoutingParameterResolver; - // @public (undocumented) export const useBlockEditorSlateNodes: ({ editor, blockElementCache, blockElementPathRefs, blockContentField, topLevelBlocks, }: UseBlockEditorSlateNodesOptions) => Descendant[]; @@ -3755,8 +3542,7 @@ export const useCreateResetPasswordRequest: () => TenantMutationExecutor; }>, TenantMutationResponse>; -// @public (undocumented) -export const useCurrentRequest: () => RequestState; +export { useCurrentRequest } // @public (undocumented) export const useDisableOtp: () => TenantMutationExecutor, TenantMutationResponse>; @@ -3832,6 +3618,8 @@ method: GQLVariableType; mailVariant: GQLVariableType; }>, TenantMutationResponse>; +export { useLinkFactory } + // @public (undocumented) export const useListMembersQuery: (projectSlug: string, memberType: ListMembersQueryVariables['memberType']) => QueryRequestObject; @@ -3848,10 +3636,7 @@ expiration: GQLVariableType; otpToken: GQLVariableType; }>, TenantMutationResponse>; -// @public (undocumented) -export const useLogout: () => ({ noRedirect }?: { - noRedirect?: boolean | undefined; -}) => Promise; +export { useLogout } // @public (undocumented) export const useMutation: >(client: GraphQlClient, query: string, apiToken?: string, headers?: Record) => UseMutationReturn; @@ -3870,8 +3655,7 @@ export type UseOnPersistSuccessProps = Pick Identity | undefined; +export { useOptionalIdentity } // @public (undocumented) export const usePrepareOtp: () => TenantMutationExecutor ProjectUserRoles; -// @public (undocumented) -export const usePushRequest: () => (req: RequestState) => void; - // @public (undocumented) export const useQuery: (client: GraphQlClient, query: string, variables: V, apiToken?: string) => QueryRequestObject; -// @public (undocumented) -export const useRedirect: () => (target: RoutingLinkTarget, parameters?: RequestParameters) => void; +export { useRedirect } // @public (undocumented) export const useRedirectToBacklink: () => void; @@ -3938,14 +3718,9 @@ export type UseRoleRendererFactoryProps = { roleRenderers?: RoleRenderers; }; -// @public (undocumented) -export const useRouting: () => RoutingContextValue; +export { useRouting } -// @public (undocumented) -export const useRoutingLink: (target: RoutingLinkTarget, parametersResolver?: RoutingParameterResolver, parameters?: RequestParameters) => RoutingLinkParams; - -// @public (undocumented) -export const useRoutingLinkFactory: () => (target: RoutingLinkTarget, parameters?: RequestParameters, parametersResolver?: RoutingParameterResolver) => RoutingLinkParams; +export { useRoutingLinkFactory } // @public (undocumented) export const UsersList: React.NamedExoticComponent; @@ -4194,10 +3969,10 @@ export const withUnderline: (editor: E) => E; export * from "@contember/react-auto"; export * from "@contember/react-binding"; export * from "@contember/react-binding-ui"; -export * from "@contember/react-board-ui"; export * from "@contember/react-choice-field-ui"; export * from "@contember/react-client"; export * from "@contember/react-datagrid-ui"; +export * from "@contember/react-devbar"; export * from "@contember/react-form-fields-ui"; export * from "@contember/react-i18n"; export * from "@contember/react-leaflet-fields-ui"; diff --git a/build/api/binding.api.md b/build/api/binding.api.md index 79f0b6148f..5160b968ea 100644 --- a/build/api/binding.api.md +++ b/build/api/binding.api.md @@ -161,11 +161,11 @@ export class EntityAccessor implements Errorable { // (undocumented) batchUpdates(performUpdates: EntityAccessor.BatchUpdatesHandler): void; // (undocumented) - connectEntityAtField(field: FieldName, entityToConnect: EntityAccessor): void; + connectEntityAtField(field: SugaredRelativeSingleEntity | string, entityToConnect: EntityAccessor): void; // (undocumented) deleteEntity(): void; // (undocumented) - disconnectEntityAtField(field: FieldName, initializeReplacement?: EntityAccessor.BatchUpdatesHandler): void; + disconnectEntityAtField(field: SugaredRelativeSingleEntity | string, initializeReplacement?: EntityAccessor.BatchUpdatesHandler): void; // (undocumented) readonly environment: Environment; // (undocumented) @@ -486,9 +486,9 @@ export class EntitySubTreeMarker { } // @public (undocumented) -export class Environment { +export class Environment { // (undocumented) - static create(): Environment; + static create(): Environment; // (undocumented) getAllDimensions(): Environment.SelectedDimensions; // (undocumented) @@ -512,7 +512,7 @@ export class Environment { // (undocumented) getSubTree(): Environment.SubTreeNode; // (undocumented) - getSubTreeNode(): Environment.AnyNode; + getSubTreeNode(): Node & Environment.AnyNode; // @deprecated (undocumented) getValue(key: string): V; // @deprecated (undocumented) @@ -542,9 +542,9 @@ export class Environment { // (undocumented) withSchema(schema: Schema): Environment; // (undocumented) - withSubTree(SubTree: Environment.SubTreeNode): Environment; + withSubTree(SubTree: Node): Environment; // (undocumented) - withSubTreeChild(node: Environment.InnerNode): Environment; + withSubTreeChild(node: Node): Environment; // (undocumented) withVariables(variables: Environment.ValuesMapWithFactory | undefined): Environment; } @@ -598,13 +598,13 @@ export namespace Environment { // (undocumented) export type Name = string; // (undocumented) - export interface Options { + export interface Options { // (undocumented) dimensions: SelectedDimensions; // (undocumented) extensions: Map, unknown>; // (undocumented) - node?: AnyNode; + node?: Node; // (undocumented) parameters: Parameters; // (undocumented) @@ -1861,7 +1861,7 @@ export class TreeAugmenter { // @public (undocumented) export class TreeNodeEnvironmentFactory { // (undocumented) - static createEnvironmentForEntity(environment: Environment, sugaredRelativeSingleEntity: SugaredRelativeSingleEntity): Environment; + static createEnvironmentForEntity(environment: Environment, sugaredRelativeSingleEntity: SugaredRelativeSingleEntity): Environment; // (undocumented) static createEnvironmentForEntityList(environment: Environment, sugaredRelativeEntityList: SugaredRelativeEntityList): Environment; // (undocumented) @@ -1869,7 +1869,11 @@ export class TreeNodeEnvironmentFactory { // (undocumented) static createEnvironmentForEntitySubtree(environment: Environment, sugaredEntityList: SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity): Environment; // (undocumented) - static createEnvironmentForField(environment: Environment, sugaredRelativeSingleField: SugaredRelativeSingleField): Environment; + static createEnvironmentForField(environment: Environment, sugaredRelativeSingleField: SugaredRelativeSingleField): Environment<{ + type: "column"; + entity: SchemaEntity; + field: SchemaColumn; + }>; } // @public (undocumented) diff --git a/build/api/client-content.api.md b/build/api/client-content.api.md index 8f00ac8d61..f5074eb359 100644 --- a/build/api/client-content.api.md +++ b/build/api/client-content.api.md @@ -7,6 +7,7 @@ import { GraphQlClient } from '@contember/graphql-client'; import { GraphQlClientRequestOptions } from '@contember/graphql-client'; import { GraphQlFieldTypedArgs } from '@contember/graphql-builder'; +import { GraphQlFragment } from '@contember/graphql-builder'; import { GraphQlSelectionSet } from '@contember/graphql-builder'; import { Input } from '@contember/schema'; import { JSONObject } from '@contember/schema'; @@ -391,6 +392,9 @@ export type MutationError = { readonly type: Result.ExecutionErrorType; }; +// @public (undocumented) +export const mutationFragments: Record; + // @public (undocumented) export type MutationResult = { readonly ok: boolean; diff --git a/build/api/client-generator.api.md b/build/api/client-generator.api.md deleted file mode 100644 index f9fc3082c8..0000000000 --- a/build/api/client-generator.api.md +++ /dev/null @@ -1,37 +0,0 @@ -## API Report File for "@contember/client-generator" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { Model } from '@contember/schema'; -import { SchemaNames } from '@contember/client'; - -// @public (undocumented) -export class ContemberClientGenerator { - constructor(nameSchemaGenerator?: NameSchemaGenerator, enumTypeSchemaGenerator?: EnumTypeSchemaGenerator, entityTypeSchemaGenerator?: EntityTypeSchemaGenerator); - // (undocumented) - generate(model: Model.Schema): Record; -} - -// @public (undocumented) -export class EntityTypeSchemaGenerator { - // (undocumented) - generate(model: Model.Schema): string; -} - -// @public (undocumented) -export class EnumTypeSchemaGenerator { - // (undocumented) - generate(model: Model.Schema): string; -} - -// @public (undocumented) -export class NameSchemaGenerator { - // (undocumented) - generate(model: Model.Schema): SchemaNames; -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/build/api/interface-tester.api.md b/build/api/interface-tester.api.md index 7fc451773f..fcd314af61 100644 --- a/build/api/interface-tester.api.md +++ b/build/api/interface-tester.api.md @@ -23,7 +23,7 @@ export const createEnvironment: ({ model, role, pageConfig }: { role: string; model: Model.Schema; pageConfig: PageConfig; -}) => Environment; +}) => Environment; // @public (undocumented) export const createNode: (value: any) => ReactNode[]; diff --git a/build/api/interface.api.md b/build/api/interface.api.md new file mode 100644 index 0000000000..29022279b5 --- /dev/null +++ b/build/api/interface.api.md @@ -0,0 +1,98 @@ +## API Report File for "@contember/interface" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { ContemberClientProps } from '@contember/react-client'; +import { EntityAccessor } from '@contember/react-binding'; +import { Environment } from '@contember/react-binding'; +import { ErrorPersistResult } from '@contember/react-binding'; +import { JSX as JSX_2 } from 'react/jsx-runtime'; +import { NamedExoticComponent } from 'react'; +import { ReactElement } from 'react'; +import { ReactNode } from 'react'; +import { RouteMap } from '@contember/react-routing'; +import { RoutingLinkTarget } from '@contember/react-routing'; +import { SuccessfulPersistResult } from '@contember/react-binding'; +import { SugaredRelativeSingleField } from '@contember/react-binding'; + +// @public (undocumented) +export const ApplicationEntrypoint: (props: ApplicationEntrypointProps) => JSX_2.Element; + +// @public (undocumented) +export interface ApplicationEntrypointProps extends ContemberClientProps { + // (undocumented) + basePath: string; + // (undocumented) + children: ReactNode; + // (undocumented) + environment?: Environment; + // (undocumented) + routes?: RouteMap; + // (undocumented) + sessionToken?: string; +} + +// @public (undocumented) +export const ClearFieldTrigger: NamedExoticComponent; + +// @public (undocumented) +export interface ClearFieldTriggerProps { + // (undocumented) + children: ReactNode; + // (undocumented) + field: SugaredRelativeSingleField['field']; +} + +// @public (undocumented) +export const DeleteEntityTrigger: ({ immediatePersist, onPersistError, onPersistSuccess, ...props }: DeleteEntityTriggerProps) => JSX_2.Element; + +// @public (undocumented) +export interface DeleteEntityTriggerProps { + // (undocumented) + children: ReactNode; + // (undocumented) + immediatePersist?: true; + // (undocumented) + onPersistError?: (result: ErrorPersistResult) => void; + // (undocumented) + onPersistSuccess?: (result: SuccessfulPersistResult) => void; +} + +// @public (undocumented) +export const EntityBeforePersist: ({ listener }: { + listener: EntityAccessor.EntityEventListenerMap['beforePersist']; +}) => null; + +// @public (undocumented) +export const PersistTrigger: ({ onPersistError, onPersistSuccess, ...props }: PersistTriggerProps) => JSX_2.Element; + +// @public (undocumented) +export interface PersistTriggerProps { + // (undocumented) + children: ReactElement; + // (undocumented) + onPersistError?: (result: ErrorPersistResult) => void; + // (undocumented) + onPersistSuccess?: (result: SuccessfulPersistResult) => void; +} + +// @public (undocumented) +export const RedirectOnPersist: ({ to }: { + to: RoutingLinkTarget; +}) => null; + +// @public (undocumented) +export const runReactApp: (reactElement: ReactElement, { domRoot }?: { + domRoot?: HTMLElement | undefined; +}) => void; + + +export * from "@contember/react-binding"; +export * from "@contember/react-identity"; +export * from "@contember/react-routing"; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/layout.api.md b/build/api/layout.api.md index 2d1232482c..f800038a29 100644 --- a/build/api/layout.api.md +++ b/build/api/layout.api.md @@ -230,8 +230,8 @@ declare namespace Directives { Directive, ProviderProps, Provider, - useDirectives, StateContext, + useDirectives, RegistryContext, useRegistryContext, RegistryContextType @@ -852,7 +852,7 @@ export const useContainerInsetsContext: () => ContainerInsets; function useDirectiveLifecycle, K extends keyof T & string, V extends T[K]>(name: K, content: V): boolean; // @public (undocumented) -function useDirectives>(): T; +const useDirectives: >() => T; // @public (undocumented) export function useElementInsetCustomProperties(elementRef: RefObject, prefix?: string): CSSProperties | undefined; diff --git a/build/api/react-auto.api.md b/build/api/react-auto.api.md index d181016e79..9f6d1c81a4 100644 --- a/build/api/react-auto.api.md +++ b/build/api/react-auto.api.md @@ -81,11 +81,9 @@ export type AutoLabelProps = { // @public (undocumented) export interface InnerLinkProps { // (undocumented) - active: boolean; + href?: string; // (undocumented) - href: string; - // (undocumented) - onClick: (e?: MouseEvent_2) => void; + onClick?: (e?: MouseEvent_2) => void; } // @public (undocumented) diff --git a/build/api/react-binding.api.md b/build/api/react-binding.api.md index 00aab3bada..276c50673a 100644 --- a/build/api/react-binding.api.md +++ b/build/api/react-binding.api.md @@ -35,7 +35,7 @@ import type { RelativeEntityList } from '@contember/binding'; import type { RelativeSingleEntity } from '@contember/binding'; import { RelativeSingleField } from '@contember/binding'; import type { SugaredParentEntityParameters } from '@contember/binding'; -import type { SugaredQualifiedEntityList } from '@contember/binding'; +import { SugaredQualifiedEntityList } from '@contember/binding'; import type { SugaredQualifiedSingleEntity } from '@contember/binding'; import type { SugaredRelativeEntityList } from '@contember/binding'; import type { SugaredRelativeSingleEntity } from '@contember/binding'; @@ -220,6 +220,9 @@ export interface EntityListSubTreeAdditionalProps { variables?: Environment.ValuesMapWithFactory; } +// @public (undocumented) +export type EntityListSubTreeLoaderState = 'initial' | 'refreshing' | 'loaded'; + // @public (undocumented) export type EntityListSubTreeProps = { treeRootId?: TreeRootId; @@ -278,7 +281,7 @@ export interface EnvironmentAwareFunctionComponent

{ } // @public (undocumented) -export const EnvironmentContext: Context; +export const EnvironmentContext: Context>; // @public (undocumented) export interface EnvironmentDeltaProvider { @@ -678,6 +681,16 @@ export function useEntityList(sugaredRelativeEntityList: string | SugaredRelativ export const useEntityListSubTree: (qualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList, ...treeId: [TreeRootId | undefined] | [ ]) => EntityListAccessor; +// @public (undocumented) +export const useEntityListSubTreeLoader: (entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State | undefined) => [UseEntityListSubTreeLoaderResult, EntityListSubTreeLoaderState]; + +// @public (undocumented) +export type UseEntityListSubTreeLoaderResult = { + entities: SugaredQualifiedEntityList | undefined; + treeRootId: TreeRootId | undefined; + state: State | undefined; +}; + // @public (undocumented) export function useEntityListSubTreeParameters(alias: Alias): Alias; diff --git a/build/api/react-board-dnd-kit.api.md b/build/api/react-board-dnd-kit.api.md index 108198e84d..f1b9a8327b 100644 --- a/build/api/react-board-dnd-kit.api.md +++ b/build/api/react-board-dnd-kit.api.md @@ -4,64 +4,153 @@ ```ts -import { BoardBaseProps } from '@contember/react-board'; -import { BoardBindingProps } from '@contember/react-board'; -import { BoardColumn } from '@contember/react-board'; -import { BoardItem } from '@contember/react-board'; -import { BoardMethods } from '@contember/react-board'; -import { default as React_2 } from 'react'; +/// + +import { Active } from '@dnd-kit/core'; +import { BoardColumnNode } from '@contember/react-board'; +import { BoardItemNode } from '@contember/react-board'; +import { BoardNullColumnProps } from '@contember/react-board'; +import { ClientRect as ClientRect_2 } from '@dnd-kit/core'; +import { Context } from 'react'; +import { DraggableAttributes } from '@dnd-kit/core'; +import { JSX as JSX_2 } from 'react/jsx-runtime'; +import { MutableRefObject } from 'react'; +import { Over } from '@dnd-kit/core'; import { ReactNode } from 'react'; -import { useSortable } from '@dnd-kit/sortable'; +import { SortableData } from '@dnd-kit/sortable'; +import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities'; +import { Transform } from '@dnd-kit/utilities'; +import { UniqueIdentifier } from '@dnd-kit/core'; + +// @internal (undocumented) +export const BoardActiveColumnContext: Context; + +// @internal (undocumented) +export const BoardActiveItemContext: Context<(BoardItemNode & { +column: BoardColumnNode; +}) | undefined>; // @public (undocumented) -export type BoardColumnRendererProps = { - children?: ReactNode; - value?: BoardColumn; - dragOverlay?: boolean; - sortableProps?: UseSortableProps; - boardMethods?: BoardMethods; - dropIndicator?: 'before' | 'after'; -}; +export const BoardSortable: ({ children }: { + children: ReactNode; +}) => JSX_2.Element; // @public (undocumented) -export type BoardDndKitRendererProps = BoardBindingProps; +export const BoardSortableActivator: ({ children }: { + children: ReactNode; +}) => JSX_2.Element; // @public (undocumented) -export type BoardItemRendererProps = { - value?: BoardItem; - dragOverlay?: boolean; - sortableProps?: UseSortableProps; - boardMethods?: BoardMethods; - dropIndicator?: 'before' | 'after'; -}; +export const BoardSortableColumnDragOverlay: ({ children }: { + children: ReactNode; +}) => JSX_2.Element | null; + +// @public (undocumented) +export const BoardSortableColumnDropIndicator: ({ children, position }: { + children: ReactNode; + position: 'before' | 'after'; +}) => JSX_2.Element | null; // @public (undocumented) -export const createBoardDndKit: ({ Column, Item, Wrapper, usePortalProvider }: { - Wrapper: React_2.ComponentType<{ +export const BoardSortableEachColumn: { + ({ children }: { + children: ReactNode; + }): JSX_2.Element; + staticRender({ children }: { children: ReactNode; - }>; - Column: React_2.ComponentType; - Item: React_2.ComponentType; - usePortalProvider?: (() => Element | null) | undefined; -}) => React_2.FunctionComponent>; + }): JSX_2.Element; +}; // @public (undocumented) -export const createBoardDndKitRenderer: ({ Column, Item, Wrapper, usePortalProvider }: { - Wrapper: React_2.ComponentType<{ +export const BoardSortableEachItem: { + ({ children }: { children: ReactNode; - }>; - Column: React_2.ComponentType; - Item: React_2.ComponentType; - usePortalProvider?: (() => Element | null) | undefined; -}) => React_2.FunctionComponent<{ - columns: BoardColumn[]; -} & BoardMethods & ColumnExtraProps & ItemExtraProps>; + }): JSX_2.Element; + staticRender({ children }: { + children: ReactNode; + }): JSX_2.Element; +}; + +// @public (undocumented) +export const BoardSortableItemDragOverlay: ({ children }: { + children: ReactNode; +}) => JSX_2.Element | null; + +// @public (undocumented) +export const BoardSortableItemDropIndicator: ({ children, position }: { + children: ReactNode; + position: 'before' | 'after'; +}) => JSX_2.Element | null; + +// @public (undocumented) +export const BoardSortableNode: ({ children }: { + children: ReactNode; +}) => JSX_2.Element; + +// @internal (undocumented) +export const BoardSortableNodeContext: Context< { +active: Active | null; +activeIndex: number; +attributes: DraggableAttributes; +data: SortableData & { +[x: string]: any; +}; +rect: MutableRefObject; +index: number; +newIndex: number; +items: UniqueIdentifier[]; +isOver: boolean; +isSorting: boolean; +isDragging: boolean; +listeners: SyntheticListenerMap | undefined; +node: MutableRefObject; +overIndex: number; +over: Over | null; +setNodeRef: (node: HTMLElement | null) => void; +setActivatorNodeRef: (element: HTMLElement | null) => void; +setDroppableNodeRef: (element: HTMLElement | null) => void; +setDraggableNodeRef: (element: HTMLElement | null) => void; +transform: Transform | null; +transition: string | undefined; +}>; + +// @public (undocumented) +export const BoardSortableNullColumn: ({ children }: BoardNullColumnProps) => JSX_2.Element; // @public (undocumented) -export type UseSortableProps = ReturnType; +export const useBoardActiveColumn: () => BoardColumnNode | undefined; +// @public (undocumented) +export const useBoardActiveItem: () => (BoardItemNode & { + column: BoardColumnNode; +}) | undefined; -export * from "@contember/react-board"; +// @public (undocumented) +export const useBoardSortableNode: () => { + active: Active | null; + activeIndex: number; + attributes: DraggableAttributes; + data: SortableData & { + [x: string]: any; + }; + rect: MutableRefObject; + index: number; + newIndex: number; + items: UniqueIdentifier[]; + isOver: boolean; + isSorting: boolean; + isDragging: boolean; + listeners: SyntheticListenerMap | undefined; + node: MutableRefObject; + overIndex: number; + over: Over | null; + setNodeRef: (node: HTMLElement | null) => void; + setActivatorNodeRef: (element: HTMLElement | null) => void; + setDroppableNodeRef: (element: HTMLElement | null) => void; + setDraggableNodeRef: (element: HTMLElement | null) => void; + transform: Transform | null; + transition: string | undefined; +}; // (No @packageDocumentation comment for this package) diff --git a/build/api/react-board-ui.api.md b/build/api/react-board-ui.api.md deleted file mode 100644 index b6e0378be9..0000000000 --- a/build/api/react-board-ui.api.md +++ /dev/null @@ -1,35 +0,0 @@ -## API Report File for "@contember/react-board-ui" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { BoardBaseProps } from '@contember/react-board'; -import { BoardColumnRendererProps } from '@contember/react-board-dnd-kit'; -import { ComponentType } from 'react'; -import { default as React_2 } from 'react'; - -// @public (undocumented) -export const Board: ComponentType; - -// @public (undocumented) -export type BoardColumnExtraProps = { - columnLabel?: React_2.ReactElement | ComponentType; - nullColumnLabel?: React_2.ReactNode; - columnFooter?: React_2.ReactElement | ComponentType; -}; - -// @public (undocumented) -export type BoardItemExtraProps = { - children: React_2.ReactNode; -}; - -// @public (undocumented) -export type BoardProps = BoardBaseProps; - - -export * from "@contember/react-board-dnd-kit"; - -// (No @packageDocumentation comment for this package) - -``` diff --git a/build/api/react-board.api.md b/build/api/react-board.api.md index 2e28b11c2b..dab66f964c 100644 --- a/build/api/react-board.api.md +++ b/build/api/react-board.api.md @@ -4,9 +4,9 @@ ```ts -import { ComponentType } from 'react'; -import { EntityAccessor } from '@contember/react-binding'; -import { EntityListAccessor } from '@contember/react-binding'; +import { Context } from 'react'; +import { EntityAccessor } from '@contember/binding'; +import { JSX as JSX_2 } from 'react/jsx-runtime'; import { NamedExoticComponent } from 'react'; import { ReactNode } from 'react'; import { SugaredQualifiedEntityList } from '@contember/react-binding'; @@ -14,6 +14,9 @@ import { SugaredRelativeEntityList } from '@contember/react-binding'; import { SugaredRelativeSingleEntity } from '@contember/react-binding'; import { SugaredRelativeSingleField } from '@contember/react-binding'; +// @public (undocumented) +export const Board: NamedExoticComponent; + // @public (undocumented) export type BoardAddColumnMethod = (index: number | undefined, preprocess?: EntityAccessor.BatchUpdatesHandler) => void; @@ -21,31 +24,42 @@ export type BoardAddColumnMethod = (index: number | undefined, preprocess?: Enti export type BoardAddItemMethod = (column: ColumnValue | null, index: number | undefined, preprocess?: EntityAccessor.BatchUpdatesHandler) => void; // @public (undocumented) -export type BoardBaseProps = (BoardQualifiedDynamicProps | BoardRelativeDynamicProps | BoardQualifiedStaticProps | BoardRelativeStaticProps) & RendererExtraProps; +export const BoardColumn: ({}: { + children: ReactNode; +}) => null; // @public (undocumented) -export type BoardBindingProps = { - columns: BoardColumn[]; -} & BoardMethods; +export const BoardColumnLabel: () => ReactNode; // @public (undocumented) -export type BoardColumn = { +export type BoardColumnNode = { id: string | number; index: number; value: ColumnValue | null; - items: BoardItem[]; + items: BoardItemNode[]; }; +// @internal (undocumented) +export const BoardColumnsContext: Context; + // @public (undocumented) export type BoardColumnValue = BoardStaticColumnValue | EntityAccessor; // @public (undocumented) -export type BoardCommonProps = BoardNullBehaviourProps & { +export type BoardCommonProps = { children: ReactNode; sortableBy?: string | SugaredRelativeSingleField; sortScope?: 'column' | 'board'; }; +// @internal (undocumented) +export const BoardCurrentColumnContext: Context; + +// @internal (undocumented) +export const BoardCurrentItemContext: Context; + // @public (undocumented) export type BoardDynamicColumnsBindingProps = { columns: SugaredQualifiedEntityList['entities']; @@ -54,14 +68,42 @@ export type BoardDynamicColumnsBindingProps = { }; // @public (undocumented) -export type BoardItem = { +export const BoardEachColumn: { + ({ children }: { + children: ReactNode; + }): (JSX_2.Element | null)[]; + staticRender({ children }: { + children: ReactNode; + }): JSX_2.Element; +}; + +// @public (undocumented) +export const BoardEachItem: { + ({ children }: { + children: ReactNode; + }): JSX_2.Element[]; + staticRender({ children }: { + children: ReactNode; + }): JSX_2.Element; +}; + +// @public (undocumented) +export const BoardItem: { + ({}: { + children: ReactNode; + }): null; + staticRender(): null; +}; + +// @public (undocumented) +export type BoardItemNode = { id: string | number; index: number; value: EntityAccessor; }; // @public (undocumented) -export type BoardMethods = { +export type BoardMethods = { moveColumn?: BoardMoveColumnMethod; addColumn?: BoardAddColumnMethod; removeColumn?: BoardRemoveColumnMethod; @@ -70,6 +112,9 @@ export type BoardMethods = { removeItem?: BoardRemoveItemMethod; }; +// @internal (undocumented) +export const BoardMethodsContext: Context>; + // @public (undocumented) export type BoardMoveColumnMethod = (entity: EntityAccessor, index: number) => void; @@ -77,14 +122,20 @@ export type BoardMoveColumnMethod = (entity: EntityAccessor, index: number) => v export type BoardMoveItemMethod = (entity: EntityAccessor, column: ColumnValue | null, index: number) => void; // @public (undocumented) -export type BoardNullBehaviourProps = { - nullColumn?: 'never' | 'always' | 'auto'; - nullColumnPlacement?: 'start' | 'end'; -}; +export const BoardNullColumn: ({ children, hideEmpty }: BoardNullColumnProps) => JSX_2.Element | null; // @public (undocumented) export const BoardNullColumnPlaceholder = "__null_column"; +// @public (undocumented) +export type BoardNullColumnProps = { + children: ReactNode; + hideEmpty?: boolean; +}; + +// @public (undocumented) +export type BoardProps = BoardQualifiedDynamicProps | BoardRelativeDynamicProps | BoardQualifiedStaticProps | BoardRelativeStaticProps; + // @public (undocumented) export type BoardQualifiedDynamicProps = BoardCommonProps & BoardDynamicColumnsBindingProps & BoardQualifiedItemsProps; @@ -125,31 +176,18 @@ export type BoardStaticColumnValue = { }; // @public (undocumented) -export const createBoard: ({ Renderer, ItemStaticRender, ColumnStaticRender }: CreateBoardArgs) => NamedExoticComponent>; - -// @public (undocumented) -export type CreateBoardArgs = { - Renderer: ComponentType & T>; - ItemStaticRender?: ComponentType; - ColumnStaticRender?: ComponentType; -}; +export const useBoardColumns: () => BoardColumnNode[]; // @public (undocumented) -export const useDynamicBoard: ({ sortableBy, sortScope, columnsSortableBy, discriminationField, columnEntities, itemEntities, nullColumnPlacement, nullColumn, }: UseDynamicBoardBindingProps) => BoardBindingProps; +export const useBoardCurrentColumn: () => BoardColumnNode; // @public (undocumented) -export type UseDynamicBoardBindingProps = Omit & BoardDynamicColumnsBindingProps & { - columnEntities: EntityListAccessor; - itemEntities: EntityListAccessor; +export const useBoardCurrentItem: () => BoardItemNode & { + column: BoardColumnNode; }; // @public (undocumented) -export const useStaticBoard: ({ sortableBy, sortScope, columns, discriminationField, itemEntities, nullColumnPlacement, nullColumn, }: UseStaticBoardBindingProps) => BoardBindingProps; - -// @public (undocumented) -export type UseStaticBoardBindingProps = Omit & BoardStaticColumnsBindingProps & { - itemEntities: EntityListAccessor; -}; +export const useBoardMethods: () => BoardMethods; // (No @packageDocumentation comment for this package) diff --git a/build/api/react-client-tenant.api.md b/build/api/react-client-tenant.api.md new file mode 100644 index 0000000000..b4848c62af --- /dev/null +++ b/build/api/react-client-tenant.api.md @@ -0,0 +1,24 @@ +## API Report File for "@contember/react-client-tenant" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Fetcher } from 'graphql-ts-client-api'; +import { ModelType } from 'graphql-ts-client-api'; + +export { ModelType } + +// @public (undocumented) +export const useTenantApi: () => (fetcher: Fetcher<"Query" | "Mutation", TData, TVariables>, options?: { + readonly variables?: TVariables | undefined; + readonly headers?: Record | undefined; + readonly apiToken?: string | undefined; +} | undefined) => Promise; + + +export * from "@contember/graphql-client-tenant"; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-datagrid-ui.api.md b/build/api/react-datagrid-ui.api.md index 4c76ae2240..cf503ca9c5 100644 --- a/build/api/react-datagrid-ui.api.md +++ b/build/api/react-datagrid-ui.api.md @@ -5,33 +5,34 @@ ```ts import { BooleanCellRendererProps } from '@contember/react-datagrid'; -import { BooleanFilterArtifacts } from '@contember/react-datagrid'; +import { BooleanFilterArtifacts } from '@contember/react-dataview'; import { CoalesceCellRendererProps } from '@contember/react-datagrid'; import { CoalesceFieldViewProps } from '@contember/react-binding-ui'; -import { CoalesceTextFilterArtifacts } from '@contember/react-datagrid'; +import { CoalesceTextFilterArtifacts } from '@contember/react-dataview'; import { ComponentType } from 'react'; -import { ControlledDataGridProps } from '@contember/react-datagrid'; import { DataGridColumnCommonProps } from '@contember/react-datagrid'; import { DataGridColumnProps } from '@contember/react-datagrid'; -import { DataGridOrderDirection } from '@contember/react-datagrid'; +import { DataGridColumns } from '@contember/react-datagrid'; import { DataGridProps } from '@contember/react-datagrid'; -import { DataGridRendererInnerProps } from '@contember/react-datagrid'; -import { DataGridRendererProps } from '@contember/react-datagrid'; +import { DataViewInfo } from '@contember/react-dataview'; +import { DataViewMethods } from '@contember/react-dataview'; +import { DataViewSortingDirection } from '@contember/react-dataview'; +import { DataViewState } from '@contember/react-dataview'; import { DateCellRendererProps } from '@contember/react-datagrid'; import { DateFieldViewFormattingProps } from '@contember/react-binding-ui'; -import { DateRangeFilterArtifacts } from '@contember/react-datagrid'; +import { DateRangeFilterArtifacts } from '@contember/react-dataview'; import { EmptyMessageProps } from '@contember/react-binding-ui'; import { EntityAccessor } from '@contember/react-binding'; import { EntityId } from '@contember/react-binding'; import { EntityListBaseProps } from '@contember/react-binding'; -import { EnumCellFilterArtifacts } from '@contember/react-datagrid'; import { EnumCellRendererProps } from '@contember/react-datagrid'; +import { EnumFilterArtifacts } from '@contember/react-dataview'; import { FieldFallbackViewProps } from '@contember/react-binding-ui'; import { FieldFallbackViewPublicProps } from '@contember/react-binding-ui'; import { FieldValue } from '@contember/binding'; import { FilterRendererProps } from '@contember/react-datagrid'; import { FunctionComponent } from 'react'; -import { GenericTextCellFilterArtifacts } from '@contember/react-datagrid'; +import { GenericTextCellFilterArtifacts } from '@contember/react-dataview'; import { HasManySelectProps } from '@contember/react-datagrid'; import { HasOneSelectProps } from '@contember/react-datagrid'; import { JSX as JSX_2 } from 'react/jsx-runtime'; @@ -42,19 +43,19 @@ import { NumberCellRendererProps } from '@contember/react-datagrid'; import { NumberFilterArtifacts } from '@contember/react-datagrid'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; -import { SelectCellArtifacts } from '@contember/react-datagrid'; +import { RelationFilterArtifacts } from '@contember/react-dataview'; import { SelectCellFilterExtraProps } from '@contember/react-datagrid'; import { Serializable } from '@contember/react-utils'; import { SugarableRelativeSingleField } from '@contember/react-binding'; import { SugaredRelativeEntityList } from '@contember/binding'; import { SugaredRelativeSingleField } from '@contember/react-binding'; import { TextCellRendererProps } from '@contember/react-datagrid'; -import { TextFilterArtifacts } from '@contember/react-datagrid'; +import { TextFilterArtifacts } from '@contember/react-dataview'; // @public export const BooleanCell: FunctionComponent>; // @public -export const ControlledDataGrid: NamedExoticComponent>>>; - -// @public (undocumented) -export const createDataGridContainer: ({ Header, Content, Footer }: { - Header: ComponentType; - Content: ComponentType; - Footer: ComponentType; -}) => NamedExoticComponent; - -// @public (undocumented) -export const createDataGridContent: ({ Table, Grid }: { - Table: ComponentType; - Grid: ComponentType; -}) => ComponentType; +export const ControlledDataGrid: NamedExoticComponent< { +state: DataViewState; +methods: DataViewMethods; +info: DataViewInfo; +columns: DataGridColumns; +} & DataGridLayoutControlPublicProps & DataGridColumnHidingPublicProps & DataGridFullFiltersPublicProps & { +emptyMessage?: ReactNode; +emptyMessageComponent?: ComponentType | undefined; +} & DataGridTableRowPublicProps & DataGridTilesPublicProps>; // @public -export const DataGrid: ComponentType>>>; +export const DataGrid: ComponentType | undefined; +} & DataGridTableRowPublicProps & DataGridTilesPublicProps>>; // @public (undocumented) export interface DataGridCellPublicProps { @@ -138,10 +135,10 @@ export const dataGridCellsDictionary: { }; // @public (undocumented) -export const DataGridColumnHiding: ({ desiredState, displayedState, stateMethods: { setIsColumnHidden }, allowColumnVisibilityControls, }: DataGridColumnHidingProps) => ReactElement | null; +export const DataGridColumnHiding: ({ allowColumnVisibilityControls, }: DataGridColumnHidingProps) => ReactElement | null; // @public (undocumented) -export type DataGridColumnHidingProps = DataGridRenderingCommonProps & DataGridColumnHidingPublicProps; +export type DataGridColumnHidingProps = DataGridColumnHidingPublicProps; // @public (undocumented) export type DataGridColumnHidingPublicProps = { @@ -155,19 +152,22 @@ export type DataGridColumnPublicProps = DataGridCellPublicProps & DataGridHeader export const DataGridContainer: NamedExoticComponent | undefined; -} & DataGridTableRowPublicProps & EntityListBaseProps & DataGridTilesPublicProps & DataGridRenderingCommonProps>; +} & DataGridTableRowPublicProps & DataGridTilesPublicProps>; // @public (undocumented) -export type DataGridContainerProps = typeof DataGridContainer extends ComponentType ? P : never; +export type DataGridContainerProps = DataGridContainerPublicProps; // @public (undocumented) -export type DataGridContainerPublicProps = Omit; +export type DataGridContainerPublicProps = DataGridHeaderPublicProps & DataGridContentPublicProps & DataGridFooterPublicProps; // @public (undocumented) -export const DataGridContent: ComponentType<{ - emptyMessage?: ReactNode; - emptyMessageComponent?: ComponentType | undefined; -} & DataGridTableRowPublicProps & EntityListBaseProps & DataGridTilesPublicProps & DataGridRenderingCommonProps>; +export const DataGridContent: (props: DataGridContentProps) => JSX_2.Element; + +// @public (undocumented) +export type DataGridContentProps = DataGridContentPublicProps; + +// @public (undocumented) +export type DataGridContentPublicProps = DataGridTablePublicProps & DataGridTilesPublicProps; // @public (undocumented) export type DataGridDictionary = typeof dataGridDictionary; @@ -217,19 +217,19 @@ export const dataGridDictionary: { }; // @public (undocumented) -export const DataGridFooter: NamedExoticComponent; +export const DataGridFooter: NamedExoticComponent; // @public (undocumented) -export type DataGridFooterProps = DataGridFooterPublicProps & DataGridRenderingCommonProps; +export type DataGridFooterProps = DataGridFooterPublicProps; // @public (undocumented) export type DataGridFooterPublicProps = {}; // @public (undocumented) -export function DataGridFullFilters({ desiredState, stateMethods, allowAggregateFilterControls, }: DataGridFullFiltersProps): ReactElement | null; +export function DataGridFullFilters({ allowAggregateFilterControls, }: DataGridFullFiltersProps): ReactElement | null; // @public (undocumented) -export type DataGridFullFiltersProps = DataGridRenderingCommonProps & DataGridFullFiltersPublicProps; +export type DataGridFullFiltersProps = DataGridFullFiltersPublicProps; // @public (undocumented) export type DataGridFullFiltersPublicProps = { @@ -246,13 +246,13 @@ export function DataGridHeaderCell(props: DataGridHeaderCellProps): ReactElement export const DataGridHeaderCellFilterDropdown: (props: DataGridHeaderCellFilterDropdownProps) => JSX_2.Element | null; // @public (undocumented) -export type DataGridHeaderCellFilterDropdownProps = DataGridRenderingCommonProps & { +export type DataGridHeaderCellFilterDropdownProps = { columnKey: string; column: DataGridColumnProps; }; // @public (undocumented) -export type DataGridHeaderCellProps = DataGridRenderingCommonProps & { +export type DataGridHeaderCellProps = { columnKey: string; column: DataGridColumnProps; }; @@ -272,16 +272,16 @@ export interface DataGridHeaderCellPublicProps { } // @public (undocumented) -export type DataGridHeaderProps = DataGridRenderingCommonProps & DataGridHeaderPublicProps; +export type DataGridHeaderProps = DataGridHeaderPublicProps; // @public (undocumented) export type DataGridHeaderPublicProps = DataGridLayoutControlPublicProps & DataGridColumnHidingPublicProps & DataGridFullFiltersPublicProps; // @public (undocumented) -export const DataGridLayoutControl: ({ stateMethods: { setLayout }, desiredState: { layout }, tile }: DataGridLayoutControlProps) => JSX_2.Element | null; +export const DataGridLayoutControl: ({ tile }: DataGridLayoutControlProps) => JSX_2.Element | null; // @public (undocumented) -export type DataGridLayoutControlProps = DataGridRenderingCommonProps & DataGridLayoutControlPublicProps; +export type DataGridLayoutControlProps = DataGridLayoutControlPublicProps; // @public (undocumented) export type DataGridLayoutControlPublicProps = { @@ -289,25 +289,16 @@ export type DataGridLayoutControlPublicProps = { }; // @public (undocumented) -export const DataGridPagingSummary: ({ pagingInfo, displayedState: { paging: { pageIndex } } }: DataGridPagingSummaryProps) => JSX_2.Element; - -// @public (undocumented) -export type DataGridPagingSummaryProps = DataGridRenderingCommonProps; - -// @public (undocumented) -export type DataGridRenderingCommonProps = DataGridRendererInnerProps; +export const DataGridPagingSummary: () => JSX_2.Element; // @public (undocumented) export const DataGridTable: NamedExoticComponent; // @public (undocumented) -export type DataGridTableHead = DataGridRenderingCommonProps; - -// @public (undocumented) -export const DataGridTableHead: (props: DataGridTableHead) => JSX_2.Element; +export const DataGridTableHead: () => JSX_2.Element; // @public (undocumented) -export type DataGridTableProps = DataGridRenderingCommonProps & DataGridTablePublicProps & EntityListBaseProps; +export type DataGridTableProps = DataGridTablePublicProps; // @public (undocumented) export type DataGridTablePublicProps = { @@ -316,10 +307,10 @@ export type DataGridTablePublicProps = { } & DataGridTableRowPublicProps; // @public (undocumented) -export const DataGridTableRow: ({ desiredState, displayedState, onEntityClick, isEntitySelected, selectedEntityIds }: DataGridTableRowProps) => JSX_2.Element; +export const DataGridTableRow: ({ onEntityClick, isEntitySelected, selectedEntityIds }: DataGridTableRowProps) => JSX_2.Element; // @public (undocumented) -export type DataGridTableRowProps = DataGridRenderingCommonProps & DataGridTableRowPublicProps; +export type DataGridTableRowProps = DataGridTableRowPublicProps; // @public (undocumented) export type DataGridTableRowPublicProps = { @@ -329,10 +320,10 @@ export type DataGridTableRowPublicProps = { }; // @public (undocumented) -export const DataGridTiles: MemoExoticComponent<({ accessor, tileSize, tile, emptyMessage, emptyMessageComponent }: DataGridTilesProps) => JSX_2.Element>; +export const DataGridTiles: MemoExoticComponent<({ tileSize, tile, emptyMessage, emptyMessageComponent }: DataGridTilesProps) => JSX_2.Element>; // @public (undocumented) -export type DataGridTilesProps = DataGridRenderingCommonProps & DataGridTilesPublicProps; +export type DataGridTilesProps = DataGridTilesPublicProps; // @public (undocumented) export type DataGridTilesPublicProps = { @@ -345,7 +336,7 @@ export type DataGridTilesPublicProps = { // @public export const DateCell: FunctionComponent; @@ -356,7 +347,7 @@ export type DateCellValueRendererProps = DateCellRendererProps & DateFieldViewFo export const EnumCell: FunctionComponent; format?: ((value: string | null) => ReactNode) | undefined; -initialFilter?: EnumCellFilterArtifacts | undefined; +initialFilter?: EnumFilterArtifacts | undefined; } & DataGridCellPublicProps & DataGridHeaderCellPublicProps & FieldFallbackViewProps & { format?: ((value: string | null) => ReactNode) | undefined; } & NullConditionFilterPublicProps & { @@ -364,7 +355,7 @@ options: Record; }>; // @public (undocumented) -export const EnumCellFilter: ({ filter, setFilter, environment, field, options, showNullConditionFilter }: FilterRendererProps) => JSX_2.Element; +export const EnumCellFilter: ({ filter, setFilter, environment, field, options, showNullConditionFilter }: FilterRendererProps) => JSX_2.Element; // @public (undocumented) export type EnumCellFilterExtraProps = NullConditionFilterPublicProps & EnumCellRendererProps & { @@ -402,7 +393,7 @@ export const HasOneSelectCell: FunctionComponent ReactNode) | undefined; @@ -442,12 +433,12 @@ export type NumberCellValueRendererProps = NumberCellRendererProps & FieldFallba export const SelectCellFilter: ({ filter, setFilter, options, allOptions, onSearch, isLoading }: SelectCellFilterProps) => JSX_2.Element; // @public (undocumented) -export type SelectCellFilterProps = FilterRendererProps & SelectCellFilterExtraProps; +export type SelectCellFilterProps = FilterRendererProps & SelectCellFilterExtraProps; // @public export const TextCell: FunctionComponent ReactNode) | undefined; diff --git a/build/api/react-datagrid.api.md b/build/api/react-datagrid.api.md index e1563a7a1c..2869f46e70 100644 --- a/build/api/react-datagrid.api.md +++ b/build/api/react-datagrid.api.md @@ -5,34 +5,38 @@ ```ts import { BaseDynamicChoiceField } from '@contember/react-choice-field'; +import { BooleanFilterArtifacts } from '@contember/react-dataview'; +import { CoalesceTextFilterArtifacts } from '@contember/react-dataview'; import { ComponentType } from 'react'; -import { EntityId } from '@contember/react-binding'; -import { EntityListAccessor } from '@contember/react-binding'; +import { DataViewFilterArtifact } from '@contember/react-dataview'; +import { DataViewFilterHandler } from '@contember/react-dataview'; +import { DataViewInfo } from '@contember/react-dataview'; +import { DataViewMethods } from '@contember/react-dataview'; +import { DataViewSelectionValue } from '@contember/react-dataview'; +import { DataViewSetFilter } from '@contember/react-dataview'; +import { DataViewSortingDirection } from '@contember/react-dataview'; +import { DataViewState } from '@contember/react-dataview'; +import { DateRangeFilterArtifacts } from '@contember/react-dataview'; import { EntityListBaseProps } from '@contember/react-binding'; +import { EnumFilterArtifacts } from '@contember/react-dataview'; import { Environment } from '@contember/react-binding'; -import { Filter } from '@contember/react-binding'; import { FunctionComponent } from 'react'; -import { Input } from '@contember/client'; import { NamedExoticComponent } from 'react'; -import { OrderBy } from '@contember/react-binding'; -import { Provider } from 'react'; -import { QualifiedEntityList } from '@contember/react-binding'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; +import { RelationFilterArtifacts } from '@contember/react-dataview'; import { SelectOptions } from '@contember/react-choice-field'; import { Serializable } from '@contember/react-utils'; import { SugarableRelativeSingleField } from '@contember/react-binding'; -import { SugaredFilter } from '@contember/react-binding'; -import { SugaredOrderBy } from '@contember/react-binding'; import { SugaredQualifiedEntityList } from '@contember/react-binding'; import { SugaredRelativeEntityList } from '@contember/react-binding'; import { SugaredRelativeSingleEntity } from '@contember/react-binding'; -import { TreeRootId } from '@contember/react-binding'; +import { TextFilterArtifacts } from '@contember/react-dataview'; // @public (undocumented) export type BooleanCellProps = DataGridColumnCommonProps & BooleanCellRendererProps & { disableOrder?: boolean; - initialOrder?: DataGridOrderDirection; + initialOrder?: DataViewSortingDirection; initialFilter?: BooleanFilterArtifacts; }; @@ -41,13 +45,6 @@ export type BooleanCellRendererProps = { field: SugarableRelativeSingleField | string; }; -// @public (undocumented) -export type BooleanFilterArtifacts = { - includeTrue: boolean; - includeFalse: boolean; - includeNull: boolean; -}; - // @public (undocumented) export type CoalesceCellRendererProps = { fields: (SugarableRelativeSingleField | string)[]; @@ -60,24 +57,20 @@ export type CoalesceTextCellProps = DataGridColumnCommonProps & CoalesceCellRend }; // @public (undocumented) -export type CoalesceTextFilterArtifacts = { - mode: 'matches' | 'matchesExactly' | 'startsWith' | 'endsWith' | 'doesNotMatch'; - query: string; +export type ControlledDataGridProps = { + state: DataGridState; + methods: DataGridMethods; + info: DataViewInfo; + columns: DataGridColumns; }; -// @public (undocumented) -export type ControlledDataGridProps

= { - state: DataGridState; - stateMethods: DataGridStateMethods; -} & P; - // @public (undocumented) export const createBooleanCell: ({ FilterRenderer, ValueRenderer }: { FilterRenderer: ComponentType>; ValueRenderer: ComponentType; }) => FunctionComponent; @@ -90,22 +83,42 @@ export const createCoalesceTextCell: ; // @public (undocumented) -export const createControlledDataGrid:

(Renderer: ComponentType

>) => NamedExoticComponent>>>; +export const createControlledDataGrid:

(Renderer: ComponentType

; +}>) => NamedExoticComponent< { +state: DataGridState; +methods: DataGridMethods; +info: DataViewInfo; +columns: DataGridColumns; +} & P>; // @public (undocumented) -export const createDataGrid:

(Renderer: ComponentType & P>) => ComponentType>>>; +export const createDataGrid:

(Renderer: ComponentType

; +}>) => ComponentType>; // @public (undocumented) export const createDataGridRenderer: ({ Fallback, Container, staticRender, columnStaticRender }: { Fallback: ComponentType<{ - children: ReactNode; + children?: ReactNode; }>; - Container: ComponentType & ContainerProps>; - staticRender?: ((props: DataGridRendererInnerProps & ContainerProps) => ReactNode) | undefined; + Container: ComponentType; + staticRender?: ((props: ContainerProps) => ReactNode) | undefined; columnStaticRender?: ((props: { column: DataGridColumnProps; }) => ReactNode) | undefined; -}) => NamedExoticComponent & ContainerProps>; +}) => NamedExoticComponent; +}>; // @public (undocumented) export const createDateCell: ({ FilterRenderer, ValueRenderer }: { @@ -113,26 +126,23 @@ export const createDateCell: ; }) => FunctionComponent; // @public (undocumented) export const createEnumCell: ({ FilterRenderer, ValueRenderer }: { - FilterRenderer: ComponentType>; + FilterRenderer: ComponentType>; ValueRenderer: ComponentType; }) => FunctionComponent; format?: ((value: string | null) => ReactNode) | undefined; - initialFilter?: EnumCellFilterArtifacts | undefined; + initialFilter?: EnumFilterArtifacts | undefined; } & ColumnProps & ValueRendererProps & FilterProps>; // @public (undocumented) export const createGenericCell: () => FunctionComponent; -// @public (undocumented) -export const createGenericTextCellFilterCondition: (filter: GenericTextCellFilterArtifacts) => Input.Condition; - // @public (undocumented) export const createHasManyAbsentCell: ({ FilterRenderer }: { FilterRenderer: ComponentType>; @@ -143,7 +153,7 @@ export const createHasManyAbsentCell: ({ FilterRenderer // @public (undocumented) export const createHasManySelectCell: ({ FilterRenderer, ValueRenderer }: { - FilterRenderer: ComponentType>; + FilterRenderer: ComponentType>; ValueRenderer: ComponentType; }) => FunctionComponent; @@ -157,7 +167,7 @@ renderElements?: ((elements: ReactNode[]) => ReactElement) | undefined; // @public (undocumented) export const createHasOneSelectCell: ({ FilterRenderer, ValueRenderer }: { - FilterRenderer: ComponentType>; + FilterRenderer: ComponentType>; ValueRenderer: ComponentType; }) => FunctionComponent; @@ -172,7 +182,7 @@ export const createNumberCell: ; }) => FunctionComponent; @@ -182,7 +192,7 @@ export const createTextCell: ; }) => FunctionComponent; @@ -196,12 +206,12 @@ export type DataGridColumnCommonProps = { }; // @public (undocumented) -export type DataGridColumnFiltering = { +export type DataGridColumnFiltering = { enableFiltering: false; } | { enableFiltering?: true; initialFilter?: FA; - getNewFilter: GetNewFilter; + getNewFilter: DataViewFilterHandler; emptyFilter: FA; filterRenderer: ComponentType>; }; @@ -214,36 +224,41 @@ export type DataGridColumnOrdering = { enableOrdering: false; } | { enableOrdering?: true; - initialOrder?: DataGridOrderDirection; - getNewOrderBy: GetNewOrderBy; + initialOrder?: DataViewSortingDirection; }; // @public (undocumented) -export type DataGridColumnProps = DataGridColumnCommonProps & DataGridColumnFiltering & DataGridColumnOrdering & P; +export type DataGridColumnProps = DataGridColumnCommonProps & DataGridColumnFiltering & DataGridColumnOrdering & P; // @public (undocumented) -export type DataGridColumns

= Map>; +export type DataGridColumns

= Map>; // @public (undocumented) -export type DataGridFilterArtifact = Serializable; +export type DataGridFilterArtifact = DataViewFilterArtifact; // @public (undocumented) -export type DataGridFilterArtifactStore = Record; +export type DataGridHidingMethods = { + setIsColumnHidden: DataGridSetIsColumnHidden; +}; // @public (undocumented) -export type DataGridHiddenColumnsStateStore = Record; +export type DataGridHidingState = Record; // @public (undocumented) -export const DataGridKeyProvider: Provider; +export type DataGridLayout = 'default' | 'tiles'; // @public (undocumented) -export type DataGridLayout = 'default' | 'tiles'; +export type DataGridLayoutMethods = { + setView: SetDataGridLayout; +}; // @public (undocumented) -export type DataGridOrderDirection = 'asc' | 'desc' | null; +export type DataGridLayoutState = { + view: DataGridLayout; +}; // @public (undocumented) -export type DataGridOrderDirectionStore = Record>; +export type DataGridMethods = DataViewMethods; // @public (undocumented) export type DataGridProps

= { @@ -253,84 +268,16 @@ export type DataGridProps

= { itemsPerPage?: number | null; } & P; -// @public (undocumented) -export type DataGridRendererInnerProps = { - desiredState: DataGridState; - displayedState: DataGridState; - stateMethods: DataGridStateMethods; - pagingInfo: GridPagingInfo; - environment: Environment; - accessor: EntityListAccessor; - children?: ReactNode; -}; - -// @public (undocumented) -export interface DataGridRendererProps { - // (undocumented) - desiredState: DataGridState; - // (undocumented) - displayedState: DataGridState | undefined; - // (undocumented) - environment: Environment; - // (undocumented) - pagingInfo: GridPagingInfo; - // (undocumented) - stateMethods: DataGridStateMethods; - // (undocumented) - treeRootId: TreeRootId | undefined; -} - -// @public (undocumented) -export type DataGridSetColumnFilter = (columnKey: DataGridColumnKey, columnFilter: FA | undefined) => void; - -// @public (undocumented) -export type DataGridSetColumnOrderBy = (columnKey: DataGridColumnKey, columnOrderBy: DataGridOrderDirection | 'next', append?: boolean) => void; - -// @public (undocumented) -export type DataGridSetFilter = (filter: FA | undefined) => void; - // @public (undocumented) export type DataGridSetIsColumnHidden = (columnKey: DataGridColumnKey, isHidden: boolean) => void; // @public (undocumented) -export type DataGridSetOrderBy = (setOrderBy: DataGridOrderDirection | 'next', append?: boolean) => void; - -// @public (undocumented) -export interface DataGridState { - columns: DataGridColumns; - entities: QualifiedEntityList; - // (undocumented) - filter: Filter; - // (undocumented) - filterArtifacts: DataGridFilterArtifactStore; - // (undocumented) - hiddenColumns: DataGridHiddenColumnsStateStore; - // (undocumented) - layout: DataGridLayout; - orderBy: OrderBy; - // (undocumented) - orderDirections: DataGridOrderDirectionStore; - paging: GridPagingState; -} - -// @public (undocumented) -export interface DataGridStateMethods { - // (undocumented) - setFilter: DataGridSetColumnFilter; - // (undocumented) - setIsColumnHidden: DataGridSetIsColumnHidden; - // (undocumented) - setLayout: SetDataGridView; - // (undocumented) - setOrderBy: DataGridSetColumnOrderBy; - // (undocumented) - updatePaging: DispatchChangePage; -} +export type DataGridState = DataViewState; // @public (undocumented) export type DateCellProps = DateCellRendererProps & DataGridColumnCommonProps & { disableOrder?: boolean; - initialOrder?: DataGridOrderDirection; + initialOrder?: DataViewSortingDirection; initialFilter?: DateRangeFilterArtifacts; }; @@ -339,26 +286,11 @@ export type DateCellRendererProps = { field: SugarableRelativeSingleField | string; }; -// @public (undocumented) -export type DateRangeFilterArtifacts = { - start: string | null; - end: string | null; -}; - -// @public (undocumented) -export type DispatchChangePage = (action: GridPagingAction) => void; - -// @public (undocumented) -export type EnumCellFilterArtifacts = { - values: string[]; - nullCondition: boolean; -}; - // @public (undocumented) export type EnumCellProps = DataGridColumnCommonProps & EnumCellRendererProps & { options: Record; format?: (value: string | null) => ReactNode; - initialFilter?: EnumCellFilterArtifacts; + initialFilter?: EnumFilterArtifacts; }; // @public (undocumented) @@ -367,62 +299,15 @@ export type EnumCellRendererProps = { }; // @public (undocumented) -export type FilterRendererProps = { +export type FilterRendererProps = { filter: FA; - setFilter: DataGridSetFilter; + setFilter: DataViewSetFilter; environment: Environment; } & FilterProps; // @public (undocumented) export type GenericCellProps = DataGridColumnCommonProps; -// @public (undocumented) -export type GenericTextCellFilterArtifacts = { - mode: 'matches' | 'matchesExactly' | 'startsWith' | 'endsWith' | 'doesNotMatch'; - query: string; -}; - -// @public (undocumented) -export type GetNewFilter = (filterArtifact: FA, options: GetNewFilterOptions) => SugaredFilter | undefined; - -// @public (undocumented) -export interface GetNewFilterOptions { - // (undocumented) - environment: Environment; -} - -// @public (undocumented) -export type GetNewOrderBy = (newDirection: DataGridOrderDirection, options: GetNewOrderByOptions) => SugaredOrderBy | undefined; - -// @public (undocumented) -export interface GetNewOrderByOptions { - // (undocumented) - environment: Environment; -} - -// @public (undocumented) -export type GridPagingAction = { - type: 'goToPage'; - newPageIndex: number; -} | { - type: 'setItemsPerPage'; - newItemsPerPage: number | null; -} | { - type: 'goToNextPage' | 'goToPreviousPage' | 'goToFirstPage'; -}; - -// @public (undocumented) -export type GridPagingInfo = { - totalCount: number | undefined; - pagesCount: number | undefined; -}; - -// @public (undocumented) -export type GridPagingState = { - pageIndex: number; - itemsPerPage: number | null; -}; - // @public (undocumented) export type HasManyAbsentCellProps = DataGridColumnCommonProps & SugaredRelativeEntityList & { render: ComponentType; @@ -437,7 +322,7 @@ export type HasManySelectProps = HasManySelectRendererProps & DataGridColumnComm // @public (undocumented) export type HasManySelectRendererProps = SugaredRelativeEntityList & BaseDynamicChoiceField & { - initialFilter?: SelectCellArtifacts; + initialFilter?: RelationFilterArtifacts; }; // @public (undocumented) @@ -445,13 +330,13 @@ export type HasOneSelectProps = HasOneSelectRendererProps & DataGridColumnCommon // @public (undocumented) export type HasOneSelectRendererProps = BaseDynamicChoiceField & SugaredRelativeSingleEntity & { - initialFilter?: SelectCellArtifacts; + initialFilter?: RelationFilterArtifacts; }; // @public (undocumented) export type NumberCellProps = DataGridColumnCommonProps & NumberCellRendererProps & { disableOrder?: boolean; - initialOrder?: DataGridOrderDirection; + initialOrder?: DataViewSortingDirection; initialFilter?: NumberFilterArtifacts; }; @@ -467,22 +352,16 @@ export type NumberFilterArtifacts = { nullCondition: boolean; }; -// @public (undocumented) -export type SelectCellArtifacts = { - id: EntityId[]; - nullCondition: boolean; -}; - // @public (undocumented) export type SelectCellFilterExtraProps = SelectOptions; // @public (undocumented) -export type SetDataGridView = (layout: DataGridLayout) => void; +export type SetDataGridLayout = (layout: DataGridLayout) => void; // @public (undocumented) export type TextCellProps = TextCellRendererProps & DataGridColumnCommonProps & { disableOrder?: boolean; - initialOrder?: DataGridOrderDirection; + initialOrder?: DataViewSortingDirection; initialFilter?: TextFilterArtifacts; }; @@ -492,14 +371,24 @@ export type TextCellRendererProps = { }; // @public (undocumented) -export type TextFilterArtifacts = { - mode: 'matches' | 'matchesExactly' | 'startsWith' | 'endsWith' | 'doesNotMatch'; - query: string; - nullCondition: boolean; +export const useDataGrid:

(props: DataGridProps

) => ControlledDataGridProps; + +// @public (undocumented) +export const useDataGridColumns: () => DataGridColumns; + +// @public (undocumented) +export const useDataGridHiddenColumns: () => { + [k: string]: DataViewSelectionValue; }; // @public (undocumented) -export const useDataGrid:

(props: DataGridProps

) => ControlledDataGridProps

; +export const useDataGridLayout: () => string | number | boolean; + +// @public (undocumented) +export const useDataGridSetColumnHidden: () => (column: string, hidden: boolean) => void; + +// @public (undocumented) +export const useDataGridSetLayout: () => (layout: 'default' | 'tiles') => void; // (No @packageDocumentation comment for this package) diff --git a/build/api/react-dataview.api.md b/build/api/react-dataview.api.md new file mode 100644 index 0000000000..0a9b8f90dc --- /dev/null +++ b/build/api/react-dataview.api.md @@ -0,0 +1,856 @@ +## API Report File for "@contember/react-dataview" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { ChangeEvent } from 'react'; +import { EntityAccessor } from '@contember/react-binding'; +import { EntityAccessor as EntityAccessor_2 } from '@contember/binding'; +import { EntityId } from '@contember/react-binding'; +import { EntityId as EntityId_2 } from '@contember/binding'; +import { EntityListAccessor } from '@contember/binding'; +import { EntityListSubTreeLoaderState } from '@contember/react-binding'; +import { Environment } from '@contember/react-binding'; +import { Environment as Environment_2 } from '@contember/binding'; +import { Filter } from '@contember/binding'; +import { ForwardRefExoticComponent } from 'react'; +import { Input } from '@contember/client'; +import { JSX as JSX_2 } from 'react/jsx-runtime'; +import { JSXElementConstructor } from 'react'; +import { NamedExoticComponent } from 'react'; +import { OrderBy } from '@contember/react-binding'; +import { Provider } from 'react'; +import { QualifiedEntityList } from '@contember/binding'; +import * as React_2 from 'react'; +import { ReactElement } from 'react'; +import { ReactNode } from 'react'; +import { RefAttributes } from 'react'; +import { Serializable } from '@contember/react-utils'; +import { SetStateAction } from 'react'; +import { SugaredOrderBy } from '@contember/binding'; +import { SugaredQualifiedEntityList } from '@contember/binding'; +import { SugaredRelativeEntityList } from '@contember/binding'; +import { SugaredRelativeSingleEntity } from '@contember/binding'; +import { SugaredRelativeSingleField } from '@contember/binding'; +import { UseEntityListSubTreeLoaderResult } from '@contember/react-binding'; + +// @public (undocumented) +export type BooleanFilterArtifacts = { + includeTrue?: boolean; + includeFalse?: boolean; + nullCondition?: boolean; +}; + +// @public (undocumented) +export type CoalesceTextFilterArtifacts = { + mode?: 'matches' | 'matchesExactly' | 'startsWith' | 'endsWith' | 'doesNotMatch'; + query?: string; +}; + +// @public (undocumented) +export const ControlledDataView: NamedExoticComponent< { +children: ReactNode; +state: DataViewState; +info: DataViewInfo; +methods: DataViewMethods; +onSelectHighlighted?: ((entity: EntityAccessor) => void) | undefined; +}>; + +// @public (undocumented) +export type ControlledDataViewProps = { + children: ReactNode; + state: DataViewState; + info: DataViewInfo; + methods: DataViewMethods; + onSelectHighlighted?: (entity: EntityAccessor) => void; +}; + +// @public (undocumented) +export const createBooleanFilter: (field: SugaredRelativeSingleField['field']) => DataViewFilterHandler; + +// @public (undocumented) +export const createCoalesceFilter: (fields: SugaredRelativeSingleField['field'][]) => DataViewFilterHandler; + +// @public (undocumented) +export const createDateFilter: (field: SugaredRelativeSingleField['field']) => DataViewFilterHandler; + +// @public (undocumented) +export const createEnumFilter: (field: SugaredRelativeSingleField['field']) => DataViewFilterHandler; + +// @public (undocumented) +export const createGenericTextCellFilterCondition: (filter: GenericTextCellFilterArtifacts) => Input.Condition; + +// @public (undocumented) +export const createHasManyFilter: (field: SugaredRelativeEntityList['field']) => DataViewFilterHandler; + +// @public (undocumented) +export const createHasOneFilter: (field: SugaredRelativeSingleEntity['field']) => DataViewFilterHandler; + +// @public (undocumented) +export const createNumberFilter: (field: SugaredRelativeSingleField['field']) => DataViewFilterHandler; + +// @public (undocumented) +export const createNumberRangeFilter: (field: SugaredRelativeSingleField['field']) => DataViewFilterHandler; + +// @public (undocumented) +export const createTextFilter: (field: SugaredRelativeSingleField['field']) => DataViewFilterHandler; + +// @public (undocumented) +const DataView_2: NamedExoticComponent; +export { DataView_2 as DataView } + +// @public (undocumented) +export type DataViewBooleanFilterCurrent = 'include' | 'none'; + +// @public (undocumented) +export const DataViewBooleanFilterTrigger: ({ name, action, value, ...props }: { + name: string; + value: boolean; + children: ReactNode; + action?: DataViewSetBooleanFilterAction | undefined; +}) => JSX_2.Element; + +// @public (undocumented) +export const DataViewChangePageTrigger: ForwardRefExoticComponent>; + +// @public (undocumented) +export interface DataViewChangePageTriggerProps { + // (undocumented) + children: React.ReactNode; + // (undocumented) + page: number | 'first' | 'last' | 'next' | 'previous'; +} + +// @internal (undocumented) +export const DataViewCurrentKeyContext: React_2.Context; + +// @public (undocumented) +export const DataViewDateFilterInput: ({ name, type, ...props }: { + name: string; + type: 'start' | 'end'; + children: ReactElement; +}) => JSX_2.Element; + +// @public (undocumented) +export const DataViewDateFilterResetTrigger: ({ name, ...props }: DataViewDateFilterResetTriggerProps) => JSX_2.Element | null; + +// @public (undocumented) +export type DataViewDateFilterResetTriggerProps = { + name: string; + children: ReactElement; +}; + +// @internal (undocumented) +export const DataViewDisplayedStateContext: React_2.Context; + +// @public (undocumented) +export const DataViewEachRow: ({ children }: { + children: ReactNode; +}) => JSX_2.Element[] | null; + +// @public (undocumented) +export interface DataViewEachRowProps { + // (undocumented) + children: ReactNode; + // (undocumented) + initial?: boolean; + // (undocumented) + loaded?: boolean; + // (undocumented) + refreshing?: boolean; +} + +// @public (undocumented) +export const DataViewEmpty: ({ children }: { + children: ReactNode; +}) => ReactNode; + +// @internal (undocumented) +export const DataViewEntityListAccessorContext: React_2.Context; + +// @internal (undocumented) +export const DataViewEntityListPropsContext: React_2.Context; + +// @public (undocumented) +export type DataViewEnumFilterCurrent = 'include' | 'exclude' | 'none'; + +// @public (undocumented) +export const DataViewEnumFilterState: ({ name, children, state, value }: { + name: string; + value: string; + children: ReactNode; + state?: DataViewEnumFilterCurrent | DataViewEnumFilterCurrent[] | undefined; +}) => string | number | boolean | Iterable | JSX_2.Element | null | undefined; + +// @public (undocumented) +export const DataViewEnumFilterTrigger: ({ name, action, value, ...props }: { + name: string; + value: string; + children: ReactNode; + action?: DataViewSetEnumFilterAction | undefined; +}) => JSX_2.Element; + +// @public (undocumented) +export type DataViewFilterArtifact = Serializable; + +// @public (undocumented) +export type DataViewFilterHandler = (filterArtifact: FA, options: DataViewFilterHandlerOptions) => Filter | undefined; + +// @public (undocumented) +export interface DataViewFilterHandlerOptions { + // (undocumented) + environment: Environment; +} + +// @public (undocumented) +export type DataViewFilterHandlerRegistry = Record>; + +// @internal (undocumented) +export const DataViewFilterHandlerRegistryContext: React_2.Context; + +// @public (undocumented) +export type DataViewFilteringArtifacts = Record; + +// @public (undocumented) +export type DataViewFilteringMethods = { + setFilter: (key: string, filter: SetStateAction) => void; +}; + +// @internal (undocumented) +export const DataViewFilteringMethodsContext: React_2.Context; + +// @public (undocumented) +export type DataViewFilteringProps = { + filterTypes?: DataViewFilterHandlerRegistry; + initialFilters?: DataViewFilteringArtifacts | ((stored: DataViewFilteringArtifacts) => DataViewFilteringArtifacts); +}; + +// @public (undocumented) +export type DataViewFilteringState = { + artifact: DataViewFilteringArtifacts; + filter: Filter; + filterTypes: DataViewFilterHandlerRegistry; +}; + +// @internal (undocumented) +export const DataViewFilteringStateContext: React_2.Context; + +// @internal (undocumented) +export const DataViewGlobalKeyContext: React_2.Context; + +// @public (undocumented) +export const DataViewHasSelection: NamedExoticComponent; + +// @public (undocumented) +export interface DataViewHasSelectionProps { + // (undocumented) + children: React.ReactNode; + // (undocumented) + fallback?: DataViewSelectionValue; + // (undocumented) + name: string; + // (undocumented) + value?: DataViewSelectionValue; +} + +// @public (undocumented) +export interface DataViewHighlightEvent { + // (undocumented) + element: HTMLElement; + // (undocumented) + entity: EntityAccessor; +} + +// @internal (undocumented) +export const DataViewHighlightIndexContext: React_2.Context; + +// @public (undocumented) +export const DataViewHighlightRow: React_2.ForwardRefExoticComponent>; + +// @public (undocumented) +export interface DataViewHighlightRowProps { + // (undocumented) + children: ReactNode; + // (undocumented) + onHighlight?: (event: DataViewHighlightEvent) => void; +} + +// @public (undocumented) +export type DataViewInfo = { + paging: DataViewPagingInfo; +}; + +// @public (undocumented) +export const DataViewKeyboardEventHandler: React_2.ForwardRefExoticComponent<{ + children: ReactNode; +} & React_2.RefAttributes>; + +// @internal (undocumented) +export const DataViewKeyboardEventHandlerContext: React_2.Context>; + +// @public (undocumented) +export const DataViewKeyProvider: Provider; + +// @public (undocumented) +export const DataViewLoaderState: ({ children, ...props }: DataViewEachRowProps) => ReactNode; + +// @internal (undocumented) +export const DataViewLoaderStateContext: React_2.Context; + +// @public (undocumented) +export type DataViewMethods = { + paging: DataViewPagingMethods; + sorting: DataViewSortingMethods; + filtering: DataViewFilteringMethods; + selection: DataViewSelectionMethods; +}; + +// @public (undocumented) +export const DataViewNonEmpty: ({ children }: { + children: ReactNode; +}) => ReactNode; + +// @public (undocumented) +export type DataViewNullFilterState = 'include' | 'exclude' | 'none'; + +// @public (undocumented) +export const DataViewNullFilterTrigger: ({ name, action, ...props }: { + name: string; + children: ReactNode; + action: DataViewSetNullFilterAction; +}) => JSX_2.Element; + +// @public (undocumented) +export const DataViewNumberFilterInput: ({ name, type, allowFloat, ...props }: { + name: string; + type: 'from' | 'to'; + allowFloat?: boolean | undefined; + children: ReactElement; +}) => JSX_2.Element; + +// @public (undocumented) +export const DataViewNumberFilterResetTrigger: ({ name, ...props }: DataViewNumberFilterResetTriggerProps) => JSX_2.Element | null; + +// @public (undocumented) +export type DataViewNumberFilterResetTriggerProps = { + name: string; + children: ReactElement; +}; + +// @public (undocumented) +export type DataViewPagingInfo = { + totalCount: number | undefined; + pagesCount: number | undefined; +}; + +// @internal (undocumented) +export const DataViewPagingInfoContext: React_2.Context; + +// @public (undocumented) +export type DataViewPagingMethods = { + goToPage: (page: number | 'first' | 'next' | 'previous' | 'last') => void; + setItemsPerPage: (newItemsPerPage: number | null) => void; +}; + +// @internal (undocumented) +export const DataViewPagingMethodsContext: React_2.Context; + +// @public (undocumented) +export interface DataViewPagingProps { + // (undocumented) + initialItemsPerPage?: number | null; +} + +// @public (undocumented) +export type DataViewPagingState = { + pageIndex: number; + itemsPerPage: number | null; +}; + +// @internal (undocumented) +export const DataViewPagingStateContext: React_2.Context; + +// @public (undocumented) +export const DataViewPagingStateView: ({ render }: DataViewPagingStateViewProps) => ReactNode; + +// @public (undocumented) +export interface DataViewPagingStateViewProps { + // (undocumented) + render: (props: DataViewPagingState & DataViewPagingInfo) => ReactNode; +} + +// @public (undocumented) +export type DataViewProps = { + children: ReactNode; + onSelectHighlighted?: (entity: EntityAccessor_2) => void; +} & UseDataViewArgs; + +// @public (undocumented) +export type DataViewRelationFilterCurrent = 'include' | 'exclude' | 'none'; + +// @public (undocumented) +export const DataViewRelationFilterList: React_2.NamedExoticComponent; + +// @public (undocumented) +export type DataViewRelationFilterListProps = { + name: string; + options: SugaredQualifiedEntityList['entities']; + children: ReactNode; +}; + +// @public (undocumented) +export const DataViewRelationFilterState: ({ name, children, state }: { + name: string; + children: ReactNode; + state?: DataViewRelationFilterCurrent | DataViewRelationFilterCurrent[] | undefined; +}) => string | number | boolean | Iterable | JSX_2.Element | null | undefined; + +// @public (undocumented) +export const DataViewRelationFilterTrigger: ({ name, action, ...props }: { + name: string; + children: ReactNode; + action?: DataViewSetRelationFilterAction | undefined; +}) => JSX_2.Element; + +// @public (undocumented) +export const dataViewSelectionEnvironmentExtension: Environment.Extension; + +// @public (undocumented) +export type DataViewSelectionMethods = { + setSelection: (key: string, value: SetStateAction) => void; +}; + +// @internal (undocumented) +export const DataViewSelectionMethodsContext: React_2.Context; + +// @public (undocumented) +export type DataViewSelectionProps = { + initialSelection?: DataViewSelectionValues | ((stored: DataViewSelectionValues) => DataViewSelectionValues); + selectionFallback?: DataViewSelectionValue; +}; + +// @public (undocumented) +export type DataViewSelectionState = { + values: DataViewSelectionValues; + fallback?: DataViewSelectionValue; +}; + +// @internal (undocumented) +export const DataViewSelectionStateContext: React_2.Context; + +// @public (undocumented) +export const DataViewSelectionTrigger: ({ name, value, fallback, ...props }: DataViewSelectionTriggerProps) => JSX_2.Element; + +// @public (undocumented) +export interface DataViewSelectionTriggerProps { + // (undocumented) + children: ReactElement; + // (undocumented) + fallback?: DataViewSelectionValue; + // (undocumented) + name: string; + // (undocumented) + value: DataViewSelectionValue | undefined | ((current: DataViewSelectionValue | undefined) => DataViewSelectionValue); +} + +// @public (undocumented) +export type DataViewSelectionValue = boolean | string | number | null; + +// @public (undocumented) +export type DataViewSelectionValues = { + [key: string]: DataViewSelectionValue; +}; + +// @public (undocumented) +export type DataViewSetBooleanFilterAction = 'include' | 'unset' | 'toggle'; + +// @public (undocumented) +export type DataViewSetColumnFilter = (key: string, columnFilter: FA | undefined) => void; + +// @public (undocumented) +export type DataViewSetColumnSorting = (key: string, columnOrderBy: DataViewSortingDirectionAction, append?: boolean) => void; + +// @public (undocumented) +export type DataViewSetEnumFilterAction = 'include' | 'exclude' | 'unset' | 'toggleInclude' | 'toggleExclude'; + +// @public (undocumented) +export type DataViewSetFilter = (filter: FA | undefined) => void; + +// @public (undocumented) +export const DataViewSetItemsPerPageTrigger: ForwardRefExoticComponent>; + +// @public (undocumented) +export interface DataViewSetItemsPerPageTriggerProps { + // (undocumented) + children: ReactNode; + // (undocumented) + value: number; +} + +// @public (undocumented) +export type DataViewSetNullFilterAction = 'include' | 'exclude' | 'unset' | 'toggleInclude' | 'toggleExclude'; + +// @public (undocumented) +export type DataViewSetRelationFilterAction = 'include' | 'exclude' | 'unset' | 'toggleInclude' | 'toggleExclude'; + +// @public (undocumented) +export type DataViewSetSorting = (setOrderBy: DataViewSortingDirectionAction, append?: boolean) => void; + +// @public (undocumented) +export type DataViewSortingDirection = 'asc' | 'desc' | null; + +// @public (undocumented) +export type DataViewSortingDirectionAction = DataViewSortingDirection | 'next' | 'toggleAsc' | 'toggleDesc' | 'clear'; + +// @public (undocumented) +export type DataViewSortingDirections = Record>; + +// @public (undocumented) +export type DataViewSortingHandler = {}; + +// @public (undocumented) +export type DataViewSortingHandlerRegistry = Record; + +// @public (undocumented) +export type DataViewSortingMethods = { + setOrderBy: DataViewSetColumnSorting; +}; + +// @internal (undocumented) +export const DataViewSortingMethodsContext: React_2.Context; + +// @public (undocumented) +export type DataViewSortingProps = { + initialSorting?: DataViewSortingDirections; +}; + +// @public (undocumented) +export type DataViewSortingState = { + directions: DataViewSortingDirections; + orderBy: OrderBy; +}; + +// @internal (undocumented) +export const DataViewSortingStateContext: React_2.Context; + +// @public (undocumented) +export const DataViewSortingSwitch: ({ field, ...props }: DataViewSortingSwitchProps) => string | number | boolean | ReactElement> | Iterable | null; + +// @public (undocumented) +export interface DataViewSortingSwitchProps { + // (undocumented) + asc?: ReactNode; + // (undocumented) + desc?: ReactNode; + // (undocumented) + field: string; + // (undocumented) + none?: ReactNode; +} + +// @public (undocumented) +export const DataViewSortingTrigger: ({ action, field, ...props }: DataViewSortingTriggerProps) => JSX_2.Element; + +// @public (undocumented) +export interface DataViewSortingTriggerProps { + // (undocumented) + action?: DataViewSortingDirectionAction; + // (undocumented) + children: React.ReactNode; + // (undocumented) + field: string; + // (undocumented) + toggle?: boolean; +} + +// @public (undocumented) +export type DataViewState = { + entities: QualifiedEntityList; + key: string; + paging: DataViewPagingState; + sorting: DataViewSortingState; + filtering: DataViewFilteringState; + selection: DataViewSelectionState; +}; + +// @public (undocumented) +export const DataViewTextFilterInput: ({ name, ...props }: { + name: string; + children: ReactElement; +}) => JSX_2.Element; + +// @public (undocumented) +export const DataViewTextFilterMatchModeLabel: ({ name, render }: DataViewTextFilterMatchModeLabelProps) => ReactNode; + +// @public (undocumented) +export type DataViewTextFilterMatchModeLabelProps = { + name: string; + render: ((mode: TextFilterArtifactsMatchMode) => ReactNode) | Record; +}; + +// @public (undocumented) +export const DataViewTextFilterMatchModeTrigger: ({ name, children, mode }: DataViewTextFilterMatchModeTriggerProps) => JSX_2.Element; + +// @public (undocumented) +export type DataViewTextFilterMatchModeTriggerProps = { + name: string; + children: ReactElement; + mode: TextFilterArtifactsMatchMode; +}; + +// @public (undocumented) +export const DataViewTextFilterResetTrigger: ({ name, ...props }: DataViewTextFilterResetTriggerProps) => JSX_2.Element | null; + +// @public (undocumented) +export type DataViewTextFilterResetTriggerProps = { + name: string; + children: ReactElement; +}; + +// @public (undocumented) +export type DateRangeFilterArtifacts = { + start?: string; + end?: string; + nullCondition?: boolean; +}; + +// @public (undocumented) +export type EnumFilterArtifacts = { + values?: string[]; + notValues?: string[]; + nullCondition?: boolean; +}; + +// @public (undocumented) +export type GenericTextCellFilterArtifacts = { + mode?: 'matches' | 'matchesExactly' | 'startsWith' | 'endsWith' | 'doesNotMatch'; + query?: string; +}; + +// @public (undocumented) +export type GetNewOrderBy = (newDirection: DataViewSortingDirection, options: GetNewOrderByOptions) => SugaredOrderBy | undefined; + +// @public (undocumented) +export interface GetNewOrderByOptions { + // (undocumented) + environment: Environment_2; +} + +// @public (undocumented) +export type NumberFilterArtifacts = { + mode: 'eq' | 'gte' | 'lte'; + query: number | null; + nullCondition: boolean; +}; + +// @public (undocumented) +export type NumberRangeFilterArtifacts = { + from?: number; + to?: number; + nullCondition?: boolean; +}; + +// @public (undocumented) +export type RelationFilterArtifacts = { + id?: EntityId[]; + notId?: EntityId[]; + nullCondition?: boolean; +}; + +// @public (undocumented) +export const resolveCondition: (state: DataViewSelectionState, props: DataViewHasSelectionProps) => boolean; + +// @public (undocumented) +export type TextFilterArtifacts = { + mode?: TextFilterArtifactsMatchMode; + query?: string; + nullCondition?: boolean; +}; + +// @public (undocumented) +export type TextFilterArtifactsMatchMode = 'matches' | 'matchesExactly' | 'startsWith' | 'endsWith' | 'doesNotMatch'; + +// @public (undocumented) +export const useDataView: (args: UseDataViewArgs) => UseDataViewResult; + +// @public (undocumented) +export type UseDataViewArgs = { + dataViewKey?: string; + entities: SugaredQualifiedEntityList['entities']; +} & DataViewFilteringProps & DataViewSortingProps & DataViewPagingProps & DataViewSelectionProps; + +// @public (undocumented) +export type UseDataViewBooleanFilter = [ +current: DataViewBooleanFilterCurrent, +set: (value: DataViewSetBooleanFilterAction) => void +]; + +// @public (undocumented) +export const useDataViewBooleanFilter: (name: string, value: boolean) => UseDataViewBooleanFilter; + +// @public (undocumented) +export const useDataViewBooleanFilterFactory: (name: string) => (value: boolean) => UseDataViewBooleanFilter; + +// @public (undocumented) +export const useDataViewCurrentKey: () => string; + +// @public (undocumented) +export const useDataViewDateFilterInput: ({ name, type }: UseDataViewDateFilterInputProps) => UseDataViewDateFilterInputResult; + +// @public (undocumented) +export type UseDataViewDateFilterInputProps = { + name: string; + type: 'start' | 'end'; +}; + +// @public (undocumented) +export interface UseDataViewDateFilterInputResult { + // (undocumented) + onChange: (e: ChangeEvent) => void; + // (undocumented) + value: string; +} + +// @public (undocumented) +export const useDataViewDisplayedState: () => T; + +// @public (undocumented) +export const useDataViewEntityListAccessor: () => EntityListAccessor | undefined; + +// @public (undocumented) +export const useDataViewEntityListProps: () => QualifiedEntityList; + +// @public (undocumented) +export type UseDataViewEnumFilter = [ +current: DataViewEnumFilterCurrent, +set: (value: DataViewSetEnumFilterAction) => void +]; + +// @public (undocumented) +export const useDataViewEnumFilter: (name: string, value: string) => UseDataViewEnumFilter; + +// @public (undocumented) +export const useDataViewEnumFilterFactory: (name: string) => (value: string) => UseDataViewEnumFilter; + +// @public (undocumented) +export const useDataViewFilter: (key: string) => [T | undefined, (filter: SetStateAction) => void]; + +// @public (undocumented) +export const useDataViewFilterHandlerRegistry: () => DataViewFilterHandlerRegistry; + +// @public (undocumented) +export const useDataViewFilteringMethods: () => DataViewFilteringMethods; + +// @public (undocumented) +export const useDataViewFilteringState: () => DataViewFilteringState; + +// @public (undocumented) +export const useDataViewGlobalKey: () => string; + +// @public (undocumented) +export const useDataViewHighlightIndex: () => number | null; + +// @public (undocumented) +export const useDataViewKey: (props: Pick) => string; + +// @public (undocumented) +export const useDataViewKeyboardEventHandler: () => React_2.KeyboardEventHandler; + +// @public (undocumented) +export const useDataViewLoaderState: () => EntityListSubTreeLoaderState; + +// @public (undocumented) +export const useDataViewNullFilter: (name: string) => UseDataViewNullFilterResult; + +// @public (undocumented) +export type UseDataViewNullFilterResult = [ +state: DataViewNullFilterState, +set: (action: DataViewSetNullFilterAction) => void +]; + +// @public (undocumented) +export const useDataViewNumberFilterInput: ({ name, type, allowFloat }: UseDataViewNumberFilterInputProps) => UseDataViewNumberFilterInputResult; + +// @public (undocumented) +export type UseDataViewNumberFilterInputProps = { + name: string; + type: 'from' | 'to'; + allowFloat?: boolean; +}; + +// @public (undocumented) +export interface UseDataViewNumberFilterInputResult { + // (undocumented) + onChange: (e: ChangeEvent) => void; + // (undocumented) + value: string; +} + +// @public (undocumented) +export const useDataViewPagingInfo: () => DataViewPagingInfo; + +// @public (undocumented) +export const useDataViewPagingMethods: () => DataViewPagingMethods; + +// @public (undocumented) +export const useDataViewPagingState: () => DataViewPagingState; + +// @public (undocumented) +export const useDataViewRelationFilter: (name: string, entityId: EntityId_2) => UseDataViewRelationFilterResult; + +// @public (undocumented) +export const useDataViewRelationFilterData: ({ name, children, options }: { + name: string; + options: SugaredQualifiedEntityList['entities']; + children: ReactNode; +}) => [UseEntityListSubTreeLoaderResult, EntityListSubTreeLoaderState]; + +// @public (undocumented) +export const useDataViewRelationFilterFactory: (name: string) => (id: EntityId_2) => UseDataViewRelationFilterResult; + +// @public (undocumented) +export type UseDataViewRelationFilterResult = [ +current: DataViewRelationFilterCurrent, +set: (value: DataViewSetRelationFilterAction) => void +]; + +// @public (undocumented) +export type UseDataViewResult = { + state: DataViewState; + info: DataViewInfo; + methods: DataViewMethods; +}; + +// @public (undocumented) +export const useDataViewSelectionMethods: () => DataViewSelectionMethods; + +// @public (undocumented) +export const useDataViewSelectionState: () => DataViewSelectionState | undefined; + +// @public (undocumented) +export const useDataViewSortingMethods: () => DataViewSortingMethods; + +// @public (undocumented) +export const useDataViewSortingState: () => DataViewSortingState; + +// @public (undocumented) +export const useDataViewTextFilterInput: (name: string) => UseDataViewTextFilterInputResult; + +// @public (undocumented) +export interface UseDataViewTextFilterInputResult { + // (undocumented) + onChange: (e: ChangeEvent) => void; + // (undocumented) + value: string; +} + +// @public (undocumented) +export const useDataViewTextFilterMatchMode: (name: string, mode: TextFilterArtifactsMatchMode) => UseDataViewTextFilterMatchModeResult; + +// @public (undocumented) +export type UseDataViewTextFilterMatchModeResult = [isCurrent: boolean, set: () => void]; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-devbar.api.md b/build/api/react-devbar.api.md new file mode 100644 index 0000000000..381da8b52c --- /dev/null +++ b/build/api/react-devbar.api.md @@ -0,0 +1,121 @@ +## API Report File for "@contember/react-devbar" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { JSX as JSX_2 } from 'react/jsx-runtime'; +import { PropsWithChildren } from 'react'; +import { ReactElement } from 'react'; +import { ReactNode } from 'react'; + +// Warning: (ae-forgotten-export) The symbol "TryRun" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export const createErrorHandler: (renderer: ErrorReactRenderer) => TryRun; + +// @public (undocumented) +export const DevBar: ({ breakpoint, children, brand, }: PropsWithChildren<{ + brand?: ReactNode; + breakpoint?: number | undefined; +}>) => JSX_2.Element; + +// @public (undocumented) +export function DevError(props: DevErrorProps): JSX_2.Element; + +// @public (undocumented) +export function DevErrorBadge({ errorCount, onOpen }: DevErrorBadgeProps): JSX_2.Element; + +// @public (undocumented) +export interface DevErrorBadgeProps { + // (undocumented) + errorCount: number; + // (undocumented) + onOpen: () => void; +} + +// @public (undocumented) +export function DevErrorList({ currentError, currentErrorIndex, currentErrorSource, errorCount, onClose, onNext, onPrevious, }: DevErrorListProps): JSX_2.Element; + +// @public (undocumented) +export interface DevErrorListProps { + // (undocumented) + currentError: ProcessedError; + // (undocumented) + currentErrorIndex: number; + // (undocumented) + currentErrorSource: string; + // (undocumented) + errorCount: number; + // (undocumented) + onClose: () => void; + // (undocumented) + onNext: () => void; + // (undocumented) + onPrevious: () => void; +} + +// Warning: (ae-forgotten-export) The symbol "DevErrorInnerProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export interface DevErrorProps extends DevErrorInnerProps { + // (undocumented) + source: string; +} + +// @public (undocumented) +export const DevPanel: ({ heading, icon, children, preview }: { + icon: ReactNode; + heading: ReactNode; + children: ReactNode; + preview?: ReactNode; +}) => JSX_2.Element; + +// @public (undocumented) +export type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void; + +// @public (undocumented) +export type ErrorType = Error | unknown; + +// @public (undocumented) +export interface ParsedStackFrame { + // (undocumented) + callee?: string; + // (undocumented) + filename: string; + // (undocumented) + line?: number; + // (undocumented) + sourceCodeLines?: string[]; + // (undocumented) + thirdParty: boolean; +} + +// @public (undocumented) +export type ParsedStackTrace = ParsedStackFrame[]; + +// @public (undocumented) +export const parseStacktrace: (e: Error) => Promise<{ + filename: string; + line: number | undefined; + callee: string; + thirdParty: boolean; + sourceCodeLines: string[] | undefined; +}[]>; + +// @public (undocumented) +export interface ProcessedError { + // (undocumented) + cause?: ProcessedError; + // (undocumented) + error: ErrorType; + // (undocumented) + parsedStackStrace?: ParsedStackTrace; +} + +// @public (undocumented) +export const useProcessedError: (e: ErrorType) => ProcessedError; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-form.api.md b/build/api/react-form.api.md new file mode 100644 index 0000000000..2db0d13c2c --- /dev/null +++ b/build/api/react-form.api.md @@ -0,0 +1,126 @@ +## API Report File for "@contember/react-form" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Context } from 'react'; +import { ErrorAccessor } from '@contember/react-binding'; +import { FieldAccessor } from '@contember/react-binding'; +import { JSX as JSX_2 } from 'react/jsx-runtime'; +import { JSXElementConstructor } from 'react'; +import { OptionallyVariableFieldValue } from '@contember/react-binding'; +import * as React_2 from 'react'; +import { ReactElement } from 'react'; +import { ReactNode } from 'react'; +import { SugaredRelativeEntityList } from '@contember/react-binding'; +import { SugaredRelativeSingleEntity } from '@contember/react-binding'; +import { SugaredRelativeSingleField } from '@contember/react-binding'; + +// @public (undocumented) +export const FormCheckbox: React_2.NamedExoticComponent; + +// @public (undocumented) +export interface FormCheckboxProps { + // (undocumented) + children: ReactElement; + // (undocumented) + defaultValue?: OptionallyVariableFieldValue; + // (undocumented) + field: SugaredRelativeSingleField['field']; + // (undocumented) + isNonbearing?: boolean; +} + +// @public (undocumented) +export const FormError: ({ children, formatter }: { + formatter: (errors: ErrorAccessor.Error[]) => ReactNode[]; + children: ReactElement; +}) => ReactElement>[]; + +// @internal (undocumented) +export const FormErrorContext: Context; + +// @internal (undocumented) +export const FormFieldIdContext: Context; + +// @public (undocumented) +export const FormFieldScope: ({ field, children }: FormFieldScopeProps) => JSX_2.Element; + +// @public (undocumented) +export type FormFieldScopeProps = { + field: SugaredRelativeSingleField['field']; + children: React_2.ReactNode; +}; + +// @public (undocumented) +export const FormHasManyRelationScope: ({ field, children }: FormHasManyRelationScopeProps) => JSX_2.Element; + +// @public (undocumented) +export type FormHasManyRelationScopeProps = { + field: SugaredRelativeEntityList['field']; + children: React_2.ReactNode; +}; + +// @public (undocumented) +export const FormHasOneRelationScope: ({ field, children }: FormHasOneRelationScopeProps) => JSX_2.Element; + +// @public (undocumented) +export type FormHasOneRelationScopeProps = { + field: SugaredRelativeSingleEntity['field']; + children: React_2.ReactNode; +}; + +// @public (undocumented) +export const FormInput: React_2.NamedExoticComponent; + +// @public (undocumented) +export interface FormInputProps { + // (undocumented) + children: React_2.ReactElement; + // (undocumented) + defaultValue?: OptionallyVariableFieldValue; + // (undocumented) + field: SugaredRelativeSingleField['field']; + // (undocumented) + isNonbearing?: boolean; +} + +// @public (undocumented) +export const FormLabel: (props: { + children: React_2.ReactElement; +}) => JSX_2.Element; + +// @public (undocumented) +export const FormRadioInput: React_2.NamedExoticComponent; + +// @public (undocumented) +export interface FormRadioItemProps { + // (undocumented) + children: React_2.ReactNode; + // (undocumented) + defaultValue?: OptionallyVariableFieldValue; + // (undocumented) + field: SugaredRelativeSingleField['field']; + // (undocumented) + isNonbearing?: boolean; + // (undocumented) + value: string; +} + +// @public (undocumented) +export const useFormError: () => ErrorAccessor.Error[] | undefined; + +// @public (undocumented) +export const useFormFieldId: () => string | undefined; + +// @public (undocumented) +export const useFormInputValidationHandler: (field: FieldAccessor) => { + ref: React_2.RefObject; + onFocus: () => void; + onBlur: () => void; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-identity.api.md b/build/api/react-identity.api.md new file mode 100644 index 0000000000..20b4a49e6f --- /dev/null +++ b/build/api/react-identity.api.md @@ -0,0 +1,134 @@ +## API Report File for "@contember/react-identity" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Environment } from '@contember/react-binding'; +import { JSX as JSX_2 } from 'react/jsx-runtime'; +import { NamedExoticComponent } from 'react'; +import { ReactNode } from 'react'; + +// @public (undocumented) +export const HasRole: NamedExoticComponent; + +// @public (undocumented) +export interface HasRoleProps { + // (undocumented) + children?: ReactNode; + // (undocumented) + role: RoleCondition; +} + +// @public (undocumented) +export interface Identity { + // (undocumented) + readonly id: string; + // (undocumented) + readonly permissions: { + readonly canCreateProject: boolean; + }; + // (undocumented) + readonly person?: Person; + // (undocumented) + readonly projects: IdentityProject[]; +} + +// @public (undocumented) +export const identityEnvironmentExtension: Environment.Extension; + +// @public (undocumented) +export interface IdentityMethods { + // (undocumented) + clearIdentity: () => void; + // (undocumented) + refreshIdentity: () => Promise; +} + +// @public (undocumented) +export interface IdentityProject { + // (undocumented) + readonly name: string; + // (undocumented) + readonly roles: readonly string[]; + // (undocumented) + readonly slug: string; +} + +// @public (undocumented) +export const IdentityProvider: React.FC; + +// @public (undocumented) +export interface IdentityProviderProps { + // (undocumented) + children: ReactNode; +} + +// @public (undocumented) +export const IdentityState: ({ state, children }: IdentityStateProps) => ReactNode; + +// @public (undocumented) +export interface IdentityStateProps { + // (undocumented) + children: ReactNode; + // (undocumented) + state: IdentityStateValue | IdentityStateValue[]; +} + +// @public (undocumented) +export type IdentityStateValue = 'none' | 'loading' | 'failed' | 'cleared' | 'success'; + +// @public (undocumented) +export const LogoutTrigger: ({ children }: { + children: ReactNode; +}) => JSX_2.Element; + +// @public (undocumented) +export interface Person { + // (undocumented) + readonly email?: string; + // (undocumented) + readonly id: string; + // (undocumented) + readonly otpEnabled: boolean; +} + +// @public (undocumented) +export const projectEnvironmentExtension: Environment.Extension; + +// @public (undocumented) +export type ProjectUserRoles = Set; + +// @public (undocumented) +export type RoleCondition = string | ((roles: Set) => boolean); + +// @public (undocumented) +export const useFetchIdentity: () => [{ + state: IdentityStateValue; + identity: Identity | undefined; +}, IdentityMethods]; + +// @public (undocumented) +export const useIdentity: () => Identity | undefined; + +// @public (undocumented) +export const useIdentityMethods: () => IdentityMethods; + +// @public (undocumented) +export const useIdentityState: () => IdentityStateValue; + +// @public (undocumented) +export const useLogout: () => ({ noRedirect }?: { + noRedirect?: boolean | undefined; +}) => Promise; + +// @public (undocumented) +export const useProjectUserRoles: () => ProjectUserRoles; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-repeater-dnd-kit.api.md b/build/api/react-repeater-dnd-kit.api.md new file mode 100644 index 0000000000..964c05dd84 --- /dev/null +++ b/build/api/react-repeater-dnd-kit.api.md @@ -0,0 +1,47 @@ +## API Report File for "@contember/react-repeater-dnd-kit" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { JSX as JSX_2 } from 'react/jsx-runtime'; +import { default as React_2 } from 'react'; +import { ReactNode } from 'react'; + +// @public (undocumented) +export const RepeaterSortable: ({ children }: { + children: ReactNode; +}) => JSX_2.Element; + +// @public (undocumented) +export const RepeaterSortableDragOverlay: ({ children }: { + children: ReactNode; +}) => JSX_2.Element | null; + +// @public (undocumented) +export const RepeaterSortableDropIndicator: ({ children, position }: { + children: ReactNode; + position: 'before' | 'after'; +}) => JSX_2.Element | null; + +// @public (undocumented) +export const RepeaterSortableEachItem: ({ children }: { + children: ReactNode; +}) => JSX_2.Element; + +// @public (undocumented) +export const RepeaterSortableItemActivator: React_2.ForwardRefExoticComponent<{ + children: ReactNode; +} & React_2.RefAttributes>; + +// @public (undocumented) +export const RepeaterSortableItemNode: ({ children }: { + children: ReactNode; +}) => JSX_2.Element; + + +export * from "@contember/react-repeater"; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-repeater.api.md b/build/api/react-repeater.api.md new file mode 100644 index 0000000000..95468f7652 --- /dev/null +++ b/build/api/react-repeater.api.md @@ -0,0 +1,100 @@ +## API Report File for "@contember/react-repeater" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { EntityAccessor } from '@contember/binding'; +import { EntityAccessor as EntityAccessor_2 } from '@contember/react-binding'; +import { EntityListAccessor } from '@contember/binding'; +import { JSX as JSX_2 } from 'react/jsx-runtime'; +import { default as React_2 } from 'react'; +import { ReactNode } from 'react'; +import { SugaredFieldProps } from '@contember/react-binding'; +import { SugaredQualifiedEntityList } from '@contember/binding'; +import { SugaredRelativeEntityList } from '@contember/binding'; + +// @public (undocumented) +export const Repeater: React_2.NamedExoticComponent; + +// @public (undocumented) +export type RepeaterAddItemIndex = number | 'first' | 'last' | undefined; + +// @public (undocumented) +export type RepeaterAddItemMethod = (index: RepeaterAddItemIndex, preprocess?: EntityAccessor.BatchUpdatesHandler) => void; + +// @public (undocumented) +export const RepeaterAddItemTrigger: ({ children, index }: { + children: ReactNode; + index: RepeaterAddItemIndex; +}) => JSX_2.Element; + +// @public (undocumented) +export const RepeaterEachItem: ({ children }: { + children: ReactNode; +}) => JSX_2.Element[]; + +// @public (undocumented) +export const RepeaterEmpty: ({ children }: { + children: ReactNode; +}) => JSX_2.Element | null; + +// @public (undocumented) +export type RepeaterMethods = { + moveItem?: RepeaterMoveItemMethod; + addItem?: RepeaterAddItemMethod; + removeItem?: RepeaterRemoveItemMethod; +}; + +// @public (undocumented) +export type RepeaterMoveItemIndex = number | 'first' | 'last' | 'previous' | 'next'; + +// @public (undocumented) +export type RepeaterMoveItemMethod = (entity: EntityAccessor, index: RepeaterMoveItemIndex) => void; + +// @public (undocumented) +export const RepeaterMoveItemTrigger: ({ children, index }: { + children: ReactNode; + index: RepeaterMoveItemIndex; +}) => JSX_2.Element; + +// @public (undocumented) +export const RepeaterNotEmpty: ({ children }: { + children: ReactNode; +}) => JSX_2.Element | null; + +// @public (undocumented) +export type RepeaterProps = RepeaterQualifiedProps | RepeaterRelativeProps; + +// @public (undocumented) +export type RepeaterQualifiedProps = SugaredQualifiedEntityList & { + children: React_2.ReactNode; + sortableBy?: SugaredFieldProps['field']; +}; + +// @public (undocumented) +export type RepeaterRelativeProps = SugaredRelativeEntityList & { + children: React_2.ReactNode; + sortableBy?: SugaredFieldProps['field']; +}; + +// @public (undocumented) +export type RepeaterRemoveItemMethod = (entity: EntityAccessor) => void; + +// @public (undocumented) +export const RepeaterRemoveItemTrigger: ({ children }: { + children: ReactNode; +}) => JSX_2.Element; + +// @public (undocumented) +export const useRepeaterEntityListAccessor: () => EntityListAccessor | undefined; + +// @public (undocumented) +export const useRepeaterMethods: () => RepeaterMethods; + +// @public (undocumented) +export const useRepeaterSortedEntities: () => EntityAccessor_2[]; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-routing.api.md b/build/api/react-routing.api.md new file mode 100644 index 0000000000..766ae7c6ba --- /dev/null +++ b/build/api/react-routing.api.md @@ -0,0 +1,292 @@ +## API Report File for "@contember/react-routing" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { BaseSyntheticEvent } from 'react'; +import { ComponentType } from 'react'; +import { Context } from 'react'; +import { EntityAccessor } from '@contember/react-binding'; +import { Environment } from '@contember/react-binding'; +import { FC } from 'react'; +import { FunctionComponent } from 'react'; +import { JSX as JSX_2 } from 'react/jsx-runtime'; +import { NamedExoticComponent } from 'react'; +import { ReactElement } from 'react'; +import { ReactNode } from 'react'; + +// @public (undocumented) +export const createBindingLinkParametersResolver: (entity: EntityAccessor | undefined) => RoutingParameterResolver; + +// @public (undocumented) +export const CurrentRequestContext: Context; + +// @public (undocumented) +export type DynamicRequestParameters = RequestParameters; + +// @public (undocumented) +export type IncompleteRequestState = Partial> & { + pageName: string; +} | null; + +// @public (undocumented) +export const isRoutingLinkTarget: (value: unknown) => value is RoutingLinkTarget; + +// @public (undocumented) +export type LazyPageModule = () => Promise; + +// @public (undocumented) +export const Link: NamedExoticComponent; + +// @public (undocumented) +export type LinkProps = Omit; + +// @public (undocumented) +export type LinkTarget = RoutingLinkTarget; + +// @public +export const Page: { +

(props: PageProps

): JSX_2.Element | null; + displayName: string; + getPageName(props: PageProps): string; +}; + +// @public @deprecated (undocumented) +export const PageLink: NamedExoticComponent; + +// @public (undocumented) +export interface PageModule { + // (undocumented) + [action: string]: ComponentType | ReactElement | undefined; +} + +// @public (undocumented) +export class PageNotFound extends Error { + constructor(reason?: string); +} + +// @public (undocumented) +export interface PageProps

{ + // (undocumented) + children: FunctionComponent

| ReactNode; + // (undocumented) + name: string; +} + +// @public (undocumented) +export interface PageProvider

{ + // (undocumented) + getPageName(props: P, fallback?: string): string; +} + +// @public (undocumented) +export type PageProviderElement = ReactElement & PageProvider>; + +// @public (undocumented) +export interface PageRequest

= RequestParameters> { + // (undocumented) + dimensions: SelectedDimension; + // (undocumented) + pageName: string; + // (undocumented) + parameters: P; +} + +// @public +export const Pages: ({ children, layout, ErrorBoundary, suspenseFallback }: PagesProps) => JSX_2.Element | null; + +// @public (undocumented) +export type PagesMap = Record; + +// @public (undocumented) +export type PagesMapElement = LazyPageModule | PageModule | ComponentType | ReactElement | PageProviderElement; + +// @public (undocumented) +export interface PagesProps { + // (undocumented) + children: PagesMap | PageProviderElement[] | PageProviderElement; + // (undocumented) + ErrorBoundary?: ComponentType<{ + children: ReactNode; + }>; + // (undocumented) + layout?: ComponentType<{ + children?: ReactNode; + }>; + // (undocumented) + NotFound?: ComponentType<{}>; + // (undocumented) + suspenseFallback?: ReactNode; +} + +// @public (undocumented) +export const parseLinkTarget: (to: LinkTarget, env: Environment) => Exclude; + +// @public (undocumented) +export const pathToRequestState: (routing: RoutingContextValue, path: string, query: string) => RequestState; + +// @public (undocumented) +export const populateRequest: (routing: RoutingContextValue, location: Location) => RequestState; + +// @public (undocumented) +export const PushRequestContext: Context<(req: RequestState) => void>; + +// @public (undocumented) +export type RequestChange = (currentState: RequestState) => IncompleteRequestState | string; + +// @public (undocumented) +export const requestChangeFactory:

(pageName: string, parameters?: P | undefined) => (currentState: RequestState) => PageRequest

; + +// @public (undocumented) +export type RequestParameters = { + [K in string]?: RequestParameterValue | Extra; +}; + +// @public (undocumented) +export type RequestParameterValue = number | string; + +// @public (undocumented) +export const RequestProvider: FC<{ + children: ReactNode; +}>; + +// @public (undocumented) +export type RequestState = RequestParameters> = PageRequest | null; + +// @public (undocumented) +export const requestStateToPath: (routing: RoutingContextValue, request: RequestState) => string; + +// @public (undocumented) +export type RouteConfig = RouteConfigWithMapping | RouteConfigWithoutMapping; + +// @public (undocumented) +export interface RouteConfigWithMapping { + // (undocumented) + objectToParams: (params: N) => T; + // (undocumented) + paramsToObject: (params: T) => { + [K in Exclude]: N[K]; + }; + // (undocumented) + path: string; +} + +// @public (undocumented) +export interface RouteConfigWithoutMapping { + // (undocumented) + objectToParams?: undefined; + // (undocumented) + paramsToObject?: undefined; + // (undocumented) + path: string; +} + +// @public (undocumented) +export type RouteMap = { + [K in N]: RouteConfig>; +}; + +// @public (undocumented) +export type RouteName = string; + +// @public (undocumented) +export type RouteParams = any; + +// @public (undocumented) +export type RouteParamsByName = T extends { + name: K; +} ? T : never; + +// @public (undocumented) +export const ROUTING_BINDING_PARAMETER_PREFIX = "entity."; + +// @public (undocumented) +export const RoutingContext: Context; + +// @public (undocumented) +export interface RoutingContextValue { + // (undocumented) + basePath: string; + // (undocumented) + defaultDimensions?: SelectedDimension; + // (undocumented) + pageInQuery?: boolean; + // (undocumented) + routes: RouteMap; +} + +// @public +export const RoutingLink: NamedExoticComponent; + +// @public (undocumented) +export interface RoutingLinkParams { + // (undocumented) + href: string; + // (undocumented) + isActive: boolean; + // (undocumented) + navigate: (e?: BaseSyntheticEvent) => void; +} + +// @public (undocumented) +export interface RoutingLinkProps { + // (undocumented) + children?: ReactElement; + // (undocumented) + parameters?: RequestParameters; + // (undocumented) + parametersResolver?: RoutingParameterResolver; + // (undocumented) + to: RoutingLinkTarget; +} + +// @public (undocumented) +export type RoutingLinkTarget = string | RequestChange | IncompleteRequestState; + +// @public (undocumented) +export class RoutingParameter { + constructor(name: string); + // (undocumented) + readonly name: string; +} + +// @public (undocumented) +export type RoutingParameterResolver = (name: string) => RequestParameterValue | undefined; + +// @public (undocumented) +export interface SelectedDimension { + // (undocumented) + [key: string]: string[]; +} + +// @public (undocumented) +export const targetToRequest: (target: RoutingLinkTarget, currentRequest: RequestState) => IncompleteRequestState | null; + +// @public (undocumented) +export const useBindingLinkParametersResolver: () => RoutingParameterResolver; + +// @public (undocumented) +export const useCurrentRequest: () => RequestState; + +// @public (undocumented) +export const useLinkFactory: () => (target: RoutingLinkTarget, parameters?: RequestParameters, entity?: EntityAccessor) => RoutingLinkParams; + +// @public (undocumented) +export const usePushRequest: () => (req: RequestState) => void; + +// @public (undocumented) +export const useRedirect: () => (target: RoutingLinkTarget, parameters?: RequestParameters) => void; + +// @public (undocumented) +export const useRouting: () => RoutingContextValue; + +// @public (undocumented) +export const useRoutingLink: (target: RoutingLinkTarget, parametersResolver?: RoutingParameterResolver, parameters?: RequestParameters) => RoutingLinkParams; + +// @public (undocumented) +export const useRoutingLinkFactory: () => (target: RoutingLinkTarget, parameters?: RequestParameters, parametersResolver?: RoutingParameterResolver) => RoutingLinkParams; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-select.api.md b/build/api/react-select.api.md new file mode 100644 index 0000000000..e3d60a2843 --- /dev/null +++ b/build/api/react-select.api.md @@ -0,0 +1,144 @@ +## API Report File for "@contember/react-select" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Context } from 'react'; +import { DataViewProps } from '@contember/react-dataview'; +import { EntityAccessor } from '@contember/react-binding'; +import { JSX as JSX_2 } from 'react/jsx-runtime'; +import { default as React_2 } from 'react'; +import { ReactElement } from 'react'; +import { ReactNode } from 'react'; +import { SugarableQualifiedEntityList } from '@contember/react-binding'; +import { SugaredQualifiedEntityList } from '@contember/react-binding'; +import { SugaredRelativeEntityList } from '@contember/react-binding'; +import { SugaredRelativeSingleEntity } from '@contember/react-binding'; +import { SugaredRelativeSingleField } from '@contember/react-binding'; + +// @public (undocumented) +export const MultiSelect: React_2.NamedExoticComponent<{ + children: ReactNode; + field: SugaredRelativeEntityList['field']; + options: SugaredQualifiedEntityList['entities']; +} & SelectEvents>; + +// @public (undocumented) +export type MultiSelectProps = { + children: ReactNode; + field: SugaredRelativeEntityList['field']; + options: SugaredQualifiedEntityList['entities']; +} & SelectEvents; + +// @public (undocumented) +export const Select: React_2.NamedExoticComponent<{ + children: ReactNode; + field: SugaredRelativeSingleEntity['field']; + options: SugaredQualifiedEntityList['entities']; +} & SelectEvents>; + +// @internal (undocumented) +export const SelectCurrentEntitiesContext: Context; + +// @public (undocumented) +export const SelectDataView: (props: SelectDataViewProps) => JSX_2.Element; + +// @public (undocumented) +export type SelectDataViewProps = Omit & { + children: ReactNode; +}; + +// @public (undocumented) +export const SelectEachValue: ({ children }: { + children: ReactNode; +}) => JSX_2.Element[]; + +// @public (undocumented) +export interface SelectEvents { + // (undocumented) + onSelect?: (entity: EntityAccessor) => void; + // (undocumented) + onUnselect?: (entity: EntityAccessor) => void; +} + +// @public (undocumented) +export type SelectHandler = (entity: EntityAccessor, action?: 'select' | 'unselect' | 'toggle') => void; + +// @internal (undocumented) +export const SelectHandleSelectContext: Context; + +// @internal (undocumented) +export const SelectIsSelectedContext: Context<(entity: EntityAccessor) => boolean>; + +// @public (undocumented) +export const SelectItemTrigger: React_2.ForwardRefExoticComponent>; + +// @public (undocumented) +export type SelectItemTriggerProps = { + children: ReactElement; + action?: 'select' | 'unselect' | 'toggle'; +}; + +// @public (undocumented) +export const SelectNewItem: ({ children }: { + children: ReactNode; +}) => JSX_2.Element | null; + +// @public (undocumented) +export const SelectOption: React_2.ForwardRefExoticComponent>; + +// @public (undocumented) +export type SelectOptionProps = { + children: ReactNode; + action?: 'select' | 'unselect' | 'toggle'; +}; + +// @internal (undocumented) +export const SelectOptionsContext: Context; + +// @public (undocumented) +export const SelectPlaceholder: ({ children }: { + children: ReactNode; +}) => JSX_2.Element | null; + +// @public (undocumented) +export type SelectProps = { + children: ReactNode; + field: SugaredRelativeSingleEntity['field']; + options: SugaredQualifiedEntityList['entities']; +} & SelectEvents; + +// @public (undocumented) +export const SortableMultiSelect: React_2.NamedExoticComponent<{ + children: ReactNode; + field: SugaredRelativeEntityList['field']; + options: SugaredQualifiedEntityList['entities']; + sortableBy: SugaredRelativeSingleField['field']; + connectAt: SugaredRelativeSingleEntity['field']; +} & SelectEvents>; + +// @public (undocumented) +export type SortableMultiSelectProps = { + children: ReactNode; + field: SugaredRelativeEntityList['field']; + options: SugaredQualifiedEntityList['entities']; + sortableBy: SugaredRelativeSingleField['field']; + connectAt: SugaredRelativeSingleEntity['field']; +} & SelectEvents; + +// @public (undocumented) +export const useSelectCurrentEntities: () => EntityAccessor[]; + +// @public (undocumented) +export const useSelectHandleSelect: () => SelectHandler; + +// @public (undocumented) +export const useSelectIsSelected: () => (entity: EntityAccessor) => boolean; + +// @public (undocumented) +export const useSelectOptions: () => string | SugarableQualifiedEntityList; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-utils.api.md b/build/api/react-utils.api.md index b9b0216917..815b5ed5e6 100644 --- a/build/api/react-utils.api.md +++ b/build/api/react-utils.api.md @@ -41,10 +41,10 @@ export const ContainerWidthContext: Context; export type ContainerWidthContextType = number; // @public (undocumented) -export function createNonNullableContextFactory(displayName: string, initialValue?: T): [Context, () => NonNullable]; +export function createContext(name: string, initialValue: T): [Context, () => T]; // @public (undocumented) -export function createOptionalContextFactory(name: string, initialValue: T): [Context, () => T]; +export function createRequiredContext(displayName: string): [Context, () => T]; // @public (undocumented) export const DebugChildren: NamedExoticComponent; diff --git a/build/api/ui.api.md b/build/api/ui.api.md index 6c42ef3f8b..956fb83ffa 100644 --- a/build/api/ui.api.md +++ b/build/api/ui.api.md @@ -558,62 +558,6 @@ export interface DescriptionProps { className?: string; } -// @public (undocumented) -export const DevBar: ({ breakpoint, children, }: PropsWithChildren<{ - breakpoint?: number | undefined; -}>) => JSX_2.Element; - -// @public (undocumented) -export function DevError(props: DevErrorProps): JSX_2.Element; - -// @public (undocumented) -export function DevErrorBadge({ errorCount, onOpen }: DevErrorBadgeProps): JSX_2.Element; - -// @public (undocumented) -export interface DevErrorBadgeProps { - // (undocumented) - errorCount: number; - // (undocumented) - onOpen: () => void; -} - -// @public (undocumented) -export function DevErrorList({ currentError, currentErrorIndex, currentErrorSource, errorCount, onClose, onNext, onPrevious, }: DevErrorListProps): JSX_2.Element; - -// @public (undocumented) -export interface DevErrorListProps { - // (undocumented) - currentError: ProcessedError; - // (undocumented) - currentErrorIndex: number; - // (undocumented) - currentErrorSource: string; - // (undocumented) - errorCount: number; - // (undocumented) - onClose: () => void; - // (undocumented) - onNext: () => void; - // (undocumented) - onPrevious: () => void; -} - -// Warning: (ae-forgotten-export) The symbol "DevErrorInnerProps" needs to be exported by the entry point index.d.ts -// -// @public (undocumented) -export interface DevErrorProps extends DevErrorInnerProps { - // (undocumented) - source: string; -} - -// @public (undocumented) -export const DevPanel: ({ heading, icon, children, preview }: { - icon: ReactNode; - heading: ReactNode; - children: ReactNode; - preview?: ReactNode; -}) => JSX_2.Element; - // @public (undocumented) export const DialogModal: MemoExoticComponent<({ bodyClassName, bodyProps, children, className, dividers, footer, footerClassName, footerProps, header, headerClassName, headerProps, layout, onClose, ...rest }: DialogModalProps) => JSX_2.Element>; @@ -1510,9 +1454,6 @@ export interface ErrorListProps { errors?: FieldErrors; } -// @public (undocumented) -export type ErrorType = Error | unknown; - // @public export const FieldContainer: MemoExoticComponent<({ children, className: classNameProp, componentClassName, description, errors, display, footer, evenly, gap, horizontal, label, labelDescription, labelPosition, required, reverse, size, style, useLabelElement, ...props }: FieldContainerProps) => JSX_2.Element>; @@ -1765,9 +1706,6 @@ focusRing?: boolean | undefined; withTopToolbar?: boolean | undefined; } & RestHTMLTextInputProps & RefAttributes>>; -// @public (undocumented) -export const isSpecialLinkClick: (e: MouseEvent) => boolean; - // @public (undocumented) export type Justification = Default | 'justifyStart' | 'justifyCenter' | 'justifyEnd'; @@ -1889,11 +1827,11 @@ export type LinkCardProps = Omit & Omit) => void; + onClick?: (e?: MouseEvent_2) => void; } // @public @deprecated (undocumented) @@ -2103,23 +2041,6 @@ export type OwnVisuallyHiddenProps = PropsWithChildren<{ // @public @deprecated (undocumented) export const PageLayoutContent: MemoExoticComponent<({ children, layout, pageContentLayout }: LayoutPageContentProps) => JSX_2.Element>; -// @public (undocumented) -export interface ParsedStackFrame { - // (undocumented) - callee?: string; - // (undocumented) - filename: string; - // (undocumented) - line?: number; - // (undocumented) - sourceCodeLines?: string[]; - // (undocumented) - thirdParty: boolean; -} - -// @public (undocumented) -export type ParsedStackTrace = ParsedStackFrame[]; - // @public (undocumented) export const PasswordInput: MemoExoticComponent & ControlValueProps & { focusRing?: boolean | undefined; @@ -2170,16 +2091,6 @@ export type PortalRootProviderProps = PropsWithChildren<{ // @public (undocumented) export const PreventCloseContext: Context<() => void>; -// @public (undocumented) -export interface ProcessedError { - // (undocumented) - cause?: ProcessedError; - // (undocumented) - error: ErrorType; - // (undocumented) - parsedStackStrace?: ParsedStackTrace; -} - // @public (undocumented) export const ProgressBar: MemoExoticComponent<({ progress }: ProgressBarProps) => JSX_2.Element>; @@ -2484,7 +2395,7 @@ export const SpinnerContainer: MemoExoticComponent<({ enabled, children, size }: // @public (undocumented) export interface SpinnerContainerProps extends SpinnerOverlayProps { // (undocumented) - children: ReactNode; + children?: ReactNode; // (undocumented) enabled?: boolean; } diff --git a/build/api/utilities.api.md b/build/api/utilities.api.md index 68f2b9ca5a..ced544ae0c 100644 --- a/build/api/utilities.api.md +++ b/build/api/utilities.api.md @@ -98,6 +98,9 @@ export function isColorSchemeClassName(value: string): boolean; // @public (undocumented) export function isNonNegativeNumber(value: unknown): value is number; +// @public (undocumented) +export const isSpecialLinkClick: (e: MouseEvent) => boolean; + // @public export function listClassName(list: NestedClassName): string;