diff --git a/build/api/admin.api.md b/build/api/admin.api.md index 515610eb38..98d4252d3a 100644 --- a/build/api/admin.api.md +++ b/build/api/admin.api.md @@ -6,28 +6,35 @@ /// -import type { AccessorTreeState } from '@contember/binding'; +import { AccessorErrorsHolder } from '@contember/react-binding-ui'; +import type { AccessorTreeState } from '@contember/react-binding'; +import { AddEntityButtonProps } from '@contember/react-binding-ui'; import { Ancestor } from 'slate'; import { AnchorButtonProps } from '@contember/ui'; import { AnchorHTMLAttributes } from 'react'; -import type { AsyncBatchUpdatesOptions } from '@contember/binding'; +import type { AsyncBatchUpdatesOptions } from '@contember/react-binding'; import { BaseEditor } from 'slate'; import { BaseSyntheticEvent } from 'react'; import { BoxOwnProps } from '@contember/ui'; -import { BoxProps } from '@contember/ui'; import { ButtonProps } from '@contember/ui'; import { ChildrenAnalyzer } from '@contember/react-multipass-rendering'; -import { ColorInputProps } from '@contember/ui'; -import { ComponentProps } from 'react'; +import { ChoiceFieldDictionary } from '@contember/react-choice-field-ui'; import { ComponentType } from 'react'; import { ContemberClientProps } from '@contember/react-client'; -import { ControlProps } from '@contember/ui'; -import { CSSProperties } from 'react'; -import { DataBindingProviderStateComponent } from '@contember/binding'; -import { DataBindingStateComponentProps } from '@contember/binding'; -import { DateInputProps } from '@contember/ui'; -import { DateTimeInputProps } from '@contember/ui'; -import { Default } from '@contember/ui'; +import type { CreateNewEntityButtonProps } from '@contember/react-binding-ui'; +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'; +import { DataGridContainerPublicProps } from '@contember/react-datagrid-ui'; +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'; import type { DetailedHTMLProps } from 'react'; import { Dispatch } from 'react'; @@ -38,115 +45,92 @@ import { EditorCanvasSize } from '@contember/ui'; import { EditorInterface } from 'slate'; import { Transforms as EditorTransforms } from 'slate'; import { Element as Element_2 } from 'slate'; -import { ElementType } from 'react'; -import { EmailInputProps } from '@contember/ui'; -import { EntityAccessor } from '@contember/binding'; -import { EntityId } from '@contember/binding'; -import { EntityListAccessor } from '@contember/binding'; -import { EntityListBaseProps } from '@contember/binding'; -import { EntityListSubTreeAdditionalProps } from '@contember/binding'; -import { EntityName } from '@contember/binding'; -import { EntitySubTreeAdditionalCreationProps } from '@contember/binding'; -import { EntitySubTreeAdditionalProps } from '@contember/binding'; -import { Environment } from '@contember/binding'; -import type { ErrorAccessor } from '@contember/binding'; -import { ErrorListProps } from '@contember/ui'; +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'; +import { Environment } from '@contember/react-binding'; +import { ErrorCodeDictionary } from '@contember/react-binding-ui'; import { FC } from 'react'; -import { FieldAccessor } from '@contember/binding'; -import { FieldBasicProps } from '@contember/binding'; +import { FieldAccessor } from '@contember/react-binding'; +import { FieldBasicProps } from '@contember/react-binding'; import { FieldContainerProps } from '@contember/ui'; -import { FieldErrors } from '@contember/ui'; -import { FieldValue } from '@contember/binding'; +import { FieldValue } from '@contember/react-binding'; +import { FieldValueFormatter } from '@contember/react-form-fields-ui'; +import { FieldViewDictionary } from '@contember/react-binding-ui'; import type { FileUploader } from '@contember/client'; import type { FileUploadError } from '@contember/client'; -import { Filter } from '@contember/binding'; import type { FocusEvent as FocusEvent_2 } from 'react'; import { FunctionComponent } from 'react'; -import { default as Fuse_2 } from 'fuse.js'; 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 { HistoryEditor } from 'slate-history'; -import { HTMLAnchorElementProps } from '@contember/ui'; -import { HTMLImageElementProps } from '@contember/ui'; -import { HTMLVideoElementProps } from '@contember/ui'; -import { IconProps } from '@contember/ui'; import { IconSourceSpecification } from '@contember/ui'; import { InputHTMLAttributes } from 'react'; -import { JsonObject } from '@contember/binding'; +import { JsonObject } from '@contember/react-binding'; import { JsonValue } from '@contember/binding'; -import { Justification } from '@contember/ui'; +import { JsonValue as JsonValue_2 } from '@contember/react-binding'; import type { KeyboardEvent as KeyboardEvent_2 } from 'react'; +import { LabelMiddleware } from '@contember/react-binding'; import { LayoutPageProps } from '@contember/ui'; import { Location as Location_2 } from 'slate'; -import { MapContainerProps } from 'react-leaflet'; -import { MarkerProps } from 'react-leaflet'; +import { MessageDictionaryByLocaleCode } from '@contember/react-i18n'; +import type { MessageFormatter } from '@contember/react-i18n'; import { MouseEvent as MouseEvent_2 } from 'react'; -import type { NamedExoticComponent } from 'react'; import { Node as Node_2 } from 'slate'; import { NodeEntry } from 'slate'; -import type { NonOptionalControlProps } from '@contember/ui'; -import { OptionallyVariableFieldValue } from '@contember/binding'; -import { OrderBy } from '@contember/binding'; +import type { OptionallyVariableFieldValue } from '@contember/react-binding'; import { Path } from 'slate'; import { PathRef } from 'slate'; -import { PersistOptions } from '@contember/binding'; -import type { PersistSuccessOptions } from '@contember/binding'; +import { PersistFeedbackDictionary } from '@contember/react-binding-ui'; +import type { PersistSuccessOptions } from '@contember/react-binding'; import { Point } from 'slate'; -import type { Props } from 'react-select'; import { PropsWithChildren } from 'react'; -import { PublicCommonReactSelectStylesProps } from '@contember/ui'; import { PureComponent } from 'react'; -import { QualifiedEntityList } from '@contember/binding'; -import type { RadioProps } from '@contember/ui'; import { Range as Range_2 } from 'slate'; -import { ReactChild } from 'react'; import { ReactEditor } from 'slate-react'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; import { Ref } from 'react'; import { RefObject } from 'react'; -import { RelativeSingleField } from '@contember/binding'; -import { RemovalType } from '@contember/binding'; +import { RelativeSingleField } from '@contember/react-binding'; +import { RemovalType } from '@contember/react-binding'; import { RenderElementProps } from 'slate-react'; import { RenderLeafProps } from 'slate-react'; import { RepeaterItemContainerProps } from '@contember/ui'; import type { S3FileUploader } from '@contember/client'; import { SaveButtonProps } from '@contember/ui'; -import type { Scalar } from '@contember/binding'; -import { Schema } from '@contember/binding'; +import type { Scalar } from '@contember/react-binding'; import { Scheme } from '@contember/ui'; -import { SearchInputProps } from '@contember/ui'; +import { SelectEntityButtonProps } from '@contember/react-binding-ui'; import { Selection as Selection_2 } from 'slate'; -import { Serializable } from '@contember/react-utils'; import { SetStateAction } from 'react'; +import { SimpleRelativeSingleFieldProps } from '@contember/react-form-fields-ui'; import { Size } from '@contember/ui'; import * as Slate from 'slate'; import { SortableContainerProps } from 'react-sortable-hoc'; import { SortableElementProps } from 'react-sortable-hoc'; -import { StaticRenderProvider } from '@contember/binding'; -import { SuccessfulPersistResult } from '@contember/binding'; -import { SugarableRelativeSingleField } from '@contember/binding'; -import { SugaredFieldProps } from '@contember/binding'; -import type { SugaredFilter } from '@contember/binding'; -import type { SugaredOrderBy } from '@contember/binding'; -import { SugaredQualifiedEntityList } from '@contember/binding'; -import { SugaredQualifiedFieldList } from '@contember/binding'; -import { SugaredQualifiedSingleEntity } from '@contember/binding'; -import { SugaredRelativeEntityList } from '@contember/binding'; -import { SugaredRelativeSingleEntity } from '@contember/binding'; -import { SugaredRelativeSingleField } from '@contember/binding'; -import { SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'; +import { StaticRenderProvider } from '@contember/react-binding'; +import { SugarableRelativeSingleField } from '@contember/react-binding'; +import { SugaredFieldProps } from '@contember/react-binding'; +import { SugaredQualifiedEntityList } from '@contember/react-binding'; +import { SugaredQualifiedFieldList } from '@contember/react-binding'; +import { SugaredQualifiedSingleEntity } from '@contember/react-binding'; +import { SugaredRelativeEntityList } from '@contember/react-binding'; +import { SugaredRelativeSingleEntity } from '@contember/react-binding'; +import { SugaredRelativeSingleField } from '@contember/react-binding'; +import { SugaredUnconstrainedQualifiedSingleEntity } from '@contember/react-binding'; import { SyntheticEvent } from 'react'; import { TableProps } from '@contember/ui'; import { TableRowProps } from '@contember/ui'; import { Text as Text_2 } from 'slate'; -import { TextareaInputProps } from '@contember/ui'; -import { TileLayerProps } from 'react-leaflet'; -import { TimeInputProps } from '@contember/ui'; -import { UnsugarableSingleEntityEventListeners } from '@contember/binding'; -import { UrlInputProps } from '@contember/ui'; +import { UnsugarableSingleEntityEventListeners } from '@contember/react-binding'; import { VisuallyDependentControlProps } from '@contember/ui'; // @public (undocumented) @@ -192,42 +176,6 @@ export const acceptImageFile: ({ file }: AcceptFileOptions) => boolean; // @public (undocumented) export const acceptVideoFile: ({ file }: AcceptFileOptions) => boolean; -// @public (undocumented) -export interface AccessorErrorMessage { - // (undocumented) - message: string; -} - -// @public (undocumented) -export type AccessorErrorMessages = [AccessorErrorMessage, ...AccessorErrorMessage[]]; - -// @public (undocumented) -export function AccessorErrors({ accessor, ...errorListProps }: AccessorErrorsProps): ReactElement | null; - -// @public (undocumented) -export interface AccessorErrorsHolder { - // (undocumented) - readonly errors: ErrorAccessor | undefined; -} - -// @public (undocumented) -export interface AccessorErrorsProps extends Omit { - // (undocumented) - accessor: FieldAccessor | EntityAccessor | EntityListAccessor; -} - -// @public (undocumented) -export interface AddEntityButtonProps { - // (undocumented) - addButtonComponent?: ComponentType; - // (undocumented) - addButtonComponentExtraProps?: {}; - // (undocumented) - addButtonProps?: CreateNewEntityButtonProps; - // (undocumented) - addButtonText?: ReactNode; -} - // @internal (undocumented) export const AddNewBlockButton: React.NamedExoticComponent; @@ -387,69 +335,6 @@ export const AudioUploadField: = PublicSingleKindUploadFieldProps & AudioFileDataExtractorProps; -// @public (undocumented) -export const AutoCell: React.NamedExoticComponent; - -// @public (undocumented) -export type AutoCellProps = { - schema: Schema; - entityName: string; - fieldName: string; - createEntityLink?: (entity: string) => RoutingLinkTarget; -}; - -// @public (undocumented) -export const AutoField: React.NamedExoticComponent; - -// @public (undocumented) -export type AutoFieldProps = { - schema: Schema; - entityName: string; - fieldName: string; - createEditLink?: (entity: string) => RoutingLinkTarget; - excludedEntities?: string[]; -}; - -// @public (undocumented) -export const AutoFields: React.NamedExoticComponent; - -// @public (undocumented) -export type AutoFieldsProps = { - createEditLink?: (entity: string) => RoutingLinkTarget; - excludedFields?: string[]; - excludedEntities?: string[]; -}; - -// @public (undocumented) -export const AutoForm: React.NamedExoticComponent; - -// @public (undocumented) -export type AutoFormProps = { - entity: string; - id?: EntityId; - onCreateSuccess?: EntityAccessor.PersistSuccessHandler | Set; - createEditLink?: (entity: string) => RoutingLinkTarget; -}; - -// @public (undocumented) -export const AutoGrid: React.NamedExoticComponent; - -// @public (undocumented) -export type AutoGridProps = DataGridContainerPublicProps & { - entities: DataGridProps['entities']; - createViewLinkTarget?: (entity: string) => RoutingLinkTarget; - createEditLinkTarget?: (entity: string) => RoutingLinkTarget; -}; - -// @public (undocumented) -export const AutoLabel: React.NamedExoticComponent; - -// @public (undocumented) -export type AutoLabelProps = { - field: string; - createLink?: (entity: string) => RoutingLinkTarget; -}; - // @public (undocumented) export const Avatar: FunctionComponent; @@ -463,19 +348,6 @@ export interface AvatarProps { size?: 1 | 2 | 3 | 4 | 5; } -// @public (undocumented) -export type BaseDynamicChoiceField = BaseDynamicChoiceFieldOptions & SelectFuseOptionsProps & { - searchByFields?: ChoiceFieldSearchByFields; - createNewForm?: ReactElement; - lazy?: LazyChoiceFieldSettings; - renderedOptionsLimit?: number; - transformOptions?: (data: ChoiceFieldData.Options, input: string | undefined) => ChoiceFieldData.Options; - sortableBy?: SugaredFieldProps['field']; -}; - -// @public (undocumented) -export type BaseDynamicChoiceFieldOptions = DynamicChoiceFieldOptionProps | DynamicChoiceFieldWithCustomLabelProps | LegacyChoiceFieldWithOptionRenderer; - // @public export const Block: FunctionComponent; @@ -591,33 +463,6 @@ export type BlockRepeaterProps = { // @public (undocumented) export const boldToolbarButton: ToolbarButtonSpec; -// @public -export const BooleanCell: FunctionComponent; - -// @public (undocumented) -export type BooleanCellProps = DataGridColumnPublicProps & BooleanFieldViewProps & { - disableOrder?: boolean; - initialOrder?: DataGridOrderDirection; - initialFilter?: BooleanFilterArtifacts; -}; - -// @public (undocumented) -export const BooleanFieldView: FunctionComponent; - -// @public (undocumented) -export type BooleanFieldViewProps = { - field: SugaredFieldProps['field']; - booleanStyle?: 'yesNo' | 'checkCross' | 'oneZero'; - format?: (date: boolean) => ReactNode; -} & FieldFallbackViewPublicProps; - -// @public (undocumented) -export type BooleanFilterArtifacts = { - includeTrue: boolean; - includeFalse: boolean; - includeNull: boolean; -}; - // @public (undocumented) export type BuiltinEditorPlugins = BuiltinElementBased | BuiltinTextBased; @@ -633,105 +478,6 @@ export const ChangePassword: FC<{}>; // @public (undocumented) export type ChangePasswordErrors = 'TOO_WEAK' | 'NOT_A_PERSON' | 'INVALID_PASSWORD'; -// @public (undocumented) -export const CheckboxField: React.NamedExoticComponent; - -// @public (undocumented) -export type CheckboxFieldProps = SimpleRelativeSingleFieldProps & ControlProps; - -// @public (undocumented) -export const ChoiceField: FunctionComponent; - -// @public (undocumented) -export namespace ChoiceFieldData { - // (undocumented) - export interface BaseChoiceMetadata { - // (undocumented) - data: Options; - // (undocumented) - errors: FieldErrors | undefined; - // (undocumented) - isLoading?: boolean; - // (undocumented) - onAddNew?: () => void; - // (undocumented) - onSearch?: (input: string) => void; - } - // (undocumented) - export interface MultiChoiceFieldProps { - // (undocumented) - children: (metadata: MultipleChoiceFieldMetadata) => ReactElement | null; - } - // (undocumented) - export interface MultipleChoiceFieldMetadata extends BaseChoiceMetadata { - // (undocumented) - currentValues: SingleOption[]; - // (undocumented) - onAdd: (option: SingleOption) => void; - // (undocumented) - onClear: () => void; - // (undocumented) - onMove?: (oldIndex: number, newIndex: number) => void; - // (undocumented) - onRemove: (option: SingleOption) => void; - } - // (undocumented) - export type Options = SingleOption[]; - // (undocumented) - export interface SingleChoiceFieldMetadata extends BaseChoiceMetadata { - // (undocumented) - currentValue: SingleOption | null; - // (undocumented) - onClear: () => void; - // (undocumented) - onSelect: (newValue: SingleOption) => void; - } - // (undocumented) - export interface SingleChoiceFieldProps { - // (undocumented) - children: (metadata: SingleChoiceFieldMetadata) => ReactElement | null; - } - // (undocumented) - export interface SingleOption { - // (undocumented) - description?: ReactNode; - // (undocumented) - key: string; - // (undocumented) - label: ReactNode; - // (undocumented) - searchKeywords: string; - // (undocumented) - value: Value; - } -} - -// @public (undocumented) -export type ChoiceFieldDictionary = typeof choiceFieldDictionary; - -// @public (undocumented) -export const choiceFieldDictionary: { - choiceField: { - createNew: { - confirmButtonText: string; - cancelButtonText: string; - dialogTitle: string; - }; - }; -}; - -// @public (undocumented) -export type ChoiceFieldOptionsAsEntityList = string | (SugaredQualifiedEntityList['entities'] & ForbidKeys) | (SugaredQualifiedEntityList & ForbidKeys); - -// @public (undocumented) -export type ChoiceFieldOptionsAsFieldList = string | (SugaredQualifiedFieldList['fields'] & ForbidKeys) | (SugaredQualifiedFieldList & ForbidKeys); - -// @public (undocumented) -export type ChoiceFieldProps = (ChoiceFieldData.SingleChoiceFieldProps & StaticSingleChoiceFieldProps) | (ChoiceFieldData.SingleChoiceFieldProps & DynamicSingleChoiceFieldProps); - -// @public (undocumented) -export type ChoiceFieldSearchByFields = SugaredRelativeSingleField['field'] | SugaredRelativeSingleField['field'][]; - // @public export const ClearFieldButton: React.NamedExoticComponent; @@ -755,40 +501,9 @@ export type ClearFieldButtonInnerPublicProps = ButtonProps; // @public (undocumented) export type ClearFieldButtonProps = SimpleRelativeSingleFieldProps & ClearFieldButtonInnerPublicProps; -// @public (undocumented) -export const CoalesceFieldView: (props: CoalesceFieldViewProps) => ReactElement; - -// @public (undocumented) -export interface CoalesceFieldViewProps extends FieldFallbackViewPublicProps { - // (undocumented) - fields: (SugarableRelativeSingleField | string)[]; - // (undocumented) - format?: (value: Persisted) => ReactNode; -} - -// @public -export const CoalesceTextCell: FC; - -// @public (undocumented) -export type CoalesceTextCellProps = DataGridColumnPublicProps & FieldFallbackViewPublicProps & CoalesceFieldViewProps & { - initialFilter?: CoalesceTextFilterArtifacts; -}; - -// @public (undocumented) -export type CoalesceTextFilterArtifacts = { - mode: 'matches' | 'matchesExactly' | 'startsWith' | 'endsWith' | 'doesNotMatch'; - query: string; -}; - // @public (undocumented) export const codeToolbarButton: ToolbarButtonSpec; -// @public (undocumented) -export const ColorField: React.NamedExoticComponent; - -// @public (undocumented) -export type ColorFieldProps = SimpleRelativeSingleFieldProps & Omit; - // @public (undocumented) export type CommonFileKindProps = PublicFileKind & FileUrlDataExtractorProps & GenericFileMetadataExtractorProps & { additionalExtractors?: FileDataExtractor[]; @@ -885,25 +600,6 @@ export interface ContentOutletProps { placeholder?: string; } -// @public -export const ControlledDataGrid: (props: ControlledDataGridProps) => ReactElement; - -// @public (undocumented) -export type ControlledDataGridProps = DataGridContainerPublicProps & { - state: DataGridState; - stateMethods: DataGridStateMethods; - dataGridKey?: string; - entities: SugaredQualifiedEntityList['entities']; - children: ReactNode; - itemsPerPage?: number | null; -} & ({} | { - component: ComponentType; - componentProps: ComponentExtraProps; -}); - -// @public (undocumented) -export type ControlValueParser = (value: ControlVal | null | undefined, field: FieldAccessor) => FieldVal | null; - // @public (undocumented) export const CreateApiKeyForm: FC; @@ -976,15 +672,6 @@ export const createEmptyTableRowElement: (columnCount?: number) => { // @public (undocumented) export const createMarkHtmlDeserializer: (markType: string, tagMatcher: (el: HTMLElement) => boolean, attributeMatcher: (el: HTMLElement) => boolean) => HtmlDeserializerPlugin; -// @public (undocumented) -export const CreateNewEntityButton: React.MemoExoticComponent<({ createNewEntity, iconProps, children, ...buttonProps }: CreateNewEntityButtonProps) => JSX.Element>; - -// @public (undocumented) -export type CreateNewEntityButtonProps = ButtonProps & { - createNewEntity: (initialize?: EntityAccessor.BatchUpdatesHandler) => void; - iconProps?: IconProps; -}; - // @public (undocumented) export const CreatePage: PageComponent<({ pageName, children, rendererProps, redirectOnSuccess, onPersistSuccess, ...entityProps }: CreatePageProps) => JSX.Element>; @@ -1076,390 +763,40 @@ export interface CustomFieldBackedElement { element: ReactNode; } -// @public (undocumented) -export interface CustomMarkPlugin { - // (undocumented) - isHotKey: (e: KeyboardEvent) => boolean; - // (undocumented) - render: FunctionComponent; - // (undocumented) - type: string; -} - -// @public (undocumented) -export const cycleOrderDirection: (direction: DataGridOrderDirection) => DataGridOrderDirection; - -// @public (undocumented) -export const DATA_GRID_DEFAULT_ITEMS_PER_PAGE = 50; - -// @public -export const DataGrid: (props: DataGridProps) => ReactElement; - -// @public (undocumented) -export interface DataGridCellPublicProps { - // (undocumented) - canBeHidden?: boolean; - // (undocumented) - hidden?: boolean; - // (undocumented) - justification?: Justification; - // (undocumented) - shrunk?: boolean; -} - -// @public (undocumented) -export type DataGridCellsDictionary = typeof dataGridCellsDictionary; - -// @public (undocumented) -export const dataGridCellsDictionary: { - dataGridCells: { - includeNull: string; - booleanCell: { - includeTrue: string; - includeFalse: string; - includeNull: string; - }; - dateCell: { - fromLabel: string; - toLabel: string; - }; - textCell: { - matches: string; - doesNotMatch: string; - matchesExactly: string; - startsWith: string; - endsWith: string; - queryPlaceholder: string; - includeNull: string; - excludeNull: string; - }; - numberCell: { - equals: string; - greaterThan: string; - lessThan: string; - }; - }; -}; - -// @public -export const DataGridColumn: (props: DataGridColumnProps) => ReactElement; - -// @public (undocumented) -export type DataGridColumnFiltering = { - enableFiltering: false; -} | { - enableFiltering?: true; - initialFilter?: FA; - getNewFilter: GetNewFilter; - emptyFilter: FA; - filterRenderer: ComponentType>; -}; - -// @public (undocumented) -export type DataGridColumnKey = string; - -// @public (undocumented) -export type DataGridColumnOrdering = { - enableOrdering: false; -} | { - enableOrdering?: true; - initialOrder?: DataGridOrderDirection; - getNewOrderBy: GetNewOrderBy; -}; - -// @public (undocumented) -export type DataGridColumnProps = DataGridColumnPublicProps & DataGridColumnFiltering & DataGridColumnOrdering; - -// @public (undocumented) -export type DataGridColumnPublicProps = DataGridHeaderCellPublicProps & DataGridCellPublicProps & { - columnKey?: string; - children?: ReactNode; -}; - -// @public (undocumented) -export type DataGridColumns = Map; - -// @public (undocumented) -export const DataGridContainer: FunctionComponent; - -// @public (undocumented) -export interface DataGridContainerOwnProps extends DataGridContainerPublicProps { - // (undocumented) - desiredState: DataGridState; - // (undocumented) - displayedState: DataGridState; - // (undocumented) - entityName: EntityName; - // (undocumented) - filter: Filter; - // (undocumented) - setFilter: DataGridSetColumnFilter; - // (undocumented) - setIsColumnHidden: DataGridSetIsColumnHidden; - // (undocumented) - setLayout: SetDataGridView; - // (undocumented) - setOrderBy: DataGridSetColumnOrderBy; - // (undocumented) - updatePaging: (action: GridPagingAction) => void; -} - -// @public (undocumented) -export interface DataGridContainerProps extends DataGridContainerOwnProps, EntityListBaseProps { -} - -// @public (undocumented) -export interface DataGridContainerPublicProps { - // (undocumented) - allowAggregateFilterControls?: boolean; - // (undocumented) - allowColumnVisibilityControls?: boolean; - // (undocumented) - emptyMessage?: ReactNode; - // (undocumented) - emptyMessageComponent?: ComponentType; - // (undocumented) - emptyMessageComponentExtraProps?: {}; - // (undocumented) - onEntityClick?: (entity: EntityAccessor) => void; - // (undocumented) - selectedEntityIds?: EntityId[]; - // (undocumented) - tile?: ReactNode; - // (undocumented) - tileSize?: number; -} - -// @public (undocumented) -export type DataGridDictionary = typeof dataGridDictionary; - -// @public (undocumented) -export const dataGridDictionary: { - dataGrid: { - emptyMessage: { - text: string; - }; - columnFiltering: { - showMenuButton: { - text: string; - }; - heading: string; - emptyMessage: { - text: string; - }; - columnColumn: { - text: string; - }; - filterColumn: { - text: string; - }; - addFilterButton: { - text: string; - }; - }; - columnHiding: { - showMenuButton: { - text: string; - }; - heading: string; - }; - paging: { - first: string; - previous: string; - next: string; - last: string; - status: { - unknownPageTotal: string; - knownPageTotal: string; - itemCount: string; - }; - }; - }; -}; - -// @public (undocumented) -export type DataGridFilterArtifact = Serializable; - -// @public (undocumented) -export type DataGridFilterArtifactStore = Record; - -// @public (undocumented) -export function DataGridHeaderCell({ ascOrderIcon, descOrderIcon, emptyFilterArtifact, environment, filterArtifact, filterRenderer, hasFilter, header, headerJustification, orderState, setFilter, setOrderBy, shrunk, }: DataGridHeaderCellProps): ReactElement; - -// @public (undocumented) -export interface DataGridHeaderCellInternalProps { - // (undocumented) - emptyFilterArtifact: DataGridFilterArtifact; - // (undocumented) - environment: Environment; - // (undocumented) - filterArtifact: DataGridFilterArtifact; - // (undocumented) - filterRenderer: ComponentType> | undefined; - // (undocumented) - hasFilter: boolean; - // (undocumented) - orderState: { - direction: Exclude; - index: number | undefined; - } | undefined; - // (undocumented) - setFilter: DataGridSetFilter; - // (undocumented) - setOrderBy: DataGridSetOrderBy; -} - -// @public (undocumented) -export interface DataGridHeaderCellProps extends DataGridHeaderCellInternalProps, DataGridHeaderCellPublicProps { -} - -// @public (undocumented) -export interface DataGridHeaderCellPublicProps { - // (undocumented) - ascOrderIcon?: ReactNode; - // (undocumented) - descOrderIcon?: ReactNode; - // (undocumented) - header?: ReactNode; - // (undocumented) - headerJustification?: Justification; - // (undocumented) - shrunk?: boolean; -} - -// @public (undocumented) -export type DataGridHiddenColumnsStateStore = Record; - -// @public (undocumented) -export type DataGridLayout = Default | 'tiles'; - -// @public (undocumented) -export type DataGridOrderDirection = 'asc' | 'desc' | null; - -// @public (undocumented) -export type DataGridOrderDirectionStore = Record>; - -// @public (undocumented) -export const DataGridPage: PageComponent<({ children, rendererProps, pageName, ...dataGridProps }: DataGridPageProps) => JSX.Element>; - -// @public (undocumented) -export type DataGridPageProps = DataGridProps<{}> & { - pageName?: string; - children?: ReactNode; - rendererProps?: Omit; -}; - -// @public (undocumented) -export const DataGridPageRenderer: React.NamedExoticComponent; - -// @public (undocumented) -export type DataGridPageRendererProps = LayoutRendererProps & DataGridContainerProps; - -// @public (undocumented) -export type DataGridProps = DataGridContainerPublicProps & { - dataGridKey?: string; - entities: SugaredQualifiedEntityList['entities']; - children: ReactNode; - itemsPerPage?: number | null; -} & ({} | { - component: ComponentType; - componentProps: ComponentExtraProps; -}); - -// @public (undocumented) -export const DataGridScope: ({ stateComponent, stateProps, ...props }: DataGridScopeProps) => JSX.Element; - -// @public (undocumented) -export type DataGridScopeProps = PropsWithChildren> & DataBindingProviderStateComponent; - -// @public (undocumented) -export type DataGridSetColumnFilter = (columnKey: DataGridColumnKey, columnFilter: FA | undefined) => void; - -// @public (undocumented) -export type DataGridSetColumnOrderBy = (columnKey: DataGridColumnKey, columnOrderBy: DataGridOrderDirection, 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, 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; +// @public (undocumented) +export interface CustomMarkPlugin { // (undocumented) - setLayout: SetDataGridView; + isHotKey: (e: KeyboardEvent) => boolean; // (undocumented) - setOrderBy: DataGridSetColumnOrderBy; + render: FunctionComponent; // (undocumented) - updatePaging: DispatchChangePage; + type: string; } -// @public -export const DateCell: FunctionComponent; - -// @public (undocumented) -export type DateCellProps = DataGridColumnPublicProps & DateFieldViewProps & { - disableOrder?: boolean; - initialOrder?: DataGridOrderDirection; - initialFilter?: DateRange; -}; - -// @public (undocumented) -export const DateField: React.NamedExoticComponent; - // @public (undocumented) -export type DateFieldProps = SimpleRelativeSingleFieldProps & DateInputProps; +export const DataGridPage: PageComponent<({ children, rendererProps, pageName, ...dataGridProps }: DataGridPageProps) => JSX.Element>; // @public (undocumented) -export const DateFieldView: FunctionComponent; +export type DataGridPageProps = DataGridProps & { + pageName?: string; + children?: ReactNode; + rendererProps?: Omit; +}; // @public (undocumented) -export type DateFieldViewProps = { - field: SugaredFieldProps['field']; -} & ({ - format?: ((date: Date) => ReactNode) | Intl.DateTimeFormatOptions; - locale?: never; -} | { - format?: Intl.DateTimeFormatOptions; - locale: string | string[]; -}) & FieldFallbackViewPublicProps; +export const DataGridPageRenderer: React.NamedExoticComponent | undefined; +} & DataGridTableRowPublicProps & EntityListBaseProps & DataGridTilesPublicProps & DataGridRenderingCommonProps>; // @public (undocumented) -export type DateRange = { - start: string | null; - end: string | null; -}; +export type DataGridPageRendererProps = LayoutRendererProps & DataGridContainerProps; // @public (undocumented) -export const DateTimeField: React.NamedExoticComponent; +export const DataGridScope: ({ stateComponent, stateProps, ...props }: DataGridScopeProps) => JSX.Element; // @public (undocumented) -export type DateTimeFieldProps = SimpleRelativeSingleFieldProps & DateTimeInputProps; +export type DataGridScopeProps = PropsWithChildren> & DataBindingProviderStateComponent; // @public (undocumented) export const DefaultElement: FunctionComponent; @@ -1468,15 +805,6 @@ export const DefaultElement: FunctionComponent; export interface DefaultElementProps extends RenderElementProps { } -// @public -export const DeleteEntityButton: React.MemoExoticComponent<(props: DeleteEntityButtonProps) => JSX.Element | null>; - -// @public (undocumented) -export type DeleteEntityButtonProps = { - immediatePersist?: true; - children?: ReactNode; -} & ButtonProps; - // @public (undocumented) export const DerivedFieldLink: FunctionComponent; @@ -1598,9 +926,6 @@ export type DiscriminatedFileKindsProps = SelectFi baseEntity?: string; }; -// @public (undocumented) -export type DispatchChangePage = (action: GridPagingAction) => void; - // @public (undocumented) export const DisplayTextField: React.NamedExoticComponent; @@ -1612,35 +937,9 @@ export type DisplayTextFieldProps = Omit JSX.Element; -// @public (undocumented) -export type DynamicChoiceFieldOptionProps = { - options: ChoiceFieldOptionsAsFieldList; -}; - -// @public (undocumented) -export type DynamicChoiceFieldWithCustomLabelProps = { - options: ChoiceFieldOptionsAsEntityList; - optionLabel: ReactNode; -}; - -// @public (undocumented) -export const DynamicMultiChoiceField: FunctionComponent>; - -// @public (undocumented) -export type DynamicMultipleChoiceFieldProps = SugaredRelativeEntityList & BaseDynamicChoiceField & ({} | DynamicMultipleChoiceWithConnectingEntityFieldProps); - -// @public (undocumented) -export interface DynamicMultipleChoiceWithConnectingEntityFieldProps { - // (undocumented) - connectingEntityField: string | SugaredRelativeSingleEntity; -} - // @public (undocumented) export type DynamicRequestParameters = RequestParameters; -// @public (undocumented) -export type DynamicSingleChoiceFieldProps = SugaredRelativeSingleEntity & BaseDynamicChoiceField; - // @public (undocumented) export const EditIdentity: FC; @@ -1846,12 +1145,6 @@ export interface ElementWithReference extends Element_2 { referenceId: EntityId; } -// @public (undocumented) -export const EmailField: React.NamedExoticComponent; - -// @public (undocumented) -export type EmailFieldProps = SimpleRelativeSingleFieldProps & Omit; - // @public (undocumented) export interface EmbedHandler { // (undocumented) @@ -1877,57 +1170,6 @@ export const EmbedHandlers: { Spotify: typeof SpotifyEmbedHandler; }; -// @public (undocumented) -export const EmptyMessage: React.MemoExoticComponent<({ children, component, padding, ...rest }: EmptyMessageProps) => JSX.Element>; - -// @public (undocumented) -export type EmptyMessageComponentProps = BoxProps & { - children: ReactNode; -}; - -// @public (undocumented) -export interface EmptyMessageOuterProps { - // (undocumented) - emptyMessage?: ReactNode; - // (undocumented) - emptyMessageComponent?: ComponentType; -} - -// @public (undocumented) -export type EmptyMessageProps> = ComponentProps & ComponentProps & { - children: ReactNode; - component?: C; -}; - -// @public -export const EnumCell: React.NamedExoticComponent; - -// @public (undocumented) -export type EnumCellArtifacts = { - values: string[]; - nullCondition: boolean; -}; - -// @public (undocumented) -export type EnumCellProps = DataGridColumnPublicProps & FieldFallbackViewPublicProps & NullConditionFilterPublicProps & { - field: SugaredFieldProps['field']; - options: Record; - format?: (value: string | null) => ReactNode; - initialFilter?: EnumCellArtifacts; -}; - -// @public (undocumented) -export type ErrorCodeDictionary = typeof errorCodeDictionary; - -// @public (undocumented) -export const errorCodeDictionary: { - errorCodes: { - fieldRequired: string; - notUnique: string; - unknownExecutionError: string; - }; -}; - // @public (undocumented) export function FeedbackRenderer({ accessorTreeState, children }: FeedbackRendererProps): JSX.Element | null; @@ -1942,46 +1184,6 @@ export interface FeedbackRendererProps { // @public (undocumented) export type FieldBackedElement = RichTextFieldBackedElement | PlainTextFieldBackedElement | CustomFieldBackedElement; -// @public (undocumented) -export const FieldFallbackView: FunctionComponent; - -// @public (undocumented) -export interface FieldFallbackViewProps { - // (undocumented) - fallback: ReactNode | undefined; - // (undocumented) - fallbackStyle: FieldFallbackViewStyle | undefined; -} - -// @public (undocumented) -export type FieldFallbackViewPublicProps = Partial; - -// @public (undocumented) -export type FieldFallbackViewStyle = 'n/a' | 'nothing' | 'unknown'; - -// @public (undocumented) -export type FieldValueFormatter = (value: FieldVal | null | undefined, field: FieldAccessor) => ControlVal | null; - -// @public (undocumented) -export type FieldValueRenderer = (value: FV | null | undefined, fieldAccessor: FieldAccessor) => ReactElement; - -// @public (undocumented) -export type FieldViewDictionary = typeof fieldViewDictionary; - -// @public (undocumented) -export const fieldViewDictionary: { - fieldView: { - boolean: { - yes: string; - no: string; - }; - fallback: { - unknown: string; - notAvailable: string; - }; - }; -}; - // @public (undocumented) export interface FileDataExtractor { // (undocumented) @@ -2105,14 +1307,6 @@ export interface FileUrlDataExtractorProps { urlField: SugaredFieldProps['field']; } -// @public (undocumented) -export const FileUrlFieldView: FunctionComponent; - -// @public (undocumented) -export type FileUrlFieldViewProps = { - fileUrlField: SugaredFieldProps['field']; -} & HTMLAnchorElementProps; - // @public (undocumented) export const FillResetPasswordTokenForm: FC; @@ -2122,27 +1316,6 @@ export interface FillResetPasswordTokenFormProps { resetLink: RoutingLinkTarget; } -// @public (undocumented) -export interface FilterRendererProps { - // (undocumented) - environment: Environment; - // (undocumented) - filter: FA; - // (undocumented) - setFilter: DataGridSetFilter; -} - -// @public (undocumented) -export const FloatField: React.NamedExoticComponent; - -// @public (undocumented) -export type FloatFieldProps = SimpleRelativeSingleFieldProps & ControlProps; - -// @public (undocumented) -export type ForbidKeys = { - [K in Exclude]?: never; -}; - // @public (undocumented) export type FormErrors = { [K in keyof V]?: string; @@ -2177,12 +1350,6 @@ export type FullFileKind = In extractors: FileDataExtractor[]; }; -// @public -export const GenericCell: FunctionComponent; - -// @public (undocumented) -export type GenericCellProps = DataGridColumnPublicProps; - // @public (undocumented) export interface GenericFileMetadataExtractorProps { // (undocumented) @@ -2220,12 +1387,6 @@ export type GenericToolbarButton = CommonToolbarButton & { // @public (undocumented) export const getAudioFileDataExtractor: (props: AudioFileDataExtractorProps) => FileDataExtractor; -// @public (undocumented) -export const getColumnFilter: (column: DataGridColumnProps, artifact: DataGridFilterArtifact | undefined, environment: Environment) => Filter | undefined; - -// @public (undocumented) -export const getColumnOrderBy: (columns: DataGridColumns, key: DataGridColumnKey, direction: DataGridOrderDirection, environment: Environment) => OrderBy | undefined; - // @public (undocumented) export const getDiscriminatedBlock: (blocks: NormalizedBlocks, field: FieldAccessor | FieldValue) => ResolvedDiscriminatedDatum | undefined; @@ -2241,24 +1402,6 @@ export const getGenericFileMetadataExtractor: (props: GenericFileMetadataExtract // @public (undocumented) export const getImageFileDataExtractor: (props: ImageFileDataExtractorProps) => FileDataExtractor; -// @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 const getStockAnyFileKind: ({ additionalExtractors, acceptMimeTypes, acceptFile, baseEntity, children, fileSizeField, fileTypeField, lastModifiedField, fileNameField, renderFilePreview, renderUploadedFile, uploader, urlField, childrenOutsideBaseEntity, }: StockAnyFileKindProps) => FullFileKind; @@ -2283,7 +1426,7 @@ export const getVideoFileDataExtractor: (props: VideoFileDataExtractorProps) => // @public (undocumented) export namespace GQLVariable { const // (undocumented) - Json: GQLVariableType, false>; + Json: GQLVariableType, false>; const // (undocumented) String: GQLVariableType; const // (undocumented) @@ -2311,52 +1454,9 @@ export type GQLVariableValues>]?: VariableMap[K] extends GQLVariableType ? Value : never; }; -// @public (undocumented) -export type GridPagingAction = { - type: 'goToPage'; - newPageIndex: number; -} | { - type: 'setItemsPerPage'; - newItemsPerPage: number | null; -} | { - type: 'goToNextPage' | 'goToPreviousPage' | 'goToFirstPage'; -}; - -// @public (undocumented) -export type GridPagingState = { - pageIndex: number; - itemsPerPage: number | null; -}; - // @public (undocumented) export type HandleIdpResponseError = SignInIDPErrors | 'INVALID_LOCAL_STATE'; -// @public -export const HasManyAbsentCell: FunctionComponent; - -// @public (undocumented) -export type HasManyAbsentCellProps = DataGridColumnPublicProps & FieldFallbackViewPublicProps & SugaredRelativeEntityList & { - render: ComponentType; - children: ReactNode; -}; - -// @public -export const HasManySelectCell: FunctionComponent; - -// @public (undocumented) -export type HasManySelectProps = DataGridColumnPublicProps & SugaredRelativeEntityList & BaseDynamicChoiceField & FieldFallbackViewPublicProps & SugaredRelativeSingleEntity & { - renderElements?: (elements: ReactNode[]) => ReactElement; - initialFilter?: SelectCellArtifacts; -}; - -// @public -export const HasOneSelectCell: FunctionComponent; - -// @public (undocumented) -export type HasOneSelectProps = DataGridColumnPublicProps & BaseDynamicChoiceField & FieldFallbackViewPublicProps & SugaredRelativeSingleEntity & { - initialFilter?: SelectCellArtifacts; -}; - // @public (undocumented) export const HasRole: React.NamedExoticComponent; @@ -2436,14 +1536,6 @@ export const headingTwoNumberedToolbarButton: ElementToolbarButton; -// @public -export const HiddenField: React.NamedExoticComponent; - -// @public (undocumented) -export type HiddenFieldProps = FieldBasicProps & { - label?: ReactNode; -}; - // @public (undocumented) export const highlightToolbarButton: ToolbarButtonSpec; @@ -2551,23 +1643,6 @@ export interface HtmlDeserializerPlugin { // @public (undocumented) export type HybridFileKindProps = DiscriminatedFileKindsProps | SingleKindFileProps; -// @public (undocumented) -export class I18nError extends Error { -} - -// @public (undocumented) -export function I18nProvider({ localeCode, dictionaries, children }: I18nProviderProps): JSX.Element; - -// @public (undocumented) -export interface I18nProviderProps { - // (undocumented) - children: ReactNode; - // (undocumented) - dictionaries: MessageDictionaryByLocaleCode | undefined; - // (undocumented) - localeCode: string | undefined; -} - // @public (undocumented) export interface Identity { // @deprecated (undocumented) @@ -2693,17 +1768,6 @@ export type IDPResponseState = { error: HandleIdpResponseError; }; -// @public (undocumented) -export const ImageFieldView: (props: ImageFieldViewProps) => ReactElement; - -// @public (undocumented) -export type ImageFieldViewProps = { - srcField: SugaredFieldProps['field']; - altField?: SugaredFieldProps['field']; - titleField?: SugaredFieldProps['field']; - formatUrl?: (srcFieldValue: SrcField) => string; -} & FieldFallbackViewPublicProps & Omit; - // @public (undocumented) export interface ImageFileDataExtractorProps { // (undocumented) @@ -2953,18 +2017,6 @@ export type LabeledProps = { children?: string | null | undefined; }; -// @public (undocumented) -export type LabelMiddleware = (label: ReactNode, environment: Environment) => ReactNode; - -// @public (undocumented) -export const LabelMiddlewareContext: React.Context; - -// @public (undocumented) -export const LabelMiddlewareProvider: ({ value, children }: { - value: LabelMiddleware; - children: ReactChild; -}) => JSX.Element; - // @public (undocumented) export const LayoutRenderer: FunctionComponent; @@ -2972,27 +2024,9 @@ export const LayoutRenderer: FunctionComponent; export interface LayoutRendererProps extends LayoutPageProps { } -// @public (undocumented) -export type LazyChoiceFieldSettings = undefined | boolean | { - limit?: number; - initialLimit?: number; - createFilter?: (input: string) => Filter; - inputDebounceDelay?: number; -}; - // @public (undocumented) export type LazyPageModule = () => Promise; -// @public @deprecated (undocumented) -export interface LegacyChoiceFieldWithOptionRenderer { - // (undocumented) - options: string | SugaredQualifiedEntityList['entities'] | SugaredQualifiedEntityList; - // (undocumented) - optionsStaticRender: ReactElement | ((environment: Environment) => ReactElement); - // (undocumented) - renderOption: (entityAccessor: EntityAccessor) => ReactNode; -} - // @public (undocumented) export const LegacyDeprecatedEditorFormerlyKnownAsRichTextField: FunctionComponent; @@ -3113,27 +2147,6 @@ export interface ListUserQueryResult { memberships: Membership[]; } -// @public (undocumented) -export const LocationField: FunctionComponent; - -// @public (undocumented) -export interface LocationFieldProps extends Omit { - // (undocumented) - latitudeField: SugaredFieldProps['field']; - // (undocumented) - longitudeField: SugaredFieldProps['field']; - // (undocumented) - mapCenter?: [number, number]; - // (undocumented) - mapProps?: MapContainerProps; - // (undocumented) - markerProps?: MarkerProps; - // (undocumented) - tileLayerProps?: Partial; - // (undocumented) - zoom?: number; -} - // @public (undocumented) export const Login: ({ onLogin, resetLink }: LoginProps) => JSX.Element; @@ -3273,79 +2286,24 @@ export interface MeResponse { otpEnabled: boolean; }; projects: Array<{ - project: { - slug: string; - name: string; - }; - memberships: Array<{ - role: string; - variables: Array<{ - name: string; - values: string[]; - }>; - }>; - }>; - permissions: { - canCreateProject: boolean; - }; - }; -} - -// @public (undocumented) -export interface MessageDictionary { - // (undocumented) - [Key: string]: MessageDictionary | string; -} - -// @public (undocumented) -export interface MessageDictionaryByLocaleCode { - // (undocumented) - [localeCode: string]: MessageDictionary; -} - -// @public (undocumented) -export type MessageDictionaryKeys = { - [Key in keyof Dict & string]: Dict[Key] extends MessageDictionary ? `${Key}.${MessageDictionaryKeys2}` : Key; -}[keyof Dict & string]; - -// @public (undocumented) -export type MessageDictionaryKeys2 = { - [Key in keyof Dict & string]: Dict[Key] extends MessageDictionary ? `${Key}.${MessageDictionaryKeys3}` : Key; -}[keyof Dict & string]; - -// @public (undocumented) -export type MessageDictionaryKeys3 = { - [Key in keyof Dict & string]: Dict[Key] extends MessageDictionary ? `${Key}.${MessageDictionaryKeys4}` : Key; -}[keyof Dict & string]; - -// @public (undocumented) -export type MessageDictionaryKeys4 = { - [Key in keyof Dict & string]: Dict[Key] extends MessageDictionary ? `${Key}.${MessageDictionaryKeys5}` : Key; -}[keyof Dict & string]; - -// @public (undocumented) -export type MessageDictionaryKeys5 = { - [Key in keyof Dict & string]: Dict[Key] extends MessageDictionary ? string : Key; -}[keyof Dict & string]; - -// @public (undocumented) -export interface MessageFormatter { - // (undocumented) - (key: MessageDictionaryKeys, values?: Record): string; - // (undocumented) - (key: MessageDictionaryKeys, values?: Record): ReactNode; - // (undocumented) - (userSpecifiedKey: string | undefined, fallbackKey: MessageDictionaryKeys, values?: Record): string; - // (undocumented) - (userSpecifiedKey: U, fallbackKey: MessageDictionaryKeys, values?: Record): U | string; + project: { + slug: string; + name: string; + }; + memberships: Array<{ + role: string; + variables: Array<{ + name: string; + values: string[]; + }>; + }>; + }>; + permissions: { + canCreateProject: boolean; + }; + }; } -// @public (undocumented) -export type MessageFormatterFormatJSXChunk = (parts: ReactNode) => ReactNode; - -// @public (undocumented) -export type MessageFormatterPrimitiveType = string | number | boolean | null | undefined | Date; - // @public (undocumented) export const MiscPageLayout: React.NamedExoticComponent; @@ -3375,28 +2333,6 @@ export type MultiEditScopeProps, 'accessor' | 'children'>; }; -// @public (undocumented) -export const MultiSelectField: FunctionComponent; - -// @internal (undocumented) -export const MultiSelectFieldInner: ({ currentValues, data, errors, onAdd, onClear, onRemove, reactSelectProps, placeholder, menuZIndex, onAddNew, onMove, onSearch, isLoading, ...fieldContainerProps }: MultiSelectFieldInnerProps) => JSX.Element; - -// @public (undocumented) -export type MultiSelectFieldInnerProps = ChoiceFieldData.MultipleChoiceFieldMetadata & MultiSelectFieldInnerPublicProps & PublicCommonReactSelectStylesProps & { - errors: FieldErrors | undefined; -}; - -// @public (undocumented) -export interface MultiSelectFieldInnerPublicProps extends Omit { - // (undocumented) - placeholder?: string; - // (undocumented) - reactSelectProps?: Partial>; -} - -// @public (undocumented) -export type MultiSelectFieldProps = MultiSelectFieldInnerPublicProps & DynamicMultipleChoiceFieldProps; - // @public (undocumented) export const MutableEntityListPageRenderer: (props: MutableEntityListPageRendererProps) => ReactElement; @@ -3464,70 +2400,6 @@ export type NormalizedDiscriminatedData = Map; -// @public (undocumented) -export interface NormalizedStaticOption extends StaticOption { - // (undocumented) - searchKeywords: string; - // (undocumented) - value: FieldValue; -} - -// @public (undocumented) -export const NotFoundWrapper: React.NamedExoticComponent<{ - children: ReactNode; - title?: ReactNode; -}>; - -// @public (undocumented) -export type NullConditionArtifacts = { - nullCondition: boolean; -}; - -// @public (undocumented) -export const NullConditionFilter: ({ filter, setFilter, field, environment, showNullConditionFilter }: NullConditionFilterProps) => JSX.Element | null; - -// @public (undocumented) -export type NullConditionFilterProps = FilterRendererProps & NullConditionFilterPublicProps & { - field: SugaredFieldProps['field']; -}; - -// @public (undocumented) -export type NullConditionFilterPublicProps = { - showNullConditionFilter?: boolean; -}; - -// @public -export const NumberCell: FunctionComponent; - -// @public (undocumented) -export type NumberCellProps = DataGridHeaderCellPublicProps & DataGridCellPublicProps & FieldFallbackViewPublicProps & SugaredRelativeSingleField & NullConditionFilterPublicProps & { - disableOrder?: boolean; - initialOrder?: DataGridOrderDirection; - format?: (value: number) => ReactNode; - initialFilter?: NumberFilterArtifacts; -}; - -// @public (undocumented) -export const NumberField: React.NamedExoticComponent; - -// @public (undocumented) -export type NumberFieldProps = SimpleRelativeSingleFieldProps & ControlProps; - -// @public (undocumented) -export type NumberFilterArtifacts = { - mode: 'eq' | 'gte' | 'lte'; - query: number | null; - nullCondition: boolean; -}; - -// @public (undocumented) -export interface OptionallyVariableStaticOption extends StaticOption { - // (undocumented) - searchKeywords?: string; - // (undocumented) - value: OptionallyVariableFieldValue; -} - // @public (undocumented) export interface OrderedListElement extends Element_2 { // (undocumented) @@ -3602,11 +2474,6 @@ export const PageLink: React.NamedExoticComponent; // @public @deprecated (undocumented) export const PageLinkButton: React.NamedExoticComponent; -// Warning: (ae-forgotten-export) The symbol "PageLinkByIdProps" needs to be exported by the entry point index.d.ts -// -// @public @deprecated (undocumented) -export const PageLinkById: React.NamedExoticComponent; - // @public (undocumented) export interface PageModule { // (undocumented) @@ -3717,34 +2584,6 @@ export const PersistButton: React.MemoExoticComponent; -// @public (undocumented) -export type PersistFeedbackDictionary = typeof persistFeedbackDictionary; - -// @public (undocumented) -export const persistFeedbackDictionary: { - persistFeedback: { - successMessage: string; - afterPersistErrorMessage: string; - errorMessage: string; - }; -}; - -// @public (undocumented) -export interface PersistWithFeedbackOptions extends PersistOptions { - // (undocumented) - afterPersistErrorDuration?: number; - // (undocumented) - afterPersistErrorMessage?: string; - // (undocumented) - errorDuration?: number; - // (undocumented) - errorMessage?: string; - // (undocumented) - successDuration?: number; - // (undocumented) - successMessage?: string; -} - // @public (undocumented) export interface Person { // (undocumented) @@ -3851,8 +2690,6 @@ export type ProjectUserRoles = Set; // @public (undocumented) export type PublicAnchorProps = Omit, 'href'>; -export { PublicCommonReactSelectStylesProps } - // @public (undocumented) export type PublicFileKind = Partial>; @@ -3880,37 +2717,9 @@ export interface QueryRequestObject { // @public (undocumented) export type QueryRequestState = RequestStateOk | RequestStateError | RequestStateLoading; -// @public (undocumented) -export const RadioField: FunctionComponent; - -// @public (undocumented) -export const RadioFieldInner: React.MemoExoticComponent<(props: RadioFieldInnerProps) => JSX.Element>; - -// @public (undocumented) -export interface RadioFieldInnerProps extends ChoiceFieldData.SingleChoiceFieldMetadata, RadioFieldInnerPublicProps { - // (undocumented) - errors: FieldErrors | undefined; -} - -// @public (undocumented) -export interface RadioFieldInnerPublicProps extends Omit, Pick { -} - -// @public (undocumented) -export type RadioFieldProps = RadioFieldInnerPublicProps & (StaticSingleChoiceFieldProps | SimpleDynamicSingleChoiceFieldProps); - // @public (undocumented) export type ReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void; -// @public (undocumented) -export function readEventStream(lines: AsyncIterable): AsyncIterable<{ - data: string; - lastEventId?: string; -}>; - -// @public (undocumented) -export function readLines(reader: ReadableStreamDefaultReader): AsyncIterable; - // @public (undocumented) export type RedirectOnSuccessHandler = (currentState: PageRequest, persistedId: EntityId, entity: EntityAccessor, options: PersistSuccessOptions) => IncompleteRequestState | string | undefined; @@ -3964,15 +2773,6 @@ export const renderAudioFilePreview: ({ objectUrl }: RenderFilePreviewOptions) = // @public (undocumented) export const renderByJoining: SelectedDimensionRenderer; -// @public (undocumented) -export type RenderedSimpleRelativeSingleFieldProxyExtraPropsKeys = 'className' | 'style'; - -// @public (undocumented) -export type RenderedSimpleRelativeSingleFieldProxyFieldContainerPropsKeys = 'required' | 'size' | 'errors'; - -// @public (undocumented) -export type RenderedSugaredRelativeSingleFieldKeys = 'field'; - // @public (undocumented) export interface RenderFilePreviewOptions { // (undocumented) @@ -4443,18 +3243,6 @@ export interface ScrollTargetRendererProps extends Omit; -// @public (undocumented) -export const SearchField: React.NamedExoticComponent; - -// @public (undocumented) -export type SearchFieldProps = SimpleRelativeSingleFieldProps & Omit; - -// @public (undocumented) -export type SelectCellArtifacts = { - id: EntityId[]; - nullCondition: boolean; -}; - // @public (undocumented) export interface SelectedDimension { // (undocumented) @@ -4464,42 +3252,6 @@ export interface SelectedDimension { // @public (undocumented) export type SelectedDimensionRenderer = (dimensionData: StatefulDimensionDatum[]) => ReactNode; -// @public (undocumented) -export interface SelectEntityButtonProps { - // (undocumented) - selectButtonComponent?: ComponentType; - // (undocumented) - selectButtonComponentExtraProps?: {}; - // (undocumented) - selectButtonProps?: CreateNewEntityButtonProps; - // (undocumented) - selectButtonText?: ReactNode; -} - -// @public (undocumented) -export const SelectField: FunctionComponent; - -// @internal (undocumented) -export const SelectFieldInner: React.MemoExoticComponent<({ placeholder, allowNull, currentValue, data, errors, menuZIndex, onSelect, onClear, reactSelectProps, onAddNew, onSearch, isLoading, ...fieldContainerProps }: SelectFieldInnerProps) => JSX.Element>; - -// @public (undocumented) -export type SelectFieldInnerProps = ChoiceFieldData.SingleChoiceFieldMetadata & SelectFieldInnerPublicProps & PublicCommonReactSelectStylesProps & { - errors: FieldErrors | undefined; -}; - -// @public (undocumented) -export interface SelectFieldInnerPublicProps extends Omit { - // (undocumented) - allowNull?: boolean; - // (undocumented) - placeholder?: string; - // (undocumented) - reactSelectProps?: Partial>; -} - -// @public (undocumented) -export type SelectFieldProps = SelectFieldInnerPublicProps & (StaticSingleChoiceFieldProps | DynamicSingleChoiceFieldProps); - // @public (undocumented) export type SelectFileInputPublicProps = SelectEntityButtonProps & { insertSelectedText?: string; @@ -4515,12 +3267,6 @@ export interface SelectFileInputSelectionComponentProps fileSelectionProps?: SFExtraProps; } -// @public (undocumented) -export interface SelectFuseOptionsProps { - // (undocumented) - fuseOptions?: Fuse_2.IFuseOptions> | boolean; -} - // @public (undocumented) export interface SerializableEditorNode { // (undocumented) @@ -4529,9 +3275,6 @@ export interface SerializableEditorNode { formatVersion: number; } -// @public (undocumented) -export type SetDataGridView = (layout: DataGridLayout) => void; - // @public (undocumented) export class SideDimensions extends PureComponent { // (undocumented) @@ -4635,74 +3378,11 @@ export interface SignOutResponseOk { }; } -// @public (undocumented) -export type SimpleDynamicSingleChoiceFieldProps = SugaredRelativeSingleEntity & BaseDynamicChoiceFieldOptions & Pick; - -// @public (undocumented) -export const SimpleRelativeSingleField:

(render: (fieldMetadata: SimpleRelativeSingleFieldMetadata, props: SimpleRelativeSingleFieldProxyExcludeHandledProps

) => ReactNode, displayName: string, defaultProps?: Partial

| undefined) => NamedExoticComponent

; - -// @public (undocumented) -export interface SimpleRelativeSingleFieldMetadata { - // (undocumented) - environment: Environment; - // (undocumented) - field: FieldAccessor; - // (undocumented) - isMutating: boolean; -} - -// @public (undocumented) -export type SimpleRelativeSingleFieldProps = SimpleRelativeSingleFieldProxyProps; - -// @internal (undocumented) -export const SimpleRelativeSingleFieldProxy: React.MemoExoticComponent<({ render, defaultValue, isNonbearing, onBeforeUpdate, onInitialize, onUpdate, description, display, direction, evenly, horizontal, gap, label, labelDescription, labelPosition, reverse, useLabelElement, width, className, style, errors, field: fieldName, required, size, containerClassName, containerStyle, suppressErrors, ...rest }: SimpleRelativeSingleFieldProxyProps & SimpleRelativeSingleFieldProxyRendererProps) => JSX.Element>; - -// @public (undocumented) -export type SimpleRelativeSingleFieldProxyExcludeHandledProps

= Omit | Exclude | Exclude>; - -// @public (undocumented) -export type SimpleRelativeSingleFieldProxyExtraProps = { - className?: string | undefined; - containerClassName?: string | undefined; - containerStyle?: CSSProperties | undefined; - style?: CSSProperties | undefined; - suppressErrors?: boolean | undefined; -}; - -// @public (undocumented) -export type SimpleRelativeSingleFieldProxyFieldContainerProps = Omit; - -// @public (undocumented) -export type SimpleRelativeSingleFieldProxyProps = SimpleRelativeSingleFieldProxyFieldContainerProps & SugaredRelativeSingleField & SimpleRelativeSingleFieldProxyExtraProps; - -// @public (undocumented) -export type SimpleRelativeSingleFieldProxyRendererProps = { - render: (fieldMetadata: SimpleRelativeSingleFieldMetadata, props: SimpleRelativeSingleFieldProxyExcludeHandledProps) => ReactNode; -}; - // @public (undocumented) export type SingleKindFileProps = FullFileKind & SelectFileInputSelectionComponentProps & { hasUploadedFile: (entity: EntityAccessor) => boolean; }; -// @public (undocumented) -export const SlugField: React.NamedExoticComponent; - -// @public (undocumented) -export const SlugFieldInner: React.NamedExoticComponent; - -// @public (undocumented) -export type SlugFieldProps = SimpleRelativeSingleFieldProps & ControlProps & { - derivedFrom: SugaredRelativeSingleField['field']; - unpersistedHardPrefix?: SlugPrefix; - persistedHardPrefix?: SlugPrefix; - persistedSoftPrefix?: SlugPrefix; - linkToExternalUrl?: boolean; -}; - -// @public (undocumented) -export type SlugPrefix = string | ((environment: Environment) => string); - // @internal (undocumented) export const SortableBlock: React.NamedExoticComponent; @@ -4754,22 +3434,6 @@ export interface StatefulDimensionDatum ex isSelected: IsSelected; } -// @public (undocumented) -export interface StaticOption { - // (undocumented) - description?: ReactNode; - // (undocumented) - label: ReactNode; -} - -// @public (undocumented) -export const StaticSingleChoiceField: FunctionComponent>; - -// @public (undocumented) -export type StaticSingleChoiceFieldProps = SugaredRelativeSingleField & SelectFuseOptionsProps & { - options: OptionallyVariableStaticOption[]; -}; - // @public (undocumented) export type StockAnyFileKindProps = CommonFileKindProps; @@ -4894,45 +3558,12 @@ export interface TenantMutationOkResponse { // @public (undocumented) export type TenantMutationResponse = TenantMutationErrorResponse | TenantMutationOkResponse; -// @public @deprecated (undocumented) -export const TextAreaField: React.NamedExoticComponent; - -// @public -export const TextareaField: React.NamedExoticComponent; - -// @public (undocumented) -export type TextareaFieldProps = Omit & ControlProps & TextareaInputProps; - // @public (undocumented) export interface TextAttrs { // (undocumented) [key: string]: any; } -// @public -export const TextCell: FunctionComponent; - -// @public (undocumented) -export type TextCellProps = DataGridColumnPublicProps & FieldFallbackViewPublicProps & SugaredRelativeSingleField & { - disableOrder?: boolean; - initialOrder?: DataGridOrderDirection; - format?: (value: string | null) => ReactNode; - initialFilter?: TextFilterArtifacts; -}; - -// @public -export const TextField: React.NamedExoticComponent; - -// @public (undocumented) -export type TextFieldProps = SimpleRelativeSingleFieldProps & ControlProps; - -// @public (undocumented) -export type TextFilterArtifacts = { - mode: 'matches' | 'matchesExactly' | 'startsWith' | 'endsWith' | 'doesNotMatch'; - query: string; - nullCondition: boolean; -}; - // @public (undocumented) export type TextSpecifics = Omit; @@ -4947,12 +3578,6 @@ export const TileList: ({ children }: { // @public (undocumented) export type TileProps = BoxOwnProps; -// @public (undocumented) -export const TimeField: React.NamedExoticComponent; - -// @public (undocumented) -export type TimeFieldProps = SimpleRelativeSingleFieldProps & TimeInputProps; - // @public (undocumented) export type ToolbarButtonSpec = ElementToolbarButton | MarkToolbarButton | InitializeReferenceToolbarButton | GenericToolbarButton; @@ -5044,18 +3669,6 @@ export type UploadFieldProps = FileInputPublicProp children?: ReactNode; }; -// @public (undocumented) -export const UrlField: React.NamedExoticComponent; - -// @public (undocumented) -export type UrlFieldProps = SimpleRelativeSingleFieldProps & Omit; - -// @public (undocumented) -export const useAccessorErrorFormatter: () => (errors: ErrorAccessor.Error[]) => AccessorErrorMessage[]; - -// @public (undocumented) -export const useAccessorErrors: (accessor: AccessorErrorsHolder) => AccessorErrorMessages | undefined; - // @public (undocumented) export const useAuthedContentMutation: (query: string) => UseMutationReturn; @@ -5102,13 +3715,6 @@ export const useConfirmOtp: () => TenantMutationExecutor; }>, TenantMutationResponse>; -// @public (undocumented) -export type UseControlProps = ControlProps & { - fieldMetadata: SimpleRelativeSingleFieldMetadata; - parse: ControlValueParser; - format: FieldValueFormatter; -}; - // @public (undocumented) export const useCreateApiKey: () => TenantMutationExecutor; @@ -5145,24 +3751,12 @@ email: GQLVariableType; // @public (undocumented) export const useCurrentRequest: () => RequestState; -// @public (undocumented) -export const useDataGrid: (props: DataGridProps) => ControlledDataGridProps; - -// @public (undocumented) -export const useDataGridState: (props: Pick, 'children' | 'itemsPerPage' | 'entities' | 'dataGridKey' | 'tile'>) => [DataGridState, DataGridStateMethods]; - // @public (undocumented) export const useDisableOtp: () => TenantMutationExecutor, TenantMutationResponse>; // @public (undocumented) export const useDiscriminatedData: (source: Iterable) => NormalizedDiscriminatedData; -// @public (undocumented) -export const useDynamicMultipleChoiceField: (props: DynamicMultipleChoiceFieldProps) => ChoiceFieldData.MultipleChoiceFieldMetadata; - -// @public (undocumented) -export const useDynamicSingleChoiceField: (props: DynamicSingleChoiceFieldProps) => ChoiceFieldData.SingleChoiceFieldMetadata; - // @public (undocumented) export const useEditor: () => Editor; @@ -5174,17 +3768,9 @@ export const useFetchMe: () => () => Promise<{ data: MeResponse; }>; -// @public (undocumented) -export const useFieldControl: ({ fieldMetadata, parse, format, onBlur, ...props }: UseControlProps) => NonOptionalControlProps & { - ref: Ref; -}; - // @public (undocumented) export const useForm: (initialValues: V, handler?: FormHandler | undefined) => FormMethods; -// @public (undocumented) -export const useGridPagingState: (itemsPerPage: number | null, dataGridKey: string) => [GridPagingState, DispatchChangePage]; - // @public (undocumented) export const useHandleIDPResponse: ({ onLogin, onError }: UseHandleIDPResponseProps) => IDPResponseState; @@ -5239,9 +3825,6 @@ method: GQLVariableType; mailVariant: GQLVariableType; }>, TenantMutationResponse>; -// @public (undocumented) -export const useLabelMiddleware: () => (it: ReactNode) => ReactNode; - // @public (undocumented) export const useListMembersQuery: (projectSlug: string, memberType: ListMembersQueryVariables['memberType']) => QueryRequestObject; @@ -5263,9 +3846,6 @@ export const useLogout: () => ({ noRedirect }?: { noRedirect?: boolean | undefined; }) => Promise; -// @public (undocumented) -export const useMessageFormatter: (defaultDictionary: Dict) => MessageFormatter; - // @public (undocumented) export const useMutation: >(client: GraphQlClient, query: string, apiToken?: string, headers?: Record) => UseMutationReturn; @@ -5286,9 +3866,6 @@ export type UseOnPersistSuccessProps = Pick Identity | undefined; -// @public (undocumented) -export const usePersistWithFeedback: ({ successMessage, successDuration, errorMessage, errorDuration, afterPersistErrorMessage, afterPersistErrorDuration, ...persistOptions }?: PersistWithFeedbackOptions) => () => Promise; - // @public (undocumented) export const usePrepareOtp: () => TenantMutationExecutor; @@ -5463,16 +4040,6 @@ export interface VariableSelectorProps { variable: RoleVariableDefinition; } -// @public (undocumented) -export const VideoFieldView: (props: VideoFieldViewProps) => ReactElement; - -// @public (undocumented) -export type VideoFieldViewProps = { - srcField: SugaredFieldProps['field']; - titleField?: SugaredFieldProps['field']; - formatUrl?: (srcFieldValue: SrcField) => string; -} & FieldFallbackViewPublicProps & Omit; - // @public (undocumented) export interface VideoFileDataExtractorProps { // (undocumented) @@ -5617,8 +4184,15 @@ export const withTables: (editor: E) => E; export const withUnderline: (editor: E) => E; -export * from "@contember/binding"; +export * from "@contember/react-auto"; +export * from "@contember/react-binding"; +export * from "@contember/react-binding-ui"; +export * from "@contember/react-choice-field-ui"; export * from "@contember/react-client"; +export * from "@contember/react-datagrid-ui"; +export * from "@contember/react-form-fields-ui"; +export * from "@contember/react-i18n"; +export * from "@contember/react-leaflet-fields-ui"; export * from "@contember/ui"; // Warnings were encountered during analysis: diff --git a/build/api/binding.api.md b/build/api/binding.api.md index feb595aa51..0fbf51cafb 100644 --- a/build/api/binding.api.md +++ b/build/api/binding.api.md @@ -4,7 +4,6 @@ ```ts -import { ComponentType } from 'react'; import type { CrudQueryBuilder } from '@contember/client'; import { EmbeddedActionsParser } from 'chevrotain'; import { v4 as generateUuid } from 'uuid'; @@ -14,71 +13,10 @@ import type { GraphQlClientFailedRequestMetadata } from '@contember/client'; import type { GraphQlClientRequestOptions } from '@contember/client'; import { GraphQlLiteral } from '@contember/client'; import { Input } from '@contember/client'; -import { NamedExoticComponent } from 'react'; -import { PropsWithChildren } from 'react'; -import { ReactElement } from 'react'; -import { ReactNode } from 'react'; import type { Result } from '@contember/client'; import { TokenType } from 'chevrotain'; import type { TreeFilter } from '@contember/client'; -// @public (undocumented) -export function AccessorProvider(props: EntityProviderProps): JSX.Element; - -// @public (undocumented) -export const AccessorTree: { - ({ state, children }: AccessorTreeProps): JSX.Element; - displayName: string; -}; - -// @public (undocumented) -export interface AccessorTreeProps { - // (undocumented) - children: ReactNode; - // (undocumented) - state: AccessorTreeState; -} - -// @public (undocumented) -export type AccessorTreeState = InitializingAccessorTreeState | InitializedAccessorTreeState | ErrorAccessorTreeState; - -// @public (undocumented) -export type AccessorTreeStateAction = { - type: 'setData'; - data: TreeRootAccessor; - binding: DataBinding; -} | { - type: 'failWithError'; - error: RequestError; - binding: DataBinding; -} | { - type: 'reset'; - binding: DataBinding; - environment: Environment; -}; - -// @public (undocumented) -export interface AccessorTreeStateMetadata { - // (undocumented) - initialize: (() => void) | undefined; -} - -// @public (undocumented) -export interface AccessorTreeStateOptions { - // (undocumented) - children?: ReactNode; - // (undocumented) - refreshOnPersist?: boolean; - // (undocumented) - skipStateUpdateAfterPersist?: boolean; -} - -// @public (undocumented) -export const accessorTreeStateReducer: (previousState: AccessorTreeState, action: AccessorTreeStateAction) => AccessorTreeState; - -// @public (undocumented) -export const addEntityAtIndex: (entityList: EntityListAccessor, sortableByField: RelativeSingleField, index: number, preprocess?: EntityAccessor.BatchUpdatesHandler) => void; - // @public (undocumented) export type Alias = string; @@ -143,34 +81,17 @@ export class BindingError extends Error { } // @public (undocumented) -export interface BindingOperations extends AsyncBatchUpdatesOptions { +export interface BindingOperations extends AsyncBatchUpdatesOptions { // (undocumented) batchDeferredUpdates: (performUpdates: (bindingOperations: BatchUpdatesOptions) => void) => void; // (undocumented) - extendTree: ExtendTree; + extendTree: ExtendTree; // (undocumented) getTreeFilters: () => TreeFilter[]; // (undocumented) persist: Persist; } -// @public (undocumented) -export function BindingOperationsProvider(props: BindingOperationsProviderProps): JSX.Element; - -// @public (undocumented) -export interface BindingOperationsProviderProps { - // (undocumented) - bindingOperations: BindingOperations | undefined; - // (undocumented) - children: ReactNode; -} - -// @public (undocumented) -export interface BranchMarkerProvider { - // (undocumented) - generateBranchMarker: (props: Props, fields: EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer, environment: Environment) => HasOneRelationMarker | HasManyRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker; -} - // @public (undocumented) export class ClientGeneratedUuid implements RuntimeIdSpec { constructor(value: string); @@ -183,73 +104,38 @@ export class ClientGeneratedUuid implements RuntimeIdSpec { } // @public (undocumented) -export type CompleteMarkerProvider = EnvironmentDeltaProvider & LeafMarkerProvider & BranchMarkerProvider & StaticRenderProvider; - -// @public (undocumented) -export function Component(statelessRender: EnvironmentAwareFunctionComponent, displayName?: string): NamedExoticComponent; - -// @public (undocumented) -export function Component(statefulRender: EnvironmentAwareFunctionComponent, staticRender: (props: StaticRenderProviderProps, environment: Environment) => ReactElement | null, displayName?: string): NamedExoticComponent; - -// @public (undocumented) -export function Component(statefulRender: EnvironmentAwareFunctionComponent, markerProvisions: MarkerProvider, displayName?: string): NamedExoticComponent; +export class Config { + constructor(config?: Partial); + // (undocumented) + getValue(name: Name): BindingConfig[Name]; + // (undocumented) + setValue(name: Name, value: BindingConfig[Name]): this; +} // @public (undocumented) -export class DataBinding { - // Warning: (ae-forgotten-export) The symbol "TreeStore" needs to be exported by the entry point index.d.ts - constructor(contentApiClient: GraphQlClient, systemApiClient: GraphQlClient, tenantApiClient: GraphQlClient, treeStore: TreeStore, environment: Environment, onUpdate: (newData: TreeRootAccessor, binding: DataBinding) => void, onError: (error: RequestError, binding: DataBinding) => void, onPersistSuccess: (result: SuccessfulPersistResult, binding: DataBinding) => void, options: { +export class DataBinding { + constructor(contentApiClient: GraphQlClient, systemApiClient: GraphQlClient, tenantApiClient: GraphQlClient, treeStore: TreeStore, environment: Environment, createMarkerTree: (node: Node, environment: Environment) => MarkerTreeRoot, batchedUpdates: (callback: () => any) => void, onUpdate: (newData: TreeRootAccessor, binding: DataBinding) => void, onError: (error: RequestError, binding: DataBinding) => void, onPersistSuccess: (result: SuccessfulPersistResult, binding: DataBinding) => void, options: { skipStateUpdateAfterPersist: boolean; }); // (undocumented) - extendTree(newFragment: ReactNode, options?: ExtendTreeOptions): Promise; + extendTree(newFragment: Node, options?: ExtendTreeOptions): Promise; } // @public (undocumented) export const DataBindingExtendAborted: unique symbol; -// @public -export const DataBindingProvider: (props: DataBindingProviderProps) => ReactElement; - -// @public (undocumented) -export type DataBindingProviderBaseProps = AccessorTreeStateOptions; - // @public (undocumented) -export type DataBindingProviderProps = DataBindingProviderBaseProps & DataBindingProviderStateComponent; - -// @public (undocumented) -export type DataBindingProviderStateComponent = ({ - stateComponent?: never; - stateProps?: never; -} | { - stateComponent: ComponentType; - stateProps?: StateProps; -}); - -// @public (undocumented) -export interface DataBindingStateComponentProps { +export class DirtinessTracker { // (undocumented) - accessorTreeState: AccessorTreeState; + getTotalTouchCount(): number; // (undocumented) - children?: ReactNode; -} - -// @public (undocumented) -export const DeferredSubTrees: React.NamedExoticComponent; - -// @public (undocumented) -export interface DeferredSubTreesProps { + hasChanges(): boolean; // (undocumented) - children: ReactNode; + increaseBy(delta: number): void; // (undocumented) - fallback: ReactNode; + reset(): void; } -// @public (undocumented) -export const DirtinessContext: React.Context; - -// @public (undocumented) -export const Entity: React.NamedExoticComponent; - // @public (undocumented) export class EntityAccessor implements Errorable { // Warning: (ae-forgotten-export) The symbol "EntityRealmState" needs to be exported by the entry point index.d.ts @@ -358,14 +244,6 @@ export namespace EntityAccessor { export type UpdateListener = (accessor: EntityAccessor) => void; } -// @public (undocumented) -export interface EntityBaseProps { - // (undocumented) - accessor: EntityAccessor; - // (undocumented) - children?: ReactNode; -} - // @public (undocumented) export interface EntityCreationParameters { // (undocumented) @@ -426,20 +304,6 @@ export class EntityFieldsWithHoistablesMarker { // @public (undocumented) export type EntityId = string | number; -// @public (undocumented) -export function EntityKeyProvider(props: EntityKeyProviderProps): JSX.Element; - -// @public (undocumented) -export interface EntityKeyProviderProps { - // (undocumented) - children: ReactNode; - // (undocumented) - entityKey: string; -} - -// @public (undocumented) -export const EntityList: (props: EntityListProps) => ReactElement; - // @public (undocumented) export class EntityListAccessor implements Errorable { // (undocumented) @@ -539,14 +403,6 @@ export namespace EntityListAccessor { export type UpdateListener = (accessor: EntityListAccessor) => void; } -// @public (undocumented) -export interface EntityListBaseProps { - // (undocumented) - accessor: EntityListAccessor; - // (undocumented) - children?: ReactNode; -} - // @public (undocumented) export interface EntityListEventListeners { // (undocumented) @@ -584,21 +440,6 @@ export interface EntityListPreferences { // @public (undocumented) export const EntityListPreferencesDefaults: EntityListPreferences; -// @public (undocumented) -export type EntityListProps = EntityListBaseProps & ({} | { - listComponent: ComponentType; - listProps?: ListProps; -}); - -// @public -export const EntityListSubTree: (props: EntityListSubTreeProps) => ReactElement; - -// @public (undocumented) -export interface EntityListSubTreeAdditionalProps { - // (undocumented) - variables?: Environment.ValuesMapWithFactory; -} - // @public (undocumented) export class EntityListSubTreeMarker { constructor(parameters: QualifiedEntityList | UnconstrainedQualifiedEntityList, fields: EntityFieldMarkersContainer, environment: Environment); @@ -614,44 +455,12 @@ export class EntityListSubTreeMarker { readonly placeholderName: string; } -// @public (undocumented) -export type EntityListSubTreeProps = { - treeRootId?: TreeRootId; - children?: ReactNode; -} & EntityListSubTreeAdditionalProps & (SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList) & ({} | { - listComponent: ComponentType; - listProps?: ListProps; -}); - // @public (undocumented) export type EntityName = string; -// @public (undocumented) -export type EntityProps = EntityBaseProps; - -// @public (undocumented) -export interface EntityProviderProps { - // (undocumented) - accessor: EntityAccessor; - // (undocumented) - children: ReactNode; -} - // @public (undocumented) export type EntityRealmKey = string; -// @public -export const EntitySubTree: (pros: EntitySubTreeProps) => ReactElement; - -// @public (undocumented) -export type EntitySubTreeAdditionalCreationProps = {} | SetOrderFieldOnCreateOwnProps; - -// @public (undocumented) -export interface EntitySubTreeAdditionalProps { - // (undocumented) - variables?: Environment.ValuesMapWithFactory; -} - // @public (undocumented) export class EntitySubTreeMarker { constructor(parameters: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity, fields: EntityFieldMarkersContainer, environment: Environment); @@ -667,23 +476,6 @@ export class EntitySubTreeMarker { readonly placeholderName: string; } -// @public (undocumented) -export type EntitySubTreeProps = { - treeRootId?: TreeRootId; - children?: ReactNode; -} & EntitySubTreeAdditionalProps & (SugaredQualifiedSingleEntity | (SugaredUnconstrainedQualifiedSingleEntity & EntitySubTreeAdditionalCreationProps)); - -// @public (undocumented) -export function EntityView(props: EntityViewProps): JSX.Element; - -// @public (undocumented) -export interface EntityViewProps { - // (undocumented) - field?: string | SugaredRelativeSingleEntity; - // (undocumented) - render: (entity: EntityAccessor) => ReactNode; -} - // @public (undocumented) export class Environment { // (undocumented) @@ -818,6 +610,11 @@ export namespace Environment { [K in string]?: string | number; }; // (undocumented) + export type ReactElementLike = { + type: any; + props: any; + }; + // (undocumented) export type ResolvedValue = Value; // (undocumented) export interface SelectedDimensions { @@ -849,7 +646,7 @@ export namespace Environment { // (undocumented) export type SubTreeNode = SubTreeEntityNode | SubTreeEntityListNode; // (undocumented) - export type Value = ReactNode | GraphQlLiteral | Filter; + export type Value = string | number | boolean | undefined | GraphQlLiteral | Filter | ReactElementLike; const // (undocumented) createExtension: (create: (state: S | undefined, environment: Environment) => R, otherMethods?: Omit, "create"> | undefined) => Extension; // (undocumented) @@ -859,47 +656,6 @@ export namespace Environment { } } -// @public (undocumented) -export interface EnvironmentAwareFunctionComponent

{ - // (undocumented) - (props: PropsWithChildren

, environment: Environment): ReactElement | null; - // (undocumented) - displayName?: string | undefined; -} - -// @public (undocumented) -export const EnvironmentContext: React.Context; - -// @public (undocumented) -export interface EnvironmentDeltaProvider { - // (undocumented) - generateEnvironment: (props: Props, oldEnvironment: Environment) => Environment; -} - -// @public (undocumented) -export const EnvironmentExtensionProvider: (props: EnvironmentWithExtensionProps) => ReactElement | null; - -// @public (undocumented) -export const EnvironmentMiddleware: React.NamedExoticComponent; - -// @public (undocumented) -export interface EnvironmentMiddlewareProps { - // (undocumented) - children: ReactNode; - // (undocumented) - create: (env: Environment) => Environment; -} - -// @public (undocumented) -export interface EnvironmentWithExtensionProps { - // (undocumented) - children: ReactNode; - // (undocumented) - extension: Environment.Extension; - // (undocumented) - state: S; -} - // @public (undocumented) export interface Errorable { // (undocumented) @@ -949,18 +705,6 @@ export namespace ErrorAccessor { normalizeError: (error: Error | string) => Error; } -// @public (undocumented) -export interface ErrorAccessorTreeState { - // (undocumented) - binding: DataBinding; - // (undocumented) - environment: Environment; - // (undocumented) - error: RequestError; - // (undocumented) - name: 'error'; -} - // @public (undocumented) export type ErrorPathNodeType = FieldPathErrorFragment | IndexPathErrorFragment; @@ -1002,6 +746,48 @@ export class EventListenersStore): void; } +// @public (undocumented) +export class EventManager { + // Warning: (ae-forgotten-export) The symbol "UpdateMetadata" needs to be exported by the entry point index.d.ts + constructor(asyncBatchUpdatesOptions: AsyncBatchUpdatesOptions, batchUpdatesOptions: BatchUpdatesOptions, config: Config, dirtinessTracker: DirtinessTracker, onUpdate: (metadata: UpdateMetadata) => void, treeStore: TreeStore, batchedUpdates: (callback: () => any) => void); + // (undocumented) + asyncOperation(operation: () => Promise): Promise; + // (undocumented) + asyncTransaction(transaction: () => Promise): Promise; + // (undocumented) + getEventDispatchers extends EventListenersStore ? [Keys, Map] : never, EventType extends EventListenerTypes[0]>(state: State, event: { + type: EventType; + key?: string; + }, listenerArgs: Parameters>): Array<() => ReturnType>> | undefined; + // (undocumented) + getEventListeners extends EventListenersStore ? [Keys, Map] : never, EventType extends EventListenerTypes[0]>(state: State, event: { + type: EventType; + key?: string; + }): Set> | undefined; + // (undocumented) + static readonly NO_CHANGES_DIFFERENCE = 0; + // (undocumented) + persistOperation(operation: () => Promise): Promise; + // (undocumented) + registerJustUpdated(justUpdated: StateNode, changesDelta: number): void; + // Warning: (ae-forgotten-export) The symbol "StateNode" needs to be exported by the entry point index.d.ts + // + // (undocumented) + registerNewlyInitialized(newlyInitialized: StateNode): void; + // (undocumented) + registerUpdatedConnection(parentState: EntityRealmState, placeholderName: PlaceholderName): void; + // (undocumented) + syncOperation(operation: () => T): T; + // (undocumented) + syncTransaction(transaction: () => T): T; + // (undocumented) + triggerOnBeforePersist(): Promise; + // (undocumented) + triggerOnPersistError(options: PersistErrorOptions): Promise; + // (undocumented) + triggerOnPersistSuccess(options: PersistSuccessOptions): Promise; +} + // @public (undocumented) export interface ExecutionError { // (undocumented) @@ -1022,7 +808,7 @@ export type ExpectedQualifiedEntityMutation = 'none' | 'anyMutation'; export type ExpectedRelationMutation = 'none' | 'createOrDelete' | 'connectOrDisconnect' | 'anyMutation'; // @public (undocumented) -export type ExtendTree = (newFragment: ReactNode, options?: ExtendTreeOptions) => Promise; +export type ExtendTree = (newFragment: Node, options?: ExtendTreeOptions) => Promise; // @public (undocumented) export interface ExtendTreeOptions { @@ -1032,9 +818,6 @@ export interface ExtendTreeOptions { signal?: AbortSignal; } -// @public (undocumented) -export const Field: (props: FieldProps) => ReactElement; - // @public (undocumented) export class FieldAccessor implements Errorable { // Warning: (ae-forgotten-export) The symbol "FieldState" needs to be exported by the entry point index.d.ts @@ -1118,10 +901,6 @@ export namespace FieldAccessor { } } -// @public (undocumented) -export interface FieldBasicProps extends SugaredRelativeSingleField { -} - // @public (undocumented) export interface FieldEventListeners { // (undocumented) @@ -1160,54 +939,12 @@ export interface FieldPathErrorFragment { field: string; } -// @public (undocumented) -export interface FieldProps extends FieldBasicProps, FieldRuntimeProps { -} - -// @public (undocumented) -export interface FieldRuntimeProps { - // (undocumented) - format?: (value: Persisted | null) => ReactNode; -} - // @public (undocumented) export type FieldValue = JsonValue; -// @public -export const FieldView: { - (props: FieldViewCommonProps & { - field: SRSF; - render: (field1: FieldAccessor) => RN; - }): REN; - (props: FieldViewCommonProps & { - fields: [SRSF]; - render: (field1: FieldAccessor) => RN; - }): REN; - (props: FieldViewCommonProps & { - fields: [SRSF, SRSF]; - render: (field1: FieldAccessor, field2: FieldAccessor) => RN; - }): REN; - (props: FieldViewCommonProps & { - fields: [SRSF, SRSF, SRSF]; - render: (field1: FieldAccessor, field2: FieldAccessor, field3: FieldAccessor) => RN; - }): REN; - (props: FieldViewCommonProps & { - fields: [SRSF, SRSF, SRSF, SRSF]; - render: (field1: FieldAccessor, field2: FieldAccessor, field3: FieldAccessor, field4: FieldAccessor) => RN; - }): REN; - (props: FieldViewCommonProps & { - fields: [SRSF, SRSF, SRSF, SRSF, SRSF]; - render: (field1: FieldAccessor, field2: FieldAccessor, field3: FieldAccessor, field4: FieldAccessor, field5: FieldAccessor) => RN; - }): REN; - (props: FieldViewProps): REN; -}; - // @public (undocumented) export type Filter = Input.Where>>; -// @public (undocumented) -export type ForceAccessorUpdate = () => void; - export { generateUuid } // @public (undocumented) @@ -1232,18 +969,6 @@ export interface GqlError { type: 'gqlError'; } -// @public (undocumented) -export const HasMany: (props: HasManyProps) => ReactElement; - -// @public (undocumented) -export type HasManyProps = SugaredRelativeEntityList & { - children?: ReactNode; - variables?: Environment.ValuesMapWithFactory; -} & ({} | { - listComponent: ComponentType; - listProps?: ListProps; -}); - // @public (undocumented) export interface HasManyRelation extends Relation, EntityListParameters, EntityListEventListeners { } @@ -1263,15 +988,6 @@ export class HasManyRelationMarker { readonly placeholderName: string; } -// @public (undocumented) -export const HasOne: (props: HasOneProps) => ReactElement; - -// @public (undocumented) -export type HasOneProps = SugaredRelativeSingleEntity & { - children?: ReactNode; - variables?: Environment.ValuesMapWithFactory; -}; - // @public (undocumented) export interface HasOneRelation extends Relation, SingleEntityParameters, SingleEntityEventListeners { // (undocumented) @@ -1293,28 +1009,6 @@ export class HasOneRelationMarker { readonly placeholderName: string; } -// @public (undocumented) -export const If: React.NamedExoticComponent; - -// @public (undocumented) -export interface IfCallbackProps { - // (undocumented) - children?: ReactNode; - // (undocumented) - condition: (accessor: EntityAccessor) => boolean; -} - -// @public (undocumented) -export interface IfFilterProps { - // (undocumented) - children?: ReactNode; - // (undocumented) - condition: string | Filter; -} - -// @public (undocumented) -export type IfProps = IfFilterProps | IfCallbackProps; - // @public (undocumented) export interface IndexPathErrorFragment { // (undocumented) @@ -1325,28 +1019,6 @@ export interface IndexPathErrorFragment { index: number; } -// @public (undocumented) -export interface InitializedAccessorTreeState { - // (undocumented) - binding: DataBinding; - // (undocumented) - data: TreeRootAccessor; - // (undocumented) - environment: Environment; - // (undocumented) - name: 'initialized'; -} - -// @public (undocumented) -export interface InitializingAccessorTreeState { - // (undocumented) - binding?: DataBinding; - // (undocumented) - environment: Environment; - // (undocumented) - name: 'initializing'; -} - // @public (undocumented) export interface InvalidInputPersistResult { // (undocumented) @@ -1409,12 +1081,6 @@ export const LeafFieldDefaults: { readonly isNonbearing: false; }; -// @public (undocumented) -export interface LeafMarkerProvider { - // (undocumented) - generateLeafMarker: (props: Props, environment: Environment) => FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer; -} - // @public (undocumented) export type Limit = number; @@ -1476,16 +1142,6 @@ export class MarkerMerger { static mergeSubTreePlaceholdersByAliases(original: Map, fresh: Map): Map; } -// @public (undocumented) -export type MarkerProvider = Partial>; - -// @public (undocumented) -export class MarkerTreeGenerator { - constructor(sourceTree: ReactNode, environment?: Environment); - // (undocumented) - generate(): MarkerTreeRoot; -} - // @public (undocumented) export class MarkerTreeRoot { constructor(subTrees: SubTreeMarkers, placeholdersByAliases: Map); @@ -1501,12 +1157,6 @@ export type MeaningfulMarker = FieldMarker | HasOneRelationMarker | HasManyRelat // @public (undocumented) export const metadataToRequestError: (metadata: GraphQlClientFailedRequestMetadata) => RequestError; -// @public (undocumented) -export const moveEntity: (entityList: EntityListAccessor, sortByField: RelativeSingleField, oldIndex: number, newIndex: number) => void; - -// @public (undocumented) -export const moveEntityInArray: (entities: EntityAccessor[], getAccessor: EntityListAccessor.GetEntityListAccessor, sortByField: RelativeSingleField, oldIndex: number, newIndex: number) => EntityAccessor[]; - // @public (undocumented) export interface MutationDataResponse { // (undocumented) @@ -1544,9 +1194,6 @@ export interface MutationResponse { } | undefined; } -// @public (undocumented) -export const MutationStateContext: React.Context; - // @public (undocumented) export interface MutationTransactionResponse { // (undocumented) @@ -1602,9 +1249,6 @@ export interface OwningRelation extends BaseRelation { side: 'owning'; } -// @public (undocumented) -export const ParentEntity: React.NamedExoticComponent; - // @public (undocumented) export class ParentEntityMarker { constructor(parentEntity: ParentEntityParameters, fields: EntityFieldMarkersContainer); @@ -1618,12 +1262,6 @@ export class ParentEntityMarker { export interface ParentEntityParameters extends SingleEntityEventListeners { } -// @public (undocumented) -export interface ParentEntityProps extends SugaredParentEntityParameters { - // (undocumented) - children?: ReactNode; -} - // @public export class Parser extends EmbeddedActionsParser { // (undocumented) @@ -1833,6 +1471,18 @@ export interface QueryRequestResponse { }[]; } +// @public (undocumented) +export interface RawSchema { + // Warning: (ae-forgotten-export) The symbol "RawSchemaEntity" needs to be exported by the entry point index.d.ts + // + // (undocumented) + entities: RawSchemaEntity[]; + // Warning: (ae-forgotten-export) The symbol "RawSchemaEnum" needs to be exported by the entry point index.d.ts + // + // (undocumented) + enums: RawSchemaEnum[]; +} + // @public (undocumented) export type ReceivedData = ReceivedEntityData | ReceivedEntityData[]; @@ -1886,9 +1536,6 @@ export type RelativeSingleField = AnyField & LeafField & { // @public (undocumented) export type RemovalType = 'disconnect' | 'delete'; -// @public (undocumented) -export const repairEntitiesOrder: (sortableByField: RelativeSingleField, sortedEntities: EntityAccessor[]) => void; - // @public (undocumented) export type RequestError = UnauthorizedRequestError | NetworkErrorRequestError | GqlError | UnknownErrorRequestError; @@ -1996,6 +1643,12 @@ export class SchemaLoader { static loadSchema(client: GraphQlClient, options?: GraphQlClientRequestOptions): Promise; } +// @public (undocumented) +export class SchemaPreprocessor { + // (undocumented) + static processRawSchema(rawSchema: RawSchema): SchemaStore; +} + // @public (undocumented) export type SchemaRelation = OwningRelation | InverseRelation; @@ -2039,21 +1692,6 @@ export class ServerId implements RuntimeIdSpec { // @public (undocumented) export type SetOnCreate = UniqueWhere | undefined; -// @public (undocumented) -export const SetOrderFieldOnCreate: React.NamedExoticComponent; - -// @public (undocumented) -export interface SetOrderFieldOnCreateOwnProps { - // (undocumented) - newOrderFieldValue?: number; - // (undocumented) - orderField: SugaredRelativeSingleField | string; -} - -// @public (undocumented) -export interface SetOrderFieldOnCreateProps extends SetOrderFieldOnCreateOwnProps, Pick { -} - // @public (undocumented) export interface SingleEntityEventListeners { // (undocumented) @@ -2070,42 +1708,28 @@ export interface SingleEntityParameters { export type SingleEntityPersistedData = Map; // @public (undocumented) -export interface SortedEntities { - // (undocumented) - addNewAtIndex: (index: number | undefined, preprocess?: EntityAccessor.BatchUpdatesHandler) => void; - // (undocumented) - appendNew: (initialize?: EntityAccessor.BatchUpdatesHandler) => void; +export class StateInitializer { + // Warning: (ae-forgotten-export) The symbol "AccessorErrorManager" needs to be exported by the entry point index.d.ts + constructor(accessorErrorManager: AccessorErrorManager, batchUpdatesOptions: BatchUpdatesOptions, eventManager: EventManager, treeStore: TreeStore); // (undocumented) - entities: EntityAccessor[]; + initializeEntityEventListenerStore(blueprint: EntityRealmBlueprint): EntityEventListenerStore | undefined; + // Warning: (ae-forgotten-export) The symbol "EntityRealmBlueprint" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "EntityRealmStateStub" needs to be exported by the entry point index.d.ts + // // (undocumented) - moveEntity: (oldIndex: number, newIndex: number) => void; + initializeEntityRealm(id: RuntimeId, entityName: EntityName, blueprint: EntityRealmBlueprint, copyFrom?: EntityRealmState | EntityRealmStateStub): EntityRealmState | EntityRealmStateStub; + // Warning: (ae-forgotten-export) The symbol "EntityState" needs to be exported by the entry point index.d.ts + // // (undocumented) - prependNew: (initialize?: EntityAccessor.BatchUpdatesHandler) => void; -} - -// @public (undocumented) -export const sortEntities: (entities: EntityAccessor[], sortByField: RelativeSingleField | undefined) => EntityAccessor[]; - -// @public (undocumented) -export const StaticRender: React.NamedExoticComponent; - -// @public (undocumented) -export interface StaticRenderProps { + initializeEntityState(id: RuntimeId, entityName: EntityName): EntityState; + // Warning: (ae-forgotten-export) The symbol "RootStateNode" needs to be exported by the entry point index.d.ts + // // (undocumented) - children?: ReactNode; -} - -// @public (undocumented) -export interface StaticRenderProvider { + initializeSubTree(tree: EntitySubTreeMarker | EntityListSubTreeMarker): RootStateNode; // (undocumented) - staticRender: (props: StaticRenderProviderProps, environment: Environment) => ReactElement | null; + runImmediateUserInitialization(realm: EntityRealmState | EntityRealmStateStub, initialize: EntityAccessor.BatchUpdatesHandler | undefined): void; } -// @public (undocumented) -export type StaticRenderProviderProps = [ -NonStaticPropNames -] extends [never] ? Props : Omit; - // @public (undocumented) export type SubTreeDataStore = Map; @@ -2207,15 +1831,6 @@ export interface SugarableUnconstrainedQualifiedSingleEntity extends SugarableQu hasOneRelationPath?: SugarableHasOneRelation[] | SugarableHasOneRelation; } -// @public (undocumented) -export const SugaredField: (props: SugaredFieldProps) => ReactElement; - -// @public (undocumented) -export interface SugaredFieldProps extends Omit, 'field'> { - // (undocumented) - field: string | SugaredRelativeSingleField; -} - // @public (undocumented) export type SugaredFilter = Filter | string; @@ -2322,6 +1937,35 @@ export const tokens: { GreaterThan: TokenType; }; +// @public (undocumented) +export class TreeAugmenter { + constructor(eventManager: EventManager, stateInitializer: StateInitializer, treeStore: TreeStore, skipStateUpdateAfterPersist?: boolean); + // (undocumented) + extendPersistedData(newPersistedData: ReceivedDataTree, markerTree: MarkerTreeRoot): void; + // (undocumented) + extendTreeStates(newTreeId: TreeRootId | undefined, newMarkerTree: MarkerTreeRoot): void; + // (undocumented) + resetCreatingSubTrees(): void; + // Warning: (ae-forgotten-export) The symbol "SubMutationOperation" needs to be exported by the entry point index.d.ts + // + // (undocumented) + updatePersistedData(response: ReceivedDataTree, operations: SubMutationOperation[]): void; +} + +// @public (undocumented) +export class TreeNodeEnvironmentFactory { + // (undocumented) + static createEnvironmentForEntity(environment: Environment, sugaredRelativeSingleEntity: SugaredRelativeSingleEntity): Environment; + // (undocumented) + static createEnvironmentForEntityList(environment: Environment, sugaredRelativeEntityList: SugaredRelativeEntityList): Environment; + // (undocumented) + static createEnvironmentForEntityListSubtree(environment: Environment, sugaredEntityList: SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList): Environment; + // (undocumented) + static createEnvironmentForEntitySubtree(environment: Environment, sugaredEntityList: SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity): Environment; + // (undocumented) + static createEnvironmentForField(environment: Environment, sugaredRelativeSingleField: SugaredRelativeSingleField): Environment; +} + // @public (undocumented) export class TreeParameterMerger { // (undocumented) @@ -2351,10 +1995,10 @@ export class TreeParameterMerger { } // @public (undocumented) -export class TreeRootAccessor { - constructor(hasUnpersistedChanges: boolean, isMutating: boolean, bindingOperations: BindingOperations); +export class TreeRootAccessor { + constructor(hasUnpersistedChanges: boolean, isMutating: boolean, bindingOperations: BindingOperations); // (undocumented) - readonly bindingOperations: BindingOperations; + readonly bindingOperations: BindingOperations; // (undocumented) readonly hasUnpersistedChanges: boolean; // (undocumented) @@ -2365,14 +2009,45 @@ export class TreeRootAccessor { export type TreeRootId = string; // @public (undocumented) -export function TreeRootIdProvider(props: TreeRootIdProviderProps): JSX.Element; - -// @public (undocumented) -export interface TreeRootIdProviderProps { +export class TreeStore { + constructor(_schema: Schema); + // (undocumented) + disposeOfEntity(entity: EntityState): void; + // (undocumented) + disposeOfRealm(realmToDisposeOf: EntityRealmState | EntityRealmStateStub): void; + // (undocumented) + effectivelyHasTreeRoot(candidateRoot: MarkerTreeRoot): boolean; // (undocumented) - children: ReactNode; + readonly entityRealmStore: Map; // (undocumented) - treeRootId: TreeRootId | undefined; + readonly entityStore: Map; + // (undocumented) + getEntityListPersistedIds(state: EntityListState): ReadonlySet; + // (undocumented) + getPathBackToParent(entityRealm: EntityRealmState | EntityRealmStateStub): { + fieldBackToParent: FieldName; + parent: EntityRealmState; + } | undefined; + // (undocumented) + getSubTreeState(mode: 'entity', treeRootId: TreeRootId | undefined, aliasOrParameters: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity, environment: Environment): EntityRealmState; + // (undocumented) + getSubTreeState(mode: 'entityList', treeRootId: TreeRootId | undefined, aliasOrParameters: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList, environment: Environment): EntityListState; + // (undocumented) + readonly markerTrees: Map; + // (undocumented) + mergeInMutationResponse(response: ReceivedDataTree, operations: SubMutationOperation[]): void; + // (undocumented) + mergeInQueryResponse(response: ReceivedDataTree, markerTree: MarkerTreeRoot): void; + // (undocumented) + readonly persistedData: NormalizedPersistedData; + // (undocumented) + get persistedEntityData(): PersistedEntityDataStore; + // (undocumented) + get schema(): Schema; + // (undocumented) + get subTreePersistedData(): SubTreeDataStore; + // (undocumented) + readonly subTreeStatesByRoot: Map>; } // @public (undocumented) @@ -2390,6 +2065,8 @@ export interface UnconstrainedQualifiedEntityList extends QualifiedEntityParamet hasOneRelationPath: HasOneRelation[]; // (undocumented) isCreating: true; + // (undocumented) + isUnpersisted: boolean; } // @public (undocumented) @@ -2398,6 +2075,8 @@ export interface UnconstrainedQualifiedSingleEntity extends QualifiedEntityParam hasOneRelationPath: HasOneRelation[]; // (undocumented) isCreating: true; + // (undocumented) + isUnpersisted: boolean; } // @public (undocumented) @@ -2536,189 +2215,18 @@ export type UnsugarableSingleEntityEventListeners = { export interface UnsugarableUnconstrainedQualifiedEntityList extends UnsugarableQualifiedEntityParameters, UnsugarableEntityCreationParameters, UnsugarableEntityListEventListeners, UnsugarableEntityListPreferences { // (undocumented) isCreating: true; + // (undocumented) + isUnpersisted?: boolean; } // @public (undocumented) export interface UnsugarableUnconstrainedQualifiedSingleEntity extends UnsugarableQualifiedEntityParameters, UnsugarableEntityCreationParameters, UnsugarableSingleEntityEventListeners { // (undocumented) isCreating: true; + // (undocumented) + isUnpersisted?: boolean; } -// @public (undocumented) -export const useAccessorTreeState: () => AccessorTreeState; - -// @public -export function useAccessorUpdateSubscription(getFieldAccessor: () => FieldAccessor): FieldAccessor; - -// @public (undocumented) -export function useAccessorUpdateSubscription(getEntityAccessor: () => EntityAccessor): EntityAccessor; - -// @public (undocumented) -export function useAccessorUpdateSubscription(getListAccessor: () => EntityListAccessor): EntityListAccessor; - -// @public (undocumented) -export function useAccessorUpdateSubscription(getAccessor: () => EntityListAccessor | EntityAccessor): EntityListAccessor | EntityAccessor; - -// @public (undocumented) -export function useAccessorUpdateSubscription(getFieldAccessor: () => FieldAccessor, withForceUpdate: true): [FieldAccessor, ForceAccessorUpdate]; - -// @public (undocumented) -export function useAccessorUpdateSubscription(getEntityAccessor: () => EntityAccessor, withForceUpdate: true): [EntityAccessor, ForceAccessorUpdate]; - -// @public (undocumented) -export function useAccessorUpdateSubscription(getListAccessor: () => EntityListAccessor, withForceUpdate: true): [EntityListAccessor, ForceAccessorUpdate]; - -// @public (undocumented) -export function useAccessorUpdateSubscription(getAccessor: () => EntityListAccessor | EntityAccessor, withForceUpdate: true): [EntityListAccessor | EntityAccessor, ForceAccessorUpdate]; - -// @public (undocumented) -export const useBindingOperations: () => BindingOperations; - -// @public (undocumented) -export const useDataBinding: ({ children, refreshOnPersist, skipStateUpdateAfterPersist, }: AccessorTreeStateOptions) => AccessorTreeState; - -// @public @deprecated -export const useDerivedField: (sourceField: string | SugaredRelativeSingleField, derivedField: string | SugaredRelativeSingleField, transform?: (sourceValue: SourceValue | null) => SourceValue | null, agent?: string) => void; - -// @public @deprecated (undocumented) -export function useDesugaredRelativeEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): RelativeEntityList; - -// @public @deprecated (undocumented) -export function useDesugaredRelativeEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined): RelativeEntityList | undefined; - -// @public @deprecated (undocumented) -export function useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): RelativeSingleEntity; - -// @public @deprecated (undocumented) -export function useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined): RelativeSingleEntity | undefined; - -// @public @deprecated (undocumented) -export function useDesugaredRelativeSingleField(sugaredRelativeSingleField: string | SugaredRelativeSingleField): RelativeSingleField; - -// @public @deprecated (undocumented) -export function useDesugaredRelativeSingleField(sugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined): RelativeSingleField | undefined; - -// @public (undocumented) -export const useDirtinessState: () => boolean; - -// @public (undocumented) -export function useEntity(): EntityAccessor; - -// @public (undocumented) -export function useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor; - -// @public (undocumented) -export function useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined): EntityAccessor | undefined; - -// @public (undocumented) -export const useEntityBeforePersist: (listener: EntityAccessor.EntityEventListenerMap['beforePersist']) => void; - -// @public (undocumented) -export const useEntityBeforeUpdate: (listener: EntityAccessor.EntityEventListenerMap['beforeUpdate']) => void; - -// @public (undocumented) -export function useEntityEvent(type: 'beforePersist', listener: EntityAccessor.EntityEventListenerMap['beforePersist']): void; - -// @public (undocumented) -export function useEntityEvent(type: 'beforeUpdate', listener: EntityAccessor.EntityEventListenerMap['beforeUpdate']): void; - -// @public (undocumented) -export function useEntityEvent(type: 'connectionUpdate', hasOneField: FieldName, listener: EntityAccessor.EntityEventListenerMap['connectionUpdate']): void; - -// @public (undocumented) -export function useEntityEvent(type: 'persistError', listener: EntityAccessor.EntityEventListenerMap['persistError']): void; - -// @public (undocumented) -export function useEntityEvent(type: 'persistSuccess', listener: EntityAccessor.EntityEventListenerMap['persistSuccess']): void; - -// @public (undocumented) -export function useEntityEvent(type: 'update', listener: EntityAccessor.EntityEventListenerMap['update']): void; - -// @public (undocumented) -export const useEntityKey: () => string; - -// @public (undocumented) -export function useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor; - -// @public (undocumented) -export function useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined): EntityListAccessor | undefined; - -// @public (undocumented) -export const useEntityListSubTree: (qualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList, ...treeId: [TreeRootId | undefined] | [ -]) => EntityListAccessor; - -// @public (undocumented) -export function useEntityListSubTreeParameters(alias: Alias): Alias; - -// @public (undocumented) -export function useEntityListSubTreeParameters(qualifiedEntityList: SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList): SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList; - -// @public (undocumented) -export function useEntityListSubTreeParameters(qualifiedEntityListOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList; - -// @public (undocumented) -export const useEntityPersistError: (listener: EntityAccessor.EntityEventListenerMap['persistError']) => void; - -// @public (undocumented) -export const useEntityPersistSuccess: (listener: EntityAccessor.EntityEventListenerMap['persistSuccess']) => void; - -// @public (undocumented) -export const useEntitySubTree: (qualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity, ...treeId: [TreeRootId | undefined] | [ -]) => EntityAccessor; - -// @public (undocumented) -export function useEntitySubTreeParameters(alias: Alias): Alias; - -// @public (undocumented) -export function useEntitySubTreeParameters(qualifiedEntity: SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity): SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity; - -// @public (undocumented) -export function useEntitySubTreeParameters(qualifiedSingleEntityOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity): Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity; - -// @public (undocumented) -export const useEnvironment: () => Environment; - -// @public (undocumented) -export const useExtendTree: () => (newFragment: ReactNode, options?: Omit) => Promise; - -// @public (undocumented) -export function useField(sugaredRelativeSingleField: string | SugaredRelativeSingleField): FieldAccessor; - -// @public (undocumented) -export function useField(sugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined): FieldAccessor | undefined; - -// @public (undocumented) -export const useGetEntityByKey: () => GetEntityByKey; - -// @public (undocumented) -export const useGetEntityListSubTree: () => (parametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList, ...treeId: [TreeRootId | undefined] | [ -]) => EntityListAccessor; - -// @public (undocumented) -export const useGetEntitySubTree: () => (parametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity, ...treeId: [TreeRootId | undefined] | [ -]) => EntityAccessor; - -// @public (undocumented) -export const useGetTreeFilters: () => (() => TreeFilter[]); - -// @public (undocumented) -export const useHasEntity: () => boolean; - -// @public (undocumented) -export const useMutationState: () => boolean; - -// @public (undocumented) -export const useOnConnectionUpdate: (fieldName: FieldName, listener: EntityAccessor.EntityEventListenerMap['connectionUpdate']) => void; - -// @public (undocumented) -export const usePersist: () => Persist; - -// @public (undocumented) -export const useSortedEntities: (entityList: EntityListAccessor, sortableByField: SugaredFieldProps['field'] | undefined) => SortedEntities; - -// @public (undocumented) -export const useTreeRootId: () => TreeRootId | undefined; - // @public (undocumented) export interface ValidationError { // (undocumented) @@ -2747,14 +2255,6 @@ export class VariableInputTransformer { // @public (undocumented) export const wrapFilterInHasOnes: (path: HasOneRelation[], filter: Filter) => Filter; -// Warnings were encountered during analysis: -// -// src/helperComponents/FieldView.tsx:47:23 - (ae-forgotten-export) The symbol "FieldViewCommonProps" needs to be exported by the entry point index.d.ts -// src/helperComponents/FieldView.tsx:47:23 - (ae-forgotten-export) The symbol "REN" needs to be exported by the entry point index.d.ts -// src/helperComponents/FieldView.tsx:49:1 - (ae-forgotten-export) The symbol "SRSF" needs to be exported by the entry point index.d.ts -// src/helperComponents/FieldView.tsx:108:33 - (ae-forgotten-export) The symbol "RN" needs to be exported by the entry point index.d.ts -// src/helperComponents/FieldView.tsx:141:1 - (ae-forgotten-export) The symbol "FieldViewProps" needs to be exported by the entry point index.d.ts - // (No @packageDocumentation comment for this package) ``` diff --git a/build/api/react-auto.api.md b/build/api/react-auto.api.md new file mode 100644 index 0000000000..4439ec24d4 --- /dev/null +++ b/build/api/react-auto.api.md @@ -0,0 +1,107 @@ +## API Report File for "@contember/react-auto" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +/// + +import { ComponentType } from 'react'; +import { DataGridContainerPublicProps } from '@contember/react-datagrid-ui'; +import { EntityAccessor } from '@contember/react-binding'; +import { EntityId } from '@contember/react-binding'; +import { MouseEvent as MouseEvent_2 } from 'react'; +import { NamedExoticComponent } from 'react'; +import { ReactNode } from 'react'; +import { Schema } from '@contember/react-binding'; +import { SugaredQualifiedEntityList } from '@contember/react-binding'; + +// @public (undocumented) +export const AutoCell: NamedExoticComponent; + +// @public (undocumented) +export type AutoCellProps = { + schema: Schema; + entityName: string; + fieldName: string; + LinkComponent?: LinkComponent; + linkAction?: LinkComponentProps['action']; +}; + +// @public (undocumented) +export const AutoField: NamedExoticComponent; + +// @public (undocumented) +export type AutoFieldProps = { + schema: Schema; + entityName: string; + fieldName: string; + LinkComponent?: LinkComponent; + excludedEntities?: string[]; +}; + +// @public (undocumented) +export const AutoFields: NamedExoticComponent; + +// @public (undocumented) +export type AutoFieldsProps = { + LinkComponent?: LinkComponent; + excludedFields?: string[]; + excludedEntities?: string[]; +}; + +// @public (undocumented) +export const AutoForm: NamedExoticComponent; + +// @public (undocumented) +export type AutoFormProps = { + entity: string; + id?: EntityId; + onCreateSuccess?: EntityAccessor.PersistSuccessHandler | Set; + LinkComponent?: LinkComponent; +}; + +// @public (undocumented) +export const AutoGrid: NamedExoticComponent; + +// @public (undocumented) +export type AutoGridProps = DataGridContainerPublicProps & { + entities: SugaredQualifiedEntityList['entities']; + LinkComponent?: LinkComponent; +}; + +// @public (undocumented) +export const AutoLabel: NamedExoticComponent; + +// @public (undocumented) +export type AutoLabelProps = { + field: string; + LinkComponent?: LinkComponent; + linkAction?: LinkComponentProps['action']; +}; + +// @public (undocumented) +export interface InnerLinkProps { + // (undocumented) + active: boolean; + // (undocumented) + href: string; + // (undocumented) + onClick: (e?: MouseEvent_2) => void; +} + +// @public (undocumented) +export type LinkComponent = ComponentType; + +// @public (undocumented) +export type LinkComponentProps = { + entityName: string; + entityId: string | number; + action: 'edit' | 'view'; + Component?: ComponentType; + children: ReactNode; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-binding-ui.api.md b/build/api/react-binding-ui.api.md new file mode 100644 index 0000000000..a5ae5905ea --- /dev/null +++ b/build/api/react-binding-ui.api.md @@ -0,0 +1,278 @@ +## API Report File for "@contember/react-binding-ui" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { BoxProps } from '@contember/ui'; +import { ButtonProps } from '@contember/ui'; +import { ComponentProps } from 'react'; +import { ComponentType } from 'react'; +import { ElementType } from 'react'; +import { EntityAccessor } from '@contember/react-binding'; +import type { EntityListAccessor } from '@contember/react-binding'; +import type { ErrorAccessor } from '@contember/react-binding'; +import { ErrorListProps } from '@contember/ui'; +import type { FieldAccessor } from '@contember/react-binding'; +import { FieldValue } from '@contember/react-binding'; +import type { FunctionComponent } from 'react'; +import { HTMLAnchorElementProps } from '@contember/ui'; +import { HTMLImageElementProps } from '@contember/ui'; +import { HTMLVideoElementProps } from '@contember/ui'; +import { IconProps } from '@contember/ui'; +import { MemoExoticComponent } from 'react'; +import { NamedExoticComponent } from 'react'; +import { PersistOptions } from '@contember/react-binding'; +import { ReactElement } from 'react'; +import { ReactNode } from 'react'; +import { SuccessfulPersistResult } from '@contember/react-binding'; +import { SugarableRelativeSingleField } from '@contember/react-binding'; +import { SugaredFieldProps } from '@contember/react-binding'; + +// @public (undocumented) +export interface AccessorErrorMessage { + // (undocumented) + message: string; +} + +// @public (undocumented) +export type AccessorErrorMessages = [AccessorErrorMessage, ...AccessorErrorMessage[]]; + +// @public (undocumented) +export function AccessorErrors({ accessor, ...errorListProps }: AccessorErrorsProps): ReactElement | null; + +// @public (undocumented) +export interface AccessorErrorsHolder { + // (undocumented) + readonly errors: ErrorAccessor | undefined; +} + +// @public (undocumented) +export interface AccessorErrorsProps extends Omit { + // (undocumented) + accessor: FieldAccessor | EntityAccessor | EntityListAccessor; +} + +// @public (undocumented) +export interface AddEntityButtonProps { + // (undocumented) + addButtonComponent?: ComponentType; + // (undocumented) + addButtonComponentExtraProps?: {}; + // (undocumented) + addButtonProps?: CreateNewEntityButtonProps; + // (undocumented) + addButtonText?: ReactNode; +} + +// @public (undocumented) +export const BooleanFieldView: FunctionComponent; + +// @public (undocumented) +export type BooleanFieldViewProps = { + field: SugaredFieldProps['field']; + booleanStyle?: 'yesNo' | 'checkCross' | 'oneZero'; + format?: (date: boolean) => ReactNode; +} & FieldFallbackViewPublicProps; + +// @public (undocumented) +export const CoalesceFieldView: (props: CoalesceFieldViewProps) => ReactElement; + +// @public (undocumented) +export interface CoalesceFieldViewProps extends FieldFallbackViewPublicProps { + // (undocumented) + fields: (SugarableRelativeSingleField | string)[]; + // (undocumented) + format?: (value: Persisted) => ReactNode; +} + +// @public (undocumented) +export const CreateNewEntityButton: MemoExoticComponent<({ createNewEntity, iconProps, children, ...buttonProps }: CreateNewEntityButtonProps) => JSX.Element>; + +// @public (undocumented) +export type CreateNewEntityButtonProps = ButtonProps & { + createNewEntity: (initialize?: EntityAccessor.BatchUpdatesHandler) => void; + iconProps?: IconProps; +}; + +// @public (undocumented) +export const DateFieldView: FunctionComponent; + +// @public (undocumented) +export type DateFieldViewFormattingProps = { + format?: ((date: Date) => ReactNode) | Intl.DateTimeFormatOptions; + locale?: never; +} | { + format?: Intl.DateTimeFormatOptions; + locale: string | string[]; +}; + +// @public (undocumented) +export type DateFieldViewProps = { + field: SugaredFieldProps['field']; +} & DateFieldViewFormattingProps & FieldFallbackViewPublicProps; + +// @public +export const DeleteEntityButton: MemoExoticComponent<(props: DeleteEntityButtonProps) => JSX.Element | null>; + +// @public (undocumented) +export type DeleteEntityButtonProps = { + immediatePersist?: true; + children?: ReactNode; +} & ButtonProps; + +// @public (undocumented) +export const EmptyMessage: MemoExoticComponent<({ children, component, padding, ...rest }: EmptyMessageProps) => JSX.Element>; + +// @public (undocumented) +export type EmptyMessageComponentProps = BoxProps & { + children: ReactNode; +}; + +// @public (undocumented) +export interface EmptyMessageOuterProps { + // (undocumented) + emptyMessage?: ReactNode; + // (undocumented) + emptyMessageComponent?: ComponentType; +} + +// @public (undocumented) +export type EmptyMessageProps> = ComponentProps & ComponentProps & { + children: ReactNode; + component?: C; +}; + +// @public (undocumented) +export type ErrorCodeDictionary = typeof errorCodeDictionary; + +// @public (undocumented) +export const errorCodeDictionary: { + errorCodes: { + fieldRequired: string; + notUnique: string; + unknownExecutionError: string; + }; +}; + +// @public (undocumented) +export const FieldFallbackView: FunctionComponent; + +// @public (undocumented) +export interface FieldFallbackViewProps { + // (undocumented) + fallback?: ReactNode | undefined; + // (undocumented) + fallbackStyle?: FieldFallbackViewStyle | undefined; +} + +// @public (undocumented) +export type FieldFallbackViewPublicProps = FieldFallbackViewProps; + +// @public (undocumented) +export type FieldFallbackViewStyle = 'n/a' | 'nothing' | 'unknown'; + +// @public (undocumented) +export type FieldViewDictionary = typeof fieldViewDictionary; + +// @public (undocumented) +export const fieldViewDictionary: { + fieldView: { + boolean: { + yes: string; + no: string; + }; + fallback: { + unknown: string; + notAvailable: string; + }; + }; +}; + +// @public (undocumented) +export const FileUrlFieldView: FunctionComponent; + +// @public (undocumented) +export type FileUrlFieldViewProps = { + fileUrlField: SugaredFieldProps['field']; +} & HTMLAnchorElementProps; + +// @public (undocumented) +export const ImageFieldView: (props: ImageFieldViewProps) => ReactElement; + +// @public (undocumented) +export type ImageFieldViewProps = { + srcField: SugaredFieldProps['field']; + altField?: SugaredFieldProps['field']; + titleField?: SugaredFieldProps['field']; + formatUrl?: (srcFieldValue: SrcField) => string; +} & FieldFallbackViewPublicProps & Omit; + +// @public (undocumented) +export const NotFoundWrapper: NamedExoticComponent< { +children: ReactNode; +title?: ReactNode; +}>; + +// @public (undocumented) +export type PersistFeedbackDictionary = typeof persistFeedbackDictionary; + +// @public (undocumented) +export const persistFeedbackDictionary: { + persistFeedback: { + successMessage: string; + afterPersistErrorMessage: string; + errorMessage: string; + }; +}; + +// @public (undocumented) +export interface PersistWithFeedbackOptions extends PersistOptions { + // (undocumented) + afterPersistErrorDuration?: number; + // (undocumented) + afterPersistErrorMessage?: string; + // (undocumented) + errorDuration?: number; + // (undocumented) + errorMessage?: string; + // (undocumented) + successDuration?: number; + // (undocumented) + successMessage?: string; +} + +// @public (undocumented) +export interface SelectEntityButtonProps { + // (undocumented) + selectButtonComponent?: ComponentType; + // (undocumented) + selectButtonComponentExtraProps?: {}; + // (undocumented) + selectButtonProps?: CreateNewEntityButtonProps; + // (undocumented) + selectButtonText?: ReactNode; +} + +// @public (undocumented) +export const useAccessorErrorFormatter: () => (errors: ErrorAccessor.Error[]) => AccessorErrorMessage[]; + +// @public (undocumented) +export const useAccessorErrors: (errorAccessor: ErrorAccessor.Error[] | undefined) => AccessorErrorMessages | undefined; + +// @public (undocumented) +export const usePersistWithFeedback: ({ successMessage, successDuration, errorMessage, errorDuration, afterPersistErrorMessage, afterPersistErrorDuration, ...persistOptions }?: PersistWithFeedbackOptions) => () => Promise; + +// @public (undocumented) +export const VideoFieldView: (props: VideoFieldViewProps) => ReactElement; + +// @public (undocumented) +export type VideoFieldViewProps = { + srcField: SugaredFieldProps['field']; + titleField?: SugaredFieldProps['field']; + formatUrl?: (srcFieldValue: SrcField) => string; +} & FieldFallbackViewPublicProps & Omit; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-binding.api.md b/build/api/react-binding.api.md new file mode 100644 index 0000000000..7b198c23f0 --- /dev/null +++ b/build/api/react-binding.api.md @@ -0,0 +1,760 @@ +## API Report File for "@contember/react-binding" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Alias } from '@contember/binding'; +import type { BindingOperations } from '@contember/binding'; +import { ComponentType } from 'react'; +import { Context } from 'react'; +import { DataBinding } from '@contember/binding'; +import { EntityAccessor } from '@contember/binding'; +import type { EntityFieldMarkersContainer } from '@contember/binding'; +import type { EntityFieldsWithHoistablesMarker } from '@contember/binding'; +import { EntityListAccessor } from '@contember/binding'; +import { Environment } from '@contember/binding'; +import { ExtendTreeOptions } from '@contember/binding'; +import type { FieldAccessor } from '@contember/binding'; +import type { FieldMarker } from '@contember/binding'; +import type { FieldName } from '@contember/binding'; +import { FieldValue } from '@contember/binding'; +import { Filter } from '@contember/binding'; +import type { GetEntityByKey } from '@contember/binding'; +import type { HasManyRelationMarker } from '@contember/binding'; +import type { HasOneRelationMarker } from '@contember/binding'; +import { MarkerTreeRoot } from '@contember/binding'; +import { NamedExoticComponent } from 'react'; +import type { Persist } from '@contember/binding'; +import { PropsWithChildren } from 'react'; +import { ReactElement } from 'react'; +import { ReactNode } from 'react'; +import type { RelativeEntityList } from '@contember/binding'; +import type { RelativeSingleEntity } from '@contember/binding'; +import { RelativeSingleField } from '@contember/binding'; +import type { RequestError } from '@contember/binding'; +import type { SugaredParentEntityParameters } from '@contember/binding'; +import type { SugaredQualifiedEntityList } from '@contember/binding'; +import type { SugaredQualifiedSingleEntity } from '@contember/binding'; +import type { SugaredRelativeEntityList } from '@contember/binding'; +import type { SugaredRelativeSingleEntity } from '@contember/binding'; +import type { SugaredRelativeSingleField } from '@contember/binding'; +import type { SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'; +import type { SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'; +import type { TreeFilter } from '@contember/client'; +import type { TreeRootAccessor } from '@contember/binding'; +import { TreeRootId } from '@contember/binding'; + +// @public (undocumented) +export function AccessorProvider(props: EntityProviderProps): JSX.Element; + +// @public (undocumented) +export const AccessorTree: { + ({ state, children }: AccessorTreeProps): JSX.Element; + displayName: string; +}; + +// @public (undocumented) +export interface AccessorTreeProps { + // (undocumented) + children: ReactNode; + // (undocumented) + state: AccessorTreeState; +} + +// @public (undocumented) +export type AccessorTreeState = InitializingAccessorTreeState | InitializedAccessorTreeState | ErrorAccessorTreeState; + +// @public (undocumented) +export type AccessorTreeStateAction = { + type: 'setData'; + data: TreeRootAccessor; + binding: DataBinding; +} | { + type: 'failWithError'; + error: RequestError; + binding: DataBinding; +} | { + type: 'reset'; + binding: DataBinding; + environment: Environment; +}; + +// @public (undocumented) +export interface AccessorTreeStateMetadata { + // (undocumented) + initialize: (() => void) | undefined; +} + +// @public (undocumented) +export interface AccessorTreeStateOptions { + // (undocumented) + children?: ReactNode; + // (undocumented) + refreshOnPersist?: boolean; + // (undocumented) + skipStateUpdateAfterPersist?: boolean; +} + +// @public (undocumented) +export const accessorTreeStateReducer: (previousState: AccessorTreeState, action: AccessorTreeStateAction) => AccessorTreeState; + +// @public (undocumented) +export const addEntityAtIndex: (entityList: EntityListAccessor, sortableByField: RelativeSingleField, index: number, preprocess?: EntityAccessor.BatchUpdatesHandler) => void; + +// @public (undocumented) +export function BindingOperationsProvider(props: BindingOperationsProviderProps): JSX.Element; + +// @public (undocumented) +export interface BindingOperationsProviderProps { + // (undocumented) + bindingOperations: BindingOperations | undefined; + // (undocumented) + children: ReactNode; +} + +// @public (undocumented) +export interface BranchMarkerProvider { + // (undocumented) + generateBranchMarker: (props: Props, fields: EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer, environment: Environment) => HasOneRelationMarker | HasManyRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker; +} + +// @public (undocumented) +export type CompleteMarkerProvider = EnvironmentDeltaProvider & LeafMarkerProvider & BranchMarkerProvider & StaticRenderProvider; + +// @public (undocumented) +export function Component(statelessRender: EnvironmentAwareFunctionComponent, displayName?: string): NamedExoticComponent; + +// @public (undocumented) +export function Component(statefulRender: EnvironmentAwareFunctionComponent, staticRender: (props: StaticRenderProviderProps, environment: Environment) => ReactElement | null, displayName?: string): NamedExoticComponent; + +// @public (undocumented) +export function Component(statefulRender: EnvironmentAwareFunctionComponent, markerProvisions: MarkerProvider, displayName?: string): NamedExoticComponent; + +// @public +export const DataBindingProvider: (props: DataBindingProviderProps) => ReactElement; + +// @public (undocumented) +export type DataBindingProviderBaseProps = AccessorTreeStateOptions; + +// @public (undocumented) +export type DataBindingProviderProps = DataBindingProviderBaseProps & DataBindingProviderStateComponent; + +// @public (undocumented) +export type DataBindingProviderStateComponent = ({ + stateComponent?: never; + stateProps?: never; +} | { + stateComponent: ComponentType; + stateProps?: StateProps; +}); + +// @public (undocumented) +export interface DataBindingStateComponentProps { + // (undocumented) + accessorTreeState: AccessorTreeState; + // (undocumented) + children?: ReactNode; +} + +// @public (undocumented) +export const DeferredSubTrees: NamedExoticComponent; + +// @public (undocumented) +export interface DeferredSubTreesProps { + // (undocumented) + children: ReactNode; + // (undocumented) + fallback: ReactNode; +} + +// @public (undocumented) +export const DirtinessContext: Context; + +// @public (undocumented) +export const Entity: NamedExoticComponent; + +// @public (undocumented) +export interface EntityBaseProps { + // (undocumented) + accessor: EntityAccessor; + // (undocumented) + children?: ReactNode; +} + +// @public (undocumented) +export function EntityKeyProvider(props: EntityKeyProviderProps): JSX.Element; + +// @public (undocumented) +export interface EntityKeyProviderProps { + // (undocumented) + children: ReactNode; + // (undocumented) + entityKey: string; +} + +// @public (undocumented) +export const EntityList: (props: EntityListProps) => ReactElement; + +// @public (undocumented) +export interface EntityListBaseProps { + // (undocumented) + accessor: EntityListAccessor; + // (undocumented) + children?: ReactNode; +} + +// @public (undocumented) +export type EntityListProps = EntityListBaseProps & ({} | { + listComponent: ComponentType; + listProps?: ListProps; +}); + +// @public +export const EntityListSubTree: (props: EntityListSubTreeProps) => ReactElement; + +// @public (undocumented) +export interface EntityListSubTreeAdditionalProps { + // (undocumented) + variables?: Environment.ValuesMapWithFactory; +} + +// @public (undocumented) +export type EntityListSubTreeProps = { + treeRootId?: TreeRootId; + children?: ReactNode; +} & EntityListSubTreeAdditionalProps & (SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList) & ({} | { + listComponent: ComponentType; + listProps?: ListProps; +}); + +// @public (undocumented) +export type EntityProps = EntityBaseProps; + +// @public (undocumented) +export interface EntityProviderProps { + // (undocumented) + accessor: EntityAccessor; + // (undocumented) + children: ReactNode; +} + +// @public +export const EntitySubTree: (pros: EntitySubTreeProps) => ReactElement; + +// @public (undocumented) +export type EntitySubTreeAdditionalCreationProps = {} | SetOrderFieldOnCreateOwnProps; + +// @public (undocumented) +export interface EntitySubTreeAdditionalProps { + // (undocumented) + variables?: Environment.ValuesMapWithFactory; +} + +// @public (undocumented) +export type EntitySubTreeProps = { + treeRootId?: TreeRootId; + children?: ReactNode; +} & EntitySubTreeAdditionalProps & (SugaredQualifiedSingleEntity | (SugaredUnconstrainedQualifiedSingleEntity & EntitySubTreeAdditionalCreationProps)); + +// @public (undocumented) +export function EntityView(props: EntityViewProps): JSX.Element; + +// @public (undocumented) +export interface EntityViewProps { + // (undocumented) + field?: string | SugaredRelativeSingleEntity; + // (undocumented) + render: (entity: EntityAccessor) => ReactNode; +} + +// @public (undocumented) +export interface EnvironmentAwareFunctionComponent

{ + // (undocumented) + (props: PropsWithChildren

, environment: Environment): ReactElement | null; + // (undocumented) + displayName?: string | undefined; +} + +// @public (undocumented) +export const EnvironmentContext: Context; + +// @public (undocumented) +export interface EnvironmentDeltaProvider { + // (undocumented) + generateEnvironment: (props: Props, oldEnvironment: Environment) => Environment; +} + +// @public (undocumented) +export const EnvironmentExtensionProvider: (props: EnvironmentWithExtensionProps) => ReactElement | null; + +// @public (undocumented) +export const EnvironmentMiddleware: NamedExoticComponent; + +// @public (undocumented) +export interface EnvironmentMiddlewareProps { + // (undocumented) + children: ReactNode; + // (undocumented) + create: (env: Environment) => Environment; +} + +// @public (undocumented) +export interface EnvironmentWithExtensionProps { + // (undocumented) + children: ReactNode; + // (undocumented) + extension: Environment.Extension; + // (undocumented) + state: S; +} + +// @public (undocumented) +export interface ErrorAccessorTreeState { + // (undocumented) + binding: DataBinding; + // (undocumented) + environment: Environment; + // (undocumented) + error: RequestError; + // (undocumented) + name: 'error'; +} + +// @public (undocumented) +export const Field: (props: FieldProps) => ReactElement; + +// @public (undocumented) +export interface FieldBasicProps extends SugaredRelativeSingleField { +} + +// @public (undocumented) +export interface FieldProps extends FieldBasicProps, FieldRuntimeProps { +} + +// @public (undocumented) +export interface FieldRuntimeProps { + // (undocumented) + format?: (value: Persisted | null) => ReactNode; +} + +// @public +export const FieldView: FieldViewComponentSignature; + +// @public (undocumented) +export interface FieldViewCommonProps { + // (undocumented) + fallbackIfUnpersisted?: ReactNode; +} + +// @public (undocumented) +export type FieldViewComponentSignature = { + (props: FieldViewCommonProps & { + field: string | SugaredRelativeSingleField; + render: (field1: FieldAccessor) => ReactNode; + }): ReactElement | null; + (props: FieldViewCommonProps & { + fields: [string | SugaredRelativeSingleField]; + render: (field1: FieldAccessor) => ReactNode; + }): ReactElement | null; + (props: FieldViewCommonProps & { + fields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]; + render: (field1: FieldAccessor, field2: FieldAccessor) => ReactNode; + }): ReactElement | null; + (props: FieldViewCommonProps & { + fields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]; + render: (field1: FieldAccessor, field2: FieldAccessor, field3: FieldAccessor) => ReactNode; + }): ReactElement | null; + (props: FieldViewCommonProps & { + fields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]; + render: (field1: FieldAccessor, field2: FieldAccessor, field3: FieldAccessor, field4: FieldAccessor) => ReactNode; + }): ReactElement | null; + (props: FieldViewCommonProps & { + fields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]; + render: (field1: FieldAccessor, field2: FieldAccessor, field3: FieldAccessor, field4: FieldAccessor, field5: FieldAccessor) => ReactNode; + }): ReactElement | null; + (props: FieldViewProps): ReactElement | null; +}; + +// @public (undocumented) +export type FieldViewProps = FieldViewCommonProps & ({ + render: (...accessors: FieldAccessor[]) => ReactNode; + field: string | SugaredRelativeSingleField; +} | { + render: (...accessors: FieldAccessor[]) => ReactNode; + fields: Array; +}); + +// @public (undocumented) +export type ForceAccessorUpdate = () => void; + +// @public (undocumented) +export const HasMany: (props: HasManyProps) => ReactElement; + +// @public (undocumented) +export type HasManyProps = SugaredRelativeEntityList & { + children?: ReactNode; + variables?: Environment.ValuesMapWithFactory; +} & ({} | { + listComponent: ComponentType; + listProps?: ListProps; +}); + +// @public (undocumented) +export const HasOne: (props: HasOneProps) => ReactElement; + +// @public (undocumented) +export type HasOneProps = SugaredRelativeSingleEntity & { + children?: ReactNode; + variables?: Environment.ValuesMapWithFactory; +}; + +// @public (undocumented) +export const If: NamedExoticComponent; + +// @public (undocumented) +export interface IfCallbackProps { + // (undocumented) + children?: ReactNode; + // (undocumented) + condition: (accessor: EntityAccessor) => boolean; +} + +// @public (undocumented) +export interface IfFilterProps { + // (undocumented) + children?: ReactNode; + // (undocumented) + condition: string | Filter; +} + +// @public (undocumented) +export type IfProps = IfFilterProps | IfCallbackProps; + +// @public (undocumented) +export interface InitializedAccessorTreeState { + // (undocumented) + binding: DataBinding; + // (undocumented) + data: TreeRootAccessor; + // (undocumented) + environment: Environment; + // (undocumented) + name: 'initialized'; +} + +// @public (undocumented) +export interface InitializingAccessorTreeState { + // (undocumented) + binding?: DataBinding; + // (undocumented) + environment: Environment; + // (undocumented) + name: 'initializing'; +} + +// @public (undocumented) +export type LabelMiddleware = (label: ReactNode, environment: Environment) => ReactNode; + +// @public (undocumented) +export const LabelMiddlewareContext: Context; + +// @public (undocumented) +export const LabelMiddlewareProvider: ({ value, children }: { + value: LabelMiddleware; + children: ReactNode; +}) => JSX.Element; + +// @public (undocumented) +export interface LeafMarkerProvider { + // (undocumented) + generateLeafMarker: (props: Props, environment: Environment) => FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer; +} + +// @public (undocumented) +export type MarkerProvider = Partial>; + +// @public (undocumented) +export class MarkerTreeGenerator { + constructor(sourceTree: ReactNode, environment?: Environment); + // (undocumented) + generate(): MarkerTreeRoot; +} + +// @public (undocumented) +export const moveEntity: (entityList: EntityListAccessor, sortByField: RelativeSingleField, oldIndex: number, newIndex: number) => void; + +// @public (undocumented) +export const moveEntityInArray: (entities: EntityAccessor[], getAccessor: EntityListAccessor.GetEntityListAccessor, sortByField: RelativeSingleField, oldIndex: number, newIndex: number) => EntityAccessor[]; + +// @public (undocumented) +export const MutationStateContext: Context; + +// @public (undocumented) +export const ParentEntity: NamedExoticComponent; + +// @public (undocumented) +export interface ParentEntityProps extends SugaredParentEntityParameters { + // (undocumented) + children?: ReactNode; +} + +// @public (undocumented) +export const repairEntitiesOrder: (sortableByField: RelativeSingleField, sortedEntities: EntityAccessor[]) => void; + +// @public (undocumented) +export const SetOrderFieldOnCreate: NamedExoticComponent; + +// @public (undocumented) +export interface SetOrderFieldOnCreateOwnProps { + // (undocumented) + newOrderFieldValue?: number; + // (undocumented) + orderField: SugaredRelativeSingleField | string; +} + +// @public (undocumented) +export interface SetOrderFieldOnCreateProps extends SetOrderFieldOnCreateOwnProps, Pick { +} + +// @public (undocumented) +export interface SortedEntities { + // (undocumented) + addNewAtIndex: (index: number | undefined, preprocess?: EntityAccessor.BatchUpdatesHandler) => void; + // (undocumented) + appendNew: (initialize?: EntityAccessor.BatchUpdatesHandler) => void; + // (undocumented) + entities: EntityAccessor[]; + // (undocumented) + moveEntity: (oldIndex: number, newIndex: number) => void; + // (undocumented) + prependNew: (initialize?: EntityAccessor.BatchUpdatesHandler) => void; +} + +// @public (undocumented) +export const sortEntities: (entities: EntityAccessor[], sortByField: RelativeSingleField | undefined) => EntityAccessor[]; + +// @public (undocumented) +export const StaticRender: NamedExoticComponent; + +// @public (undocumented) +export interface StaticRenderProps { + // (undocumented) + children?: ReactNode; +} + +// @public (undocumented) +export interface StaticRenderProvider { + // (undocumented) + staticRender: (props: StaticRenderProviderProps, environment: Environment) => ReactElement | null; +} + +// @public (undocumented) +export type StaticRenderProviderProps = [ +NonStaticPropNames +] extends [never] ? Props : Omit; + +// @public (undocumented) +export const SugaredField: (props: SugaredFieldProps) => ReactElement; + +// @public (undocumented) +export interface SugaredFieldProps extends Omit, 'field'> { + // (undocumented) + field: string | SugaredRelativeSingleField; +} + +// @public (undocumented) +export function TreeRootIdProvider(props: TreeRootIdProviderProps): JSX.Element; + +// @public (undocumented) +export interface TreeRootIdProviderProps { + // (undocumented) + children: ReactNode; + // (undocumented) + treeRootId: TreeRootId | undefined; +} + +// @public (undocumented) +export const useAccessorTreeState: () => AccessorTreeState; + +// @public +export function useAccessorUpdateSubscription(getFieldAccessor: () => FieldAccessor): FieldAccessor; + +// @public (undocumented) +export function useAccessorUpdateSubscription(getEntityAccessor: () => EntityAccessor): EntityAccessor; + +// @public (undocumented) +export function useAccessorUpdateSubscription(getListAccessor: () => EntityListAccessor): EntityListAccessor; + +// @public (undocumented) +export function useAccessorUpdateSubscription(getAccessor: () => EntityListAccessor | EntityAccessor): EntityListAccessor | EntityAccessor; + +// @public (undocumented) +export function useAccessorUpdateSubscription(getFieldAccessor: () => FieldAccessor, withForceUpdate: true): [FieldAccessor, ForceAccessorUpdate]; + +// @public (undocumented) +export function useAccessorUpdateSubscription(getEntityAccessor: () => EntityAccessor, withForceUpdate: true): [EntityAccessor, ForceAccessorUpdate]; + +// @public (undocumented) +export function useAccessorUpdateSubscription(getListAccessor: () => EntityListAccessor, withForceUpdate: true): [EntityListAccessor, ForceAccessorUpdate]; + +// @public (undocumented) +export function useAccessorUpdateSubscription(getAccessor: () => EntityListAccessor | EntityAccessor, withForceUpdate: true): [EntityListAccessor | EntityAccessor, ForceAccessorUpdate]; + +// @public (undocumented) +export const useBindingOperations: () => BindingOperations; + +// @public (undocumented) +export const useDataBinding: ({ children, refreshOnPersist, skipStateUpdateAfterPersist, }: AccessorTreeStateOptions) => AccessorTreeState; + +// @public @deprecated +export const useDerivedField: (sourceField: string | SugaredRelativeSingleField, derivedField: string | SugaredRelativeSingleField, transform?: (sourceValue: SourceValue | null) => SourceValue | null, agent?: string) => void; + +// @public @deprecated (undocumented) +export function useDesugaredRelativeEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): RelativeEntityList; + +// @public @deprecated (undocumented) +export function useDesugaredRelativeEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined): RelativeEntityList | undefined; + +// @public @deprecated (undocumented) +export function useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): RelativeSingleEntity; + +// @public @deprecated (undocumented) +export function useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined): RelativeSingleEntity | undefined; + +// @public @deprecated (undocumented) +export function useDesugaredRelativeSingleField(sugaredRelativeSingleField: string | SugaredRelativeSingleField): RelativeSingleField; + +// @public @deprecated (undocumented) +export function useDesugaredRelativeSingleField(sugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined): RelativeSingleField | undefined; + +// @public (undocumented) +export const useDirtinessState: () => boolean; + +// @public (undocumented) +export function useEntity(): EntityAccessor; + +// @public (undocumented) +export function useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor; + +// @public (undocumented) +export function useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined): EntityAccessor | undefined; + +// @public (undocumented) +export const useEntityBeforePersist: (listener: EntityAccessor.EntityEventListenerMap['beforePersist']) => void; + +// @public (undocumented) +export const useEntityBeforeUpdate: (listener: EntityAccessor.EntityEventListenerMap['beforeUpdate']) => void; + +// @public (undocumented) +export function useEntityEvent(type: 'beforePersist', listener: EntityAccessor.EntityEventListenerMap['beforePersist']): void; + +// @public (undocumented) +export function useEntityEvent(type: 'beforeUpdate', listener: EntityAccessor.EntityEventListenerMap['beforeUpdate']): void; + +// @public (undocumented) +export function useEntityEvent(type: 'connectionUpdate', hasOneField: FieldName, listener: EntityAccessor.EntityEventListenerMap['connectionUpdate']): void; + +// @public (undocumented) +export function useEntityEvent(type: 'persistError', listener: EntityAccessor.EntityEventListenerMap['persistError']): void; + +// @public (undocumented) +export function useEntityEvent(type: 'persistSuccess', listener: EntityAccessor.EntityEventListenerMap['persistSuccess']): void; + +// @public (undocumented) +export function useEntityEvent(type: 'update', listener: EntityAccessor.EntityEventListenerMap['update']): void; + +// @public (undocumented) +export const useEntityKey: () => string; + +// @public (undocumented) +export function useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor; + +// @public (undocumented) +export function useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined): EntityListAccessor | undefined; + +// @public (undocumented) +export const useEntityListSubTree: (qualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList, ...treeId: [TreeRootId | undefined] | [ +]) => EntityListAccessor; + +// @public (undocumented) +export function useEntityListSubTreeParameters(alias: Alias): Alias; + +// @public (undocumented) +export function useEntityListSubTreeParameters(qualifiedEntityList: SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList): SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList; + +// @public (undocumented) +export function useEntityListSubTreeParameters(qualifiedEntityListOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList; + +// @public (undocumented) +export const useEntityPersistError: (listener: EntityAccessor.EntityEventListenerMap['persistError']) => void; + +// @public (undocumented) +export const useEntityPersistSuccess: (listener: EntityAccessor.EntityEventListenerMap['persistSuccess']) => void; + +// @public (undocumented) +export const useEntitySubTree: (qualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity, ...treeId: [TreeRootId | undefined] | [ +]) => EntityAccessor; + +// @public (undocumented) +export function useEntitySubTreeParameters(alias: Alias): Alias; + +// @public (undocumented) +export function useEntitySubTreeParameters(qualifiedEntity: SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity): SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity; + +// @public (undocumented) +export function useEntitySubTreeParameters(qualifiedSingleEntityOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity): Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity; + +// @public (undocumented) +export const useEnvironment: () => Environment; + +// @public (undocumented) +export const useExtendTree: () => (newFragment: ReactNode, options?: Omit) => Promise; + +// @public (undocumented) +export function useField(sugaredRelativeSingleField: string | SugaredRelativeSingleField): FieldAccessor; + +// @public (undocumented) +export function useField(sugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined): FieldAccessor | undefined; + +// @public (undocumented) +export const useGetEntityByKey: () => GetEntityByKey; + +// @public (undocumented) +export const useGetEntityListSubTree: () => (parametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList, ...treeId: [TreeRootId | undefined] | [ +]) => EntityListAccessor; + +// @public (undocumented) +export const useGetEntitySubTree: () => (parametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity, ...treeId: [TreeRootId | undefined] | [ +]) => EntityAccessor; + +// @public (undocumented) +export const useGetTreeFilters: () => (() => TreeFilter[]); + +// @public (undocumented) +export const useHasEntity: () => boolean; + +// @public (undocumented) +export const useLabelMiddleware: () => (it: ReactNode) => ReactNode; + +// @public (undocumented) +export const useMutationState: () => boolean; + +// @public (undocumented) +export const useOnConnectionUpdate: (fieldName: FieldName, listener: EntityAccessor.EntityEventListenerMap['connectionUpdate']) => void; + +// @public (undocumented) +export const usePersist: () => Persist; + +// @public (undocumented) +export const useSortedEntities: (entityList: EntityListAccessor, sortableByField: SugaredFieldProps['field'] | undefined) => SortedEntities; + +// @public (undocumented) +export const useTreeRootId: () => TreeRootId | undefined; + + +export * from "@contember/binding"; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-choice-field-ui.api.md b/build/api/react-choice-field-ui.api.md new file mode 100644 index 0000000000..59e3c6e6b3 --- /dev/null +++ b/build/api/react-choice-field-ui.api.md @@ -0,0 +1,116 @@ +## API Report File for "@contember/react-choice-field-ui" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +/// + +import { BaseDynamicChoiceField } from '@contember/react-choice-field'; +import { ChoiceFieldProps } from '@contember/react-choice-field'; +import { ComponentType } from 'react'; +import { DynamicMultiChoiceFieldRendererProps } from '@contember/react-choice-field'; +import { DynamicMultipleChoiceFieldProps } from '@contember/react-choice-field'; +import { DynamicSingleChoiceFieldProps } from '@contember/react-choice-field'; +import { FieldContainerProps } from '@contember/ui'; +import { MemoExoticComponent } from 'react'; +import type { Props } from 'react-select'; +import { PublicCommonReactSelectStylesProps } from '@contember/ui'; +import type { RadioProps } from '@contember/ui'; +import { ReactElement } from 'react'; +import { SimpleDynamicSingleChoiceFieldProps } from '@contember/react-choice-field'; +import { SingleChoiceFieldRendererProps } from '@contember/react-choice-field'; +import { StaticSingleChoiceFieldProps } from '@contember/react-choice-field'; + +// @public (undocumented) +export type ChoiceFieldDictionary = typeof choiceFieldDictionary; + +// @public (undocumented) +export const choiceFieldDictionary: { + choiceField: { + createNew: { + confirmButtonText: string; + cancelButtonText: string; + dialogTitle: string; + }; + }; +}; + +// @public (undocumented) +export const MultiSelectField: ComponentType; + +// @internal (undocumented) +export const MultiSelectFieldInner: MemoExoticComponent<({ currentValues, data, errors, onAdd, onClear, onRemove, reactSelectProps, placeholder, menuZIndex, onMove, onSearch, isLoading, createNewForm, onAddNew, ...props }: MultiSelectFieldInnerProps) => JSX.Element>; + +// @public (undocumented) +export type MultiSelectFieldInnerProps = DynamicMultiChoiceFieldRendererProps & MultiSelectFieldRendererPublicProps & { + onAddNew?: () => void; +}; + +// @public (undocumented) +export type MultiSelectFieldProps = MultiSelectFieldRendererPublicProps & DynamicMultipleChoiceFieldProps; + +// @internal (undocumented) +export const MultiSelectFieldRenderer: MemoExoticComponent<(props: MultiSelectFieldRendererProps) => JSX.Element>; + +// @public (undocumented) +export type MultiSelectFieldRendererProps = MultiSelectFieldInnerProps & BaseDynamicChoiceField; + +// @public (undocumented) +export type MultiSelectFieldRendererPublicProps = Pick & PublicCommonReactSelectStylesProps & { + placeholder?: string; + reactSelectProps?: Partial>; + createNewForm?: ReactElement; +}; + +export { PublicCommonReactSelectStylesProps } + +// @public (undocumented) +export const RadioField: ComponentType; + +// @public (undocumented) +export type RadioFieldProps = RadioFieldRendererPublicProps & (StaticSingleChoiceFieldProps | SimpleDynamicSingleChoiceFieldProps); + +// @public (undocumented) +export const RadioFieldRenderer: MemoExoticComponent<((props: RadioFieldRendererProps) => JSX.Element)>; + +// @public (undocumented) +export type RadioFieldRendererProps = SingleChoiceFieldRendererProps & RadioFieldRendererPublicProps; + +// @public (undocumented) +export type RadioFieldRendererPublicProps = Omit & Pick; + +// @public (undocumented) +export const SelectField: ComponentType; + +// @public (undocumented) +export const SelectFieldInner: ({ placeholder, allowNull, currentValue, data, errors, menuZIndex, onSelect, onClear, reactSelectProps, onSearch, isLoading, createNewForm, onAddNew, ...props }: SelectFieldInnerProps) => JSX.Element; + +// @public (undocumented) +export type SelectFieldInnerProps = SingleChoiceFieldRendererProps & SelectFieldRendererPublicProps & { + onAddNew?: () => void; +}; + +// @public (undocumented) +export type SelectFieldProps = SelectFieldRendererPublicProps & (StaticSingleChoiceFieldProps | DynamicSingleChoiceFieldProps); + +// @internal (undocumented) +export const SelectFieldRenderer: MemoExoticComponent<(({ createNewForm, ...props }: SelectFieldRendererProps) => JSX.Element)>; + +// @public (undocumented) +export type SelectFieldRendererProps = SelectFieldInnerProps & ChoiceFieldProps; + +// @public (undocumented) +export type SelectFieldRendererPublicProps = Omit & PublicCommonReactSelectStylesProps & { + placeholder?: string; + allowNull?: boolean; + reactSelectProps?: Partial>; + createNewForm?: ReactElement; +}; + + +export * from "@contember/react-choice-field"; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-choice-field.api.md b/build/api/react-choice-field.api.md new file mode 100644 index 0000000000..032e5c8efb --- /dev/null +++ b/build/api/react-choice-field.api.md @@ -0,0 +1,282 @@ +## API Report File for "@contember/react-choice-field" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { ComponentType } from 'react'; +import { EntityAccessor } from '@contember/react-binding'; +import { EntityId } from '@contember/react-binding'; +import { Environment } from '@contember/react-binding'; +import { ErrorAccessor } from '@contember/react-binding'; +import { FieldValue } from '@contember/react-binding'; +import { Filter } from '@contember/react-binding'; +import type { FunctionComponent } from 'react'; +import { default as Fuse_2 } from 'fuse.js'; +import { NamedExoticComponent } from 'react'; +import { OptionallyVariableFieldValue } from '@contember/react-binding'; +import { QualifiedEntityList } from '@contember/react-binding'; +import { QualifiedFieldList } from '@contember/react-binding'; +import { ReactElement } from 'react'; +import { ReactNode } from 'react'; +import { SugarableRelativeSingleField } from '@contember/react-binding'; +import { SugaredFieldProps } from '@contember/react-binding'; +import { SugaredQualifiedEntityList } from '@contember/react-binding'; +import { SugaredQualifiedFieldList } from '@contember/react-binding'; +import { SugaredRelativeEntityList } from '@contember/react-binding'; +import { SugaredRelativeSingleEntity } from '@contember/react-binding'; +import { SugaredRelativeSingleField } from '@contember/react-binding'; +import { UnsugarableFieldEventListeners } from '@contember/react-binding'; + +// @public (undocumented) +export type AllDynamicMultiChoiceFieldRendererProps = DynamicMultiChoiceFieldRendererProps & DynamicMultipleChoiceFieldProps & RendererOwnProps; + +// @public (undocumented) +export type AllStaticSingleChoiceFieldRendererProps = StaticSingleChoiceFieldProps & SingleChoiceFieldRendererProps & OwnRendererProps; + +// @public (undocumented) +export interface BaseChoiceFieldRendererProps { + // (undocumented) + data: ChoiceFieldOptions; + // (undocumented) + errors: ErrorAccessor.Error[] | undefined; + // (undocumented) + isLoading?: boolean; + // (undocumented) + onSearch?: (input: string) => void; +} + +// @public (undocumented) +export type BaseDynamicChoiceField = BaseDynamicChoiceFieldOptions & SelectFuseOptionsProps & { + searchByFields?: ChoiceFieldSearchByFields; + lazy?: LazyChoiceFieldSettings; + renderedOptionsLimit?: number; + transformOptions?: (data: ChoiceFieldOptions, input: string | undefined) => ChoiceFieldOptions; + sortableBy?: SugaredFieldProps['field']; +}; + +// @public (undocumented) +export type BaseDynamicChoiceFieldOptions = DynamicChoiceFieldOptionProps | DynamicChoiceFieldWithCustomLabelProps | LegacyChoiceFieldWithOptionRenderer; + +// @public (undocumented) +export namespace ChoiceFieldData { + // @deprecated (undocumented) + export type BaseChoiceFieldMetadata = BaseChoiceFieldRendererProps; + // @deprecated (undocumented) + export type MultiChoiceFieldMetadata = MultiChoiceFieldRendererProps; + // @deprecated (undocumented) + export type Options = ChoiceFieldOptions; + // @deprecated (undocumented) + export type SingleChoiceFieldMetadata = SingleChoiceFieldRendererProps; + // @deprecated (undocumented) + export type SingleOption = ChoiceFieldSingleOption; +} + +// @public (undocumented) +export type ChoiceFieldOptions = ChoiceFieldSingleOption[]; + +// @public (undocumented) +export type ChoiceFieldOptionsAsEntityList = string | (SugaredQualifiedEntityList['entities'] & ForbidKeys) | (SugaredQualifiedEntityList & ForbidKeys); + +// @public (undocumented) +export type ChoiceFieldOptionsAsFieldList = string | (SugaredQualifiedFieldList['fields'] & ForbidKeys) | (SugaredQualifiedFieldList & ForbidKeys); + +// @public (undocumented) +export type ChoiceFieldProps = StaticSingleChoiceFieldProps | DynamicSingleChoiceFieldProps; + +// @public (undocumented) +export type ChoiceFieldSearchByFields = SugaredRelativeSingleField['field'] | SugaredRelativeSingleField['field'][]; + +// @public (undocumented) +export interface ChoiceFieldSingleOption { + // (undocumented) + description?: ReactNode; + // (undocumented) + key: string; + // (undocumented) + label: ReactNode; + // (undocumented) + searchKeywords: string; + // (undocumented) + value: Value; +} + +// @public (undocumented) +export const createChoiceField: ({ FieldRenderer }: { + FieldRenderer: ComponentType | AllStaticSingleChoiceFieldRendererProps>; +}) => FunctionComponent; + +// @public (undocumented) +export const createDynamicMultiChoiceField: ({ FieldRenderer }: { + FieldRenderer: ComponentType>; +}) => NamedExoticComponent>; + +// @public (undocumented) +export const createStaticSingleChoiceField: ({ FieldRenderer }: { + FieldRenderer: ComponentType>; +}) => NamedExoticComponent & { +options: OptionallyVariableStaticOption[]; +} & Omit>>; + +// @public (undocumented) +export type DesugaredOptionPath = QualifiedFieldList | QualifiedEntityList; + +// @public (undocumented) +export type DynamicChoiceFieldOptionProps = { + options: ChoiceFieldOptionsAsFieldList; +}; + +// @public (undocumented) +export type DynamicChoiceFieldWithCustomLabelProps = { + options: ChoiceFieldOptionsAsEntityList; + optionLabel: ReactNode; +}; + +// @public (undocumented) +export type DynamicMultiChoiceFieldRendererProps = MultiChoiceFieldRendererProps; + +// @public (undocumented) +export type DynamicMultipleChoiceFieldProps = SugaredRelativeEntityList & BaseDynamicChoiceField & ({} | DynamicMultipleChoiceWithConnectingEntityFieldProps); + +// @public (undocumented) +export interface DynamicMultipleChoiceWithConnectingEntityFieldProps { + // (undocumented) + connectingEntityField: string | SugaredRelativeSingleEntity; +} + +// @public (undocumented) +export type DynamicSingleChoiceFieldProps = SugaredRelativeSingleEntity & BaseDynamicChoiceField; + +// @public (undocumented) +export type ForbidKeys = { + [K in Exclude]?: never; +}; + +// @public (undocumented) +export type LazyChoiceFieldSettings = undefined | boolean | { + limit?: number; + initialLimit?: number; + createFilter?: (input: string) => Filter; + inputDebounceDelay?: number; +}; + +// @public @deprecated (undocumented) +export interface LegacyChoiceFieldWithOptionRenderer { + // (undocumented) + options: string | SugaredQualifiedEntityList['entities'] | SugaredQualifiedEntityList; + // (undocumented) + optionsStaticRender: ReactElement | ((environment: Environment) => ReactElement); + // (undocumented) + renderOption: (entityAccessor: EntityAccessor) => ReactNode; +} + +// @public (undocumented) +export interface MultiChoiceFieldRendererProps extends BaseChoiceFieldRendererProps { + // (undocumented) + currentValues: ChoiceFieldSingleOption[]; + // (undocumented) + onAdd: (option: Value) => void; + // (undocumented) + onClear: () => void; + // (undocumented) + onMove?: (oldIndex: number, newIndex: number) => void; + // (undocumented) + onRemove: (option: Value) => void; +} + +// @public (undocumented) +export interface NormalizedStaticOption extends StaticOption { + // (undocumented) + searchKeywords: string; + // (undocumented) + value: FieldValue; +} + +// @public (undocumented) +export interface OptionallyVariableStaticOption extends StaticOption { + // (undocumented) + searchKeywords?: string; + // (undocumented) + value: OptionallyVariableFieldValue; +} + +// @public (undocumented) +export const renderDynamicChoiceFieldStatic: (props: BaseDynamicChoiceField, environment: Environment, filter?: Filter | undefined) => { + listSubTree: ReactElement; + renderedOption: ReactElement; +}; + +// @public (undocumented) +export interface SelectFuseOptionsProps { + // (undocumented) + fuseOptions?: Fuse_2.IFuseOptions> | boolean; +} + +// @public (undocumented) +export interface SelectOptions { + // (undocumented) + allOptions: ChoiceFieldOptions; + // (undocumented) + isLoading: boolean; + // (undocumented) + onSearch: (input: string) => void; + // (undocumented) + options: ChoiceFieldOptions; +} + +// @public (undocumented) +export type SimpleDynamicSingleChoiceFieldProps = SugaredRelativeSingleEntity & BaseDynamicChoiceFieldOptions & Pick; + +// @public (undocumented) +export interface SingleChoiceFieldRendererProps extends BaseChoiceFieldRendererProps { + // (undocumented) + currentValue: ChoiceFieldSingleOption | null; + // (undocumented) + onClear: () => void; + // (undocumented) + onSelect: (newValue: Value) => void; +} + +// @public (undocumented) +export interface StaticOption { + // (undocumented) + description?: ReactNode; + // (undocumented) + label: ReactNode; +} + +// @public (undocumented) +export type StaticSingleChoiceFieldProps = SugaredRelativeSingleField & SelectFuseOptionsProps & { + options: OptionallyVariableStaticOption[]; +}; + +// @public (undocumented) +export const useCurrentlyChosenEntities: (optionProps: BaseDynamicChoiceField, ids: EntityId[]) => EntityAccessor[]; + +// @public (undocumented) +export const useDesugaredOptionPath: (props: BaseDynamicChoiceField, filter: Filter | undefined) => DesugaredOptionPath; + +// @public (undocumented) +export const useDynamicMultipleChoiceField: (props: DynamicMultipleChoiceFieldProps) => DynamicMultiChoiceFieldRendererProps; + +// @public (undocumented) +export const useDynamicSingleChoiceField: (props: DynamicSingleChoiceFieldProps) => SingleChoiceFieldRendererProps; + +// @public (undocumented) +export const useSelectOptions: (optionProps: BaseDynamicChoiceField, additionalAccessors?: EntityAccessor[]) => SelectOptions; + +// @public (undocumented) +export const useStaticSingleChoiceField: (props: StaticSingleChoiceFieldProps) => SingleChoiceFieldRendererProps; + +// Warnings were encountered during analysis: +// +// src/ChoiceField.tsx:15:31 - (ae-forgotten-export) The symbol "AllDynamicSingleChoiceFieldRenderer" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-datagrid-ui.api.md b/build/api/react-datagrid-ui.api.md new file mode 100644 index 0000000000..ad772400cb --- /dev/null +++ b/build/api/react-datagrid-ui.api.md @@ -0,0 +1,470 @@ +## API Report File for "@contember/react-datagrid-ui" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +/// + +import { BooleanCellRendererProps } from '@contember/react-datagrid'; +import { BooleanFilterArtifacts } from '@contember/react-datagrid'; +import { CoalesceCellRendererProps } from '@contember/react-datagrid'; +import { CoalesceFieldViewProps } from '@contember/react-binding-ui'; +import { CoalesceTextFilterArtifacts } from '@contember/react-datagrid'; +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 { DataGridProps } from '@contember/react-datagrid'; +import { DataGridRendererInnerProps } from '@contember/react-datagrid'; +import { DataGridRendererProps } from '@contember/react-datagrid'; +import { DateCellRendererProps } from '@contember/react-datagrid'; +import { DateFieldViewFormattingProps } from '@contember/react-binding-ui'; +import { DateRangeFilterArtifacts } from '@contember/react-datagrid'; +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 { 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 { HasManySelectProps } from '@contember/react-datagrid'; +import { HasOneSelectProps } from '@contember/react-datagrid'; +import { Justification } from '@contember/ui'; +import { MemoExoticComponent } from 'react'; +import { NamedExoticComponent } from 'react'; +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 { 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'; + +// @public +export const BooleanCell: FunctionComponent ReactNode) | undefined; +} & FieldFallbackViewProps>; + +// @public (undocumented) +export const BooleanCellFilter: ({ setFilter, filter }: FilterRendererProps) => JSX.Element; + +// @public +export const CoalesceTextCell: 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; + +// @public +export const DataGrid: ComponentType>>>; + +// @public (undocumented) +export interface DataGridCellPublicProps { + // (undocumented) + canBeHidden?: boolean; + // (undocumented) + hidden?: boolean; + // (undocumented) + justification?: Justification; + // (undocumented) + shrunk?: boolean; +} + +// @public (undocumented) +export type DataGridCellsDictionary = typeof dataGridCellsDictionary; + +// @public (undocumented) +export const dataGridCellsDictionary: { + dataGridCells: { + includeNull: string; + booleanCell: { + includeTrue: string; + includeFalse: string; + includeNull: string; + }; + dateCell: { + fromLabel: string; + toLabel: string; + }; + textCell: { + matches: string; + doesNotMatch: string; + matchesExactly: string; + startsWith: string; + endsWith: string; + queryPlaceholder: string; + includeNull: string; + excludeNull: string; + }; + numberCell: { + equals: string; + greaterThan: string; + lessThan: string; + }; + }; +}; + +// @public (undocumented) +export const DataGridColumnHiding: ({ desiredState, displayedState, stateMethods: { setIsColumnHidden }, allowColumnVisibilityControls, }: DataGridColumnHidingProps) => ReactElement | null; + +// @public (undocumented) +export type DataGridColumnHidingProps = DataGridRenderingCommonProps & DataGridColumnHidingPublicProps; + +// @public (undocumented) +export type DataGridColumnHidingPublicProps = { + allowColumnVisibilityControls?: boolean; +}; + +// @public (undocumented) +export type DataGridColumnPublicProps = DataGridCellPublicProps & DataGridHeaderCellPublicProps; + +// @public (undocumented) +export const DataGridContainer: NamedExoticComponent | undefined; +} & DataGridTableRowPublicProps & EntityListBaseProps & DataGridTilesPublicProps & DataGridRenderingCommonProps>; + +// @public (undocumented) +export type DataGridContainerProps = typeof DataGridContainer extends ComponentType ? P : never; + +// @public (undocumented) +export type DataGridContainerPublicProps = Omit; + +// @public (undocumented) +export const DataGridContent: ComponentType<{ + emptyMessage?: ReactNode; + emptyMessageComponent?: ComponentType | undefined; +} & DataGridTableRowPublicProps & EntityListBaseProps & DataGridTilesPublicProps & DataGridRenderingCommonProps>; + +// @public (undocumented) +export type DataGridDictionary = typeof dataGridDictionary; + +// @public (undocumented) +export const dataGridDictionary: { + dataGrid: { + emptyMessage: { + text: string; + }; + columnFiltering: { + showMenuButton: { + text: string; + }; + heading: string; + emptyMessage: { + text: string; + }; + columnColumn: { + text: string; + }; + filterColumn: { + text: string; + }; + addFilterButton: { + text: string; + }; + }; + columnHiding: { + showMenuButton: { + text: string; + }; + heading: string; + }; + paging: { + first: string; + previous: string; + next: string; + last: string; + status: { + unknownPageTotal: string; + knownPageTotal: string; + itemCount: string; + }; + }; + }; +}; + +// @public (undocumented) +export const DataGridFooter: NamedExoticComponent; + +// @public (undocumented) +export type DataGridFooterProps = DataGridFooterPublicProps & DataGridRenderingCommonProps; + +// @public (undocumented) +export type DataGridFooterPublicProps = {}; + +// @public (undocumented) +export function DataGridFullFilters({ desiredState, stateMethods, allowAggregateFilterControls, }: DataGridFullFiltersProps): ReactElement | null; + +// @public (undocumented) +export type DataGridFullFiltersProps = DataGridRenderingCommonProps & DataGridFullFiltersPublicProps; + +// @public (undocumented) +export type DataGridFullFiltersPublicProps = { + allowAggregateFilterControls?: boolean; +}; + +// @public (undocumented) +export const DataGridHeader: NamedExoticComponent; + +// @public (undocumented) +export function DataGridHeaderCell(props: DataGridHeaderCellProps): ReactElement; + +// @public (undocumented) +export const DataGridHeaderCellFilterDropdown: (props: DataGridHeaderCellFilterDropdownProps) => JSX.Element | null; + +// @public (undocumented) +export type DataGridHeaderCellFilterDropdownProps = DataGridRenderingCommonProps & { + columnKey: string; + column: DataGridColumnProps; +}; + +// @public (undocumented) +export type DataGridHeaderCellProps = DataGridRenderingCommonProps & { + columnKey: string; + column: DataGridColumnProps; +}; + +// @public (undocumented) +export interface DataGridHeaderCellPublicProps { + // (undocumented) + ascOrderIcon?: ReactNode; + // (undocumented) + descOrderIcon?: ReactNode; + // (undocumented) + header?: ReactNode; + // (undocumented) + headerJustification?: Justification; + // (undocumented) + shrunk?: boolean; +} + +// @public (undocumented) +export type DataGridHeaderProps = DataGridRenderingCommonProps & DataGridHeaderPublicProps; + +// @public (undocumented) +export type DataGridHeaderPublicProps = DataGridLayoutControlPublicProps & DataGridColumnHidingPublicProps & DataGridFullFiltersPublicProps; + +// @public (undocumented) +export const DataGridLayoutControl: ({ stateMethods: { setLayout }, desiredState: { layout }, tile }: DataGridLayoutControlProps) => JSX.Element | null; + +// @public (undocumented) +export type DataGridLayoutControlProps = DataGridRenderingCommonProps & DataGridLayoutControlPublicProps; + +// @public (undocumented) +export type DataGridLayoutControlPublicProps = { + tile?: ReactNode; +}; + +// @public (undocumented) +export const DataGridPagingSummary: ({ pagingInfo, displayedState: { paging: { pageIndex } } }: DataGridPagingSummaryProps) => JSX.Element; + +// @public (undocumented) +export type DataGridPagingSummaryProps = DataGridRenderingCommonProps; + +// @public (undocumented) +export type DataGridRenderingCommonProps = DataGridRendererInnerProps; + +// @public (undocumented) +export const DataGridTable: NamedExoticComponent; + +// @public (undocumented) +export type DataGridTableHead = DataGridRenderingCommonProps; + +// @public (undocumented) +export const DataGridTableHead: (props: DataGridTableHead) => JSX.Element; + +// @public (undocumented) +export type DataGridTableProps = DataGridRenderingCommonProps & DataGridTablePublicProps & EntityListBaseProps; + +// @public (undocumented) +export type DataGridTablePublicProps = { + emptyMessage?: ReactNode; + emptyMessageComponent?: ComponentType; +} & DataGridTableRowPublicProps; + +// @public (undocumented) +export const DataGridTableRow: ({ desiredState, displayedState, onEntityClick, isEntitySelected, selectedEntityIds }: DataGridTableRowProps) => JSX.Element; + +// @public (undocumented) +export type DataGridTableRowProps = DataGridRenderingCommonProps & DataGridTableRowPublicProps; + +// @public (undocumented) +export type DataGridTableRowPublicProps = { + onEntityClick?: (entity: EntityAccessor) => void; + isEntitySelected?: (entity: EntityAccessor) => boolean; + selectedEntityIds?: EntityId[]; +}; + +// @public (undocumented) +export const DataGridTiles: MemoExoticComponent<({ accessor, tileSize, tile, emptyMessage, emptyMessageComponent }: DataGridTilesProps) => JSX.Element>; + +// @public (undocumented) +export type DataGridTilesProps = DataGridRenderingCommonProps & DataGridTilesPublicProps; + +// @public (undocumented) +export type DataGridTilesPublicProps = { + tile?: ReactNode; + tileSize?: number; + emptyMessage?: ReactNode; + emptyMessageComponent?: ComponentType; +}; + +// @public +export const DateCell: FunctionComponent; + +// @public (undocumented) +export type DateCellValueRendererProps = DateCellRendererProps & DateFieldViewFormattingProps & FieldFallbackViewPublicProps; + +// @public +export const EnumCell: FunctionComponent; +format?: ((value: string | null) => ReactNode) | undefined; +initialFilter?: EnumCellFilterArtifacts | undefined; +} & DataGridCellPublicProps & DataGridHeaderCellPublicProps & FieldFallbackViewProps & { +format?: ((value: string | null) => ReactNode) | undefined; +} & NullConditionFilterPublicProps & { +options: Record; +}>; + +// @public (undocumented) +export const EnumCellFilter: ({ filter, setFilter, environment, field, options, showNullConditionFilter }: FilterRendererProps) => JSX.Element; + +// @public (undocumented) +export type EnumCellFilterExtraProps = NullConditionFilterPublicProps & EnumCellRendererProps & { + options: Record; +}; + +// @public (undocumented) +export type EnumCellValueRendererProps = EnumCellRendererProps & FieldFallbackViewPublicProps & { + format?: (value: string | null) => ReactNode; +}; + +// @public +export const GenericCell: FunctionComponent; + +// @public (undocumented) +export const GenericTextCellFilter: ({ filter, setFilter }: { + filter: Filter; + setFilter: (filter: Filter) => void; +}) => JSX.Element; + +// @public +export const HasManyAbsentCell: FunctionComponent; +children: ReactNode; +} & DataGridCellPublicProps & DataGridHeaderCellPublicProps>; + +// @public (undocumented) +export const HasManyAbsentCellFilter: ({ filter, setFilter }: FilterRendererProps) => JSX.Element; + +// @public +export const HasManySelectCell: FunctionComponent; + +// @public +export const HasOneSelectCell: FunctionComponent; + +// @public (undocumented) +export type NullConditionArtifacts = { + nullCondition: boolean; +}; + +// @public (undocumented) +export const NullConditionFilter: ({ filter, setFilter, field, environment, showNullConditionFilter }: NullConditionFilterProps) => JSX.Element | null; + +// @public (undocumented) +export type NullConditionFilterProps = FilterRendererProps & NullConditionFilterPublicProps & { + field: SugarableRelativeSingleField | string; +}; + +// @public (undocumented) +export type NullConditionFilterPublicProps = { + showNullConditionFilter?: boolean; +}; + +// @public +export const NumberCell: FunctionComponent ReactNode) | undefined; +} & NullConditionFilterPublicProps>; + +// @public (undocumented) +export const NumberCellFilter: ({ filter, setFilter, environment, field, showNullConditionFilter }: FilterRendererProps) => JSX.Element; + +// @public (undocumented) +export type NumberCellFilterExtraProps = NullConditionFilterPublicProps & NumberCellRendererProps; + +// @public (undocumented) +export type NumberCellValueRendererProps = NumberCellRendererProps & FieldFallbackViewPublicProps & { + format?: (value: number | null) => ReactNode; +}; + +// @public +export const SelectCellFilter: ({ filter, setFilter, options, allOptions, onSearch, isLoading }: SelectCellFilterProps) => JSX.Element; + +// @public (undocumented) +export type SelectCellFilterProps = FilterRendererProps & SelectCellFilterExtraProps; + +// @public +export const TextCell: FunctionComponent ReactNode) | undefined; +}>; + +// @public (undocumented) +export const TextCellFilter: ({ filter, setFilter, ...props }: FilterRendererProps) => JSX.Element; + +// @public (undocumented) +export type TextCellValueRendererProps = TextCellRendererProps & FieldFallbackViewPublicProps & { + format?: (value: string | null) => ReactNode; +}; + + +export * from "@contember/react-datagrid"; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-datagrid.api.md b/build/api/react-datagrid.api.md new file mode 100644 index 0000000000..f4baa02a6f --- /dev/null +++ b/build/api/react-datagrid.api.md @@ -0,0 +1,503 @@ +## API Report File for "@contember/react-datagrid" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { BaseDynamicChoiceField } from '@contember/react-choice-field'; +import { ComponentType } from 'react'; +import { EntityId } from '@contember/react-binding'; +import { EntityListAccessor } from '@contember/react-binding'; +import { EntityListBaseProps } from '@contember/react-binding'; +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 { 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'; + +// @public (undocumented) +export type BooleanCellProps = DataGridColumnCommonProps & BooleanCellRendererProps & { + disableOrder?: boolean; + initialOrder?: DataGridOrderDirection; + initialFilter?: BooleanFilterArtifacts; +}; + +// @public (undocumented) +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)[]; + initialFilter?: CoalesceTextFilterArtifacts; +}; + +// @public (undocumented) +export type CoalesceTextCellProps = DataGridColumnCommonProps & CoalesceCellRendererProps & { + initialFilter?: CoalesceTextFilterArtifacts; +}; + +// @public (undocumented) +export type CoalesceTextFilterArtifacts = { + mode: 'matches' | 'matchesExactly' | 'startsWith' | 'endsWith' | 'doesNotMatch'; + query: string; +}; + +// @public (undocumented) +export type ControlledDataGridProps

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

(Renderer: ComponentType

>) => NamedExoticComponent>>>; + +// @public (undocumented) +export const createDataGrid:

(Renderer: ComponentType & P>) => ComponentType>>>; + +// @public (undocumented) +export const createDataGridRenderer: ({ Fallback, Container, staticRender, columnStaticRender }: { + Fallback: ComponentType<{ + children: ReactNode; + }>; + Container: ComponentType & ContainerProps>; + staticRender?: ((props: DataGridRendererInnerProps & ContainerProps) => ReactNode) | undefined; + columnStaticRender?: ((props: { + column: DataGridColumnProps; + }) => ReactNode) | undefined; +}) => NamedExoticComponent & ContainerProps>; + +// @public (undocumented) +export const createDateCell: ({ FilterRenderer, ValueRenderer }: { + FilterRenderer: ComponentType>; + ValueRenderer: ComponentType; +}) => FunctionComponent; + +// @public (undocumented) +export const createEnumCell: ({ FilterRenderer, ValueRenderer }: { + FilterRenderer: ComponentType>; + ValueRenderer: ComponentType; +}) => FunctionComponent; + format?: ((value: string | null) => ReactNode) | undefined; + initialFilter?: EnumCellFilterArtifacts | 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>; +}) => FunctionComponent; + children: ReactNode; +} & ColumnProps>; + +// @public (undocumented) +export const createHasManySelectCell: ({ FilterRenderer, ValueRenderer }: { + FilterRenderer: ComponentType>; + ValueRenderer: ComponentType; +}) => FunctionComponent; + +// @public (undocumented) +export const createHasManySelectCellRenderer: ({ renderElements, FallbackRenderer }: { + renderElements?: HasManySelectCellElementsRenderer | undefined; + FallbackRenderer?: ComponentType | undefined; +}) => NamedExoticComponent ReactElement) | undefined; +} & FallbackProps>; + +// @public (undocumented) +export const createHasOneSelectCell: ({ FilterRenderer, ValueRenderer }: { + FilterRenderer: ComponentType>; + ValueRenderer: ComponentType; +}) => FunctionComponent; + +// @public (undocumented) +export const createHasOneSelectCellRenderer: ({ FallbackRenderer }: { + FallbackRenderer?: ComponentType | undefined; +}) => NamedExoticComponent; + +// @public (undocumented) +export const createNumberCell: ({ FilterRenderer, ValueRenderer }: { + FilterRenderer: ComponentType>; + ValueRenderer: ComponentType; +}) => FunctionComponent; + +// @public (undocumented) +export const createTextCell: ({ FilterRenderer, ValueRenderer }: { + FilterRenderer: ComponentType>; + ValueRenderer: ComponentType; +}) => FunctionComponent; + +// @public +export const DataGridColumn: (props: DataGridColumnProps) => ReactElement; + +// @public (undocumented) +export type DataGridColumnCommonProps = { + columnKey?: string; + children?: ReactNode; +}; + +// @public (undocumented) +export type DataGridColumnFiltering = { + enableFiltering: false; +} | { + enableFiltering?: true; + initialFilter?: FA; + getNewFilter: GetNewFilter; + emptyFilter: FA; + filterRenderer: ComponentType>; +}; + +// @public (undocumented) +export type DataGridColumnKey = string; + +// @public (undocumented) +export type DataGridColumnOrdering = { + enableOrdering: false; +} | { + enableOrdering?: true; + initialOrder?: DataGridOrderDirection; + getNewOrderBy: GetNewOrderBy; +}; + +// @public (undocumented) +export type DataGridColumnProps = DataGridColumnCommonProps & DataGridColumnFiltering & DataGridColumnOrdering & P; + +// @public (undocumented) +export type DataGridColumns

= Map>; + +// @public (undocumented) +export type DataGridFilterArtifact = Serializable; + +// @public (undocumented) +export type DataGridFilterArtifactStore = Record; + +// @public (undocumented) +export type DataGridHiddenColumnsStateStore = Record; + +// @public (undocumented) +export const DataGridKeyProvider: Provider; + +// @public (undocumented) +export type DataGridLayout = 'default' | 'tiles'; + +// @public (undocumented) +export type DataGridOrderDirection = 'asc' | 'desc' | null; + +// @public (undocumented) +export type DataGridOrderDirectionStore = Record>; + +// @public (undocumented) +export type DataGridProps

= { + dataGridKey?: string; + entities: SugaredQualifiedEntityList['entities']; + children: ReactNode; + 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; +} + +// @public (undocumented) +export type DateCellProps = DateCellRendererProps & DataGridColumnCommonProps & { + disableOrder?: boolean; + initialOrder?: DataGridOrderDirection; + initialFilter?: DateRangeFilterArtifacts; +}; + +// @public (undocumented) +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; +}; + +// @public (undocumented) +export type EnumCellRendererProps = { + field: SugarableRelativeSingleField | string; +}; + +// @public (undocumented) +export type FilterRendererProps = { + filter: FA; + setFilter: DataGridSetFilter; + 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; + children: ReactNode; +}; + +// @public (undocumented) +export type HasManySelectCellElementsRenderer = (elements: ReactNode[]) => ReactElement; + +// @public (undocumented) +export type HasManySelectProps = HasManySelectRendererProps & DataGridColumnCommonProps; + +// @public (undocumented) +export type HasManySelectRendererProps = SugaredRelativeEntityList & BaseDynamicChoiceField & { + initialFilter?: SelectCellArtifacts; +}; + +// @public (undocumented) +export type HasOneSelectProps = HasOneSelectRendererProps & DataGridColumnCommonProps; + +// @public (undocumented) +export type HasOneSelectRendererProps = BaseDynamicChoiceField & SugaredRelativeSingleEntity & { + initialFilter?: SelectCellArtifacts; +}; + +// @public (undocumented) +export type NumberCellProps = DataGridColumnCommonProps & NumberCellRendererProps & { + disableOrder?: boolean; + initialOrder?: DataGridOrderDirection; + initialFilter?: NumberFilterArtifacts; +}; + +// @public (undocumented) +export type NumberCellRendererProps = { + field: SugarableRelativeSingleField | string; +}; + +// @public (undocumented) +export type NumberFilterArtifacts = { + mode: 'eq' | 'gte' | 'lte'; + query: number | null; + 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; + +// @public (undocumented) +export type TextCellProps = TextCellRendererProps & DataGridColumnCommonProps & { + disableOrder?: boolean; + initialOrder?: DataGridOrderDirection; + initialFilter?: TextFilterArtifacts; +}; + +// @public (undocumented) +export type TextCellRendererProps = { + field: SugarableRelativeSingleField | string; +}; + +// @public (undocumented) +export type TextFilterArtifacts = { + mode: 'matches' | 'matchesExactly' | 'startsWith' | 'endsWith' | 'doesNotMatch'; + query: string; + nullCondition: boolean; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-form-fields-ui.api.md b/build/api/react-form-fields-ui.api.md new file mode 100644 index 0000000000..97114e7515 --- /dev/null +++ b/build/api/react-form-fields-ui.api.md @@ -0,0 +1,203 @@ +## API Report File for "@contember/react-form-fields-ui" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +/// + +import { ColorInputProps } from '@contember/ui'; +import { ControlProps } from '@contember/ui'; +import { CSSProperties } from 'react'; +import { DateInputProps } from '@contember/ui'; +import { DateTimeInputProps } from '@contember/ui'; +import { EmailInputProps } from '@contember/ui'; +import { Environment } from '@contember/react-binding'; +import { FieldAccessor } from '@contember/react-binding'; +import { FieldBasicProps } from '@contember/react-binding'; +import { FieldContainerProps } from '@contember/ui'; +import { FieldValue } from '@contember/react-binding'; +import { MemoExoticComponent } from 'react'; +import { NamedExoticComponent } from 'react'; +import type { NonOptionalControlProps } from '@contember/ui'; +import { ReactNode } from 'react'; +import { Ref } from 'react'; +import { SearchInputProps } from '@contember/ui'; +import { SugaredRelativeSingleField } from '@contember/react-binding'; +import { TextareaInputProps } from '@contember/ui'; +import { TimeInputProps } from '@contember/ui'; +import { UrlInputProps } from '@contember/ui'; + +// @public (undocumented) +export const CheckboxField: NamedExoticComponent; + +// @public (undocumented) +export type CheckboxFieldProps = SimpleRelativeSingleFieldProps & ControlProps; + +// @public (undocumented) +export const ColorField: NamedExoticComponent; + +// @public (undocumented) +export type ColorFieldProps = SimpleRelativeSingleFieldProps & Omit; + +// @public (undocumented) +export type ControlValueParser = (value: ControlVal | null | undefined, field: FieldAccessor) => FieldVal | null; + +// @public (undocumented) +export const DateField: NamedExoticComponent; + +// @public (undocumented) +export type DateFieldProps = SimpleRelativeSingleFieldProps & DateInputProps; + +// @public (undocumented) +export const DateTimeField: NamedExoticComponent; + +// @public (undocumented) +export type DateTimeFieldProps = SimpleRelativeSingleFieldProps & DateTimeInputProps; + +// @public (undocumented) +export const EmailField: NamedExoticComponent; + +// @public (undocumented) +export type EmailFieldProps = SimpleRelativeSingleFieldProps & Omit; + +// @public (undocumented) +export type FieldValueFormatter = (value: FieldVal | null | undefined, field: FieldAccessor) => ControlVal | null; + +// @public (undocumented) +export const FloatField: NamedExoticComponent; + +// @public (undocumented) +export type FloatFieldProps = SimpleRelativeSingleFieldProps & ControlProps; + +// @public +export const HiddenField: NamedExoticComponent; + +// @public (undocumented) +export type HiddenFieldProps = FieldBasicProps & { + label?: ReactNode; +}; + +// @public (undocumented) +export const NumberField: NamedExoticComponent; + +// @public (undocumented) +export type NumberFieldProps = SimpleRelativeSingleFieldProps & ControlProps; + +// @public (undocumented) +export type RenderedSimpleRelativeSingleFieldProxyExtraPropsKeys = 'className' | 'style'; + +// @public (undocumented) +export type RenderedSimpleRelativeSingleFieldProxyFieldContainerPropsKeys = 'required' | 'size' | 'errors'; + +// @public (undocumented) +export type RenderedSugaredRelativeSingleFieldKeys = 'field'; + +// @public (undocumented) +export const SearchField: NamedExoticComponent; + +// @public (undocumented) +export type SearchFieldProps = SimpleRelativeSingleFieldProps & Omit; + +// @public (undocumented) +export const SimpleRelativeSingleField:

(render: (fieldMetadata: SimpleRelativeSingleFieldMetadata, props: SimpleRelativeSingleFieldProxyExcludeHandledProps

) => ReactNode, displayName: string, defaultProps?: Partial

| undefined) => NamedExoticComponent

; + +// @public (undocumented) +export interface SimpleRelativeSingleFieldMetadata { + // (undocumented) + environment: Environment; + // (undocumented) + field: FieldAccessor; + // (undocumented) + isMutating: boolean; +} + +// @public (undocumented) +export type SimpleRelativeSingleFieldProps = SimpleRelativeSingleFieldProxyProps; + +// @internal (undocumented) +export const SimpleRelativeSingleFieldProxy: MemoExoticComponent<({ render, defaultValue, isNonbearing, onBeforeUpdate, onInitialize, onUpdate, description, display, direction, evenly, horizontal, gap, label, labelDescription, labelPosition, reverse, useLabelElement, width, className, style, errors, field: fieldName, required, size, containerClassName, containerStyle, suppressErrors, ...rest }: SimpleRelativeSingleFieldProxyProps & SimpleRelativeSingleFieldProxyRendererProps) => JSX.Element>; + +// @public (undocumented) +export type SimpleRelativeSingleFieldProxyExcludeHandledProps

= Omit | Exclude | Exclude>; + +// @public (undocumented) +export type SimpleRelativeSingleFieldProxyExtraProps = { + className?: string | undefined; + containerClassName?: string | undefined; + containerStyle?: CSSProperties | undefined; + style?: CSSProperties | undefined; + suppressErrors?: boolean | undefined; +}; + +// @public (undocumented) +export type SimpleRelativeSingleFieldProxyFieldContainerProps = Omit; + +// @public (undocumented) +export type SimpleRelativeSingleFieldProxyProps = SimpleRelativeSingleFieldProxyFieldContainerProps & SugaredRelativeSingleField & SimpleRelativeSingleFieldProxyExtraProps; + +// @public (undocumented) +export type SimpleRelativeSingleFieldProxyRendererProps = { + render: (fieldMetadata: SimpleRelativeSingleFieldMetadata, props: SimpleRelativeSingleFieldProxyExcludeHandledProps) => ReactNode; +}; + +// @public (undocumented) +export const SlugField: NamedExoticComponent; + +// @public (undocumented) +export const SlugFieldInner: NamedExoticComponent; + +// @public (undocumented) +export type SlugFieldProps = SimpleRelativeSingleFieldProps & ControlProps & { + derivedFrom: SugaredRelativeSingleField['field']; + unpersistedHardPrefix?: SlugPrefix; + persistedHardPrefix?: SlugPrefix; + persistedSoftPrefix?: SlugPrefix; + linkToExternalUrl?: boolean; +}; + +// @public (undocumented) +export type SlugPrefix = string | ((environment: Environment) => string); + +// @public @deprecated (undocumented) +export const TextAreaField: NamedExoticComponent; + +// @public +export const TextareaField: NamedExoticComponent; + +// @public (undocumented) +export type TextareaFieldProps = Omit & ControlProps & TextareaInputProps; + +// @public +export const TextField: NamedExoticComponent; + +// @public (undocumented) +export type TextFieldProps = SimpleRelativeSingleFieldProps & ControlProps; + +// @public (undocumented) +export const TimeField: NamedExoticComponent; + +// @public (undocumented) +export type TimeFieldProps = SimpleRelativeSingleFieldProps & TimeInputProps; + +// @public (undocumented) +export const UrlField: NamedExoticComponent; + +// @public (undocumented) +export type UrlFieldProps = SimpleRelativeSingleFieldProps & Omit; + +// @public (undocumented) +export type UseControlProps = ControlProps & { + fieldMetadata: SimpleRelativeSingleFieldMetadata; + parse: ControlValueParser; + format: FieldValueFormatter; +}; + +// @public (undocumented) +export const useFieldControl: ({ fieldMetadata, parse, format, onBlur, ...props }: UseControlProps) => NonOptionalControlProps & { + ref: Ref; +}; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-i18n.api.md b/build/api/react-i18n.api.md new file mode 100644 index 0000000000..460b4b056c --- /dev/null +++ b/build/api/react-i18n.api.md @@ -0,0 +1,86 @@ +## API Report File for "@contember/react-i18n" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { ReactNode } from 'react'; + +// @public (undocumented) +export class I18nError extends Error { +} + +// @public (undocumented) +export function I18nProvider({ localeCode, dictionaries, children }: I18nProviderProps): JSX.Element; + +// @public (undocumented) +export interface I18nProviderProps { + // (undocumented) + children: ReactNode; + // (undocumented) + dictionaries: MessageDictionaryByLocaleCode | undefined; + // (undocumented) + localeCode: string | undefined; +} + +// @public (undocumented) +export interface MessageDictionary { + // (undocumented) + [Key: string]: MessageDictionary | string; +} + +// @public (undocumented) +export interface MessageDictionaryByLocaleCode { + // (undocumented) + [localeCode: string]: MessageDictionary; +} + +// @public (undocumented) +export type MessageDictionaryKeys = { + [Key in keyof Dict & string]: Dict[Key] extends MessageDictionary ? `${Key}.${MessageDictionaryKeys2}` : Key; +}[keyof Dict & string]; + +// @public (undocumented) +export type MessageDictionaryKeys2 = { + [Key in keyof Dict & string]: Dict[Key] extends MessageDictionary ? `${Key}.${MessageDictionaryKeys3}` : Key; +}[keyof Dict & string]; + +// @public (undocumented) +export type MessageDictionaryKeys3 = { + [Key in keyof Dict & string]: Dict[Key] extends MessageDictionary ? `${Key}.${MessageDictionaryKeys4}` : Key; +}[keyof Dict & string]; + +// @public (undocumented) +export type MessageDictionaryKeys4 = { + [Key in keyof Dict & string]: Dict[Key] extends MessageDictionary ? `${Key}.${MessageDictionaryKeys5}` : Key; +}[keyof Dict & string]; + +// @public (undocumented) +export type MessageDictionaryKeys5 = { + [Key in keyof Dict & string]: Dict[Key] extends MessageDictionary ? string : Key; +}[keyof Dict & string]; + +// @public (undocumented) +export interface MessageFormatter { + // (undocumented) + (key: MessageDictionaryKeys, values?: Record): string; + // (undocumented) + (key: MessageDictionaryKeys, values?: Record): ReactNode; + // (undocumented) + (userSpecifiedKey: string | undefined, fallbackKey: MessageDictionaryKeys, values?: Record): string; + // (undocumented) + (userSpecifiedKey: U, fallbackKey: MessageDictionaryKeys, values?: Record): U | string; +} + +// @public (undocumented) +export type MessageFormatterFormatJSXChunk = (parts: ReactNode) => ReactNode; + +// @public (undocumented) +export type MessageFormatterPrimitiveType = string | number | boolean | null | undefined | Date; + +// @public (undocumented) +export const useMessageFormatter: (defaultDictionary: Dict) => MessageFormatter; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/react-leaflet-fields-ui.api.md b/build/api/react-leaflet-fields-ui.api.md new file mode 100644 index 0000000000..018f306575 --- /dev/null +++ b/build/api/react-leaflet-fields-ui.api.md @@ -0,0 +1,37 @@ +## API Report File for "@contember/react-leaflet-fields-ui" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { FieldContainerProps } from '@contember/ui'; +import { FunctionComponent } from 'react'; +import { MapContainerProps } from 'react-leaflet'; +import { MarkerProps } from 'react-leaflet'; +import { SugaredFieldProps } from '@contember/react-binding'; +import { TileLayerProps } from 'react-leaflet'; + +// @public (undocumented) +export const LocationField: FunctionComponent; + +// @public (undocumented) +export interface LocationFieldProps extends Omit { + // (undocumented) + latitudeField: SugaredFieldProps['field']; + // (undocumented) + longitudeField: SugaredFieldProps['field']; + // (undocumented) + mapCenter?: [number, number]; + // (undocumented) + mapProps?: MapContainerProps; + // (undocumented) + markerProps?: MarkerProps; + // (undocumented) + tileLayerProps?: Partial; + // (undocumented) + zoom?: number; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build/api/ui.api.md b/build/api/ui.api.md index 8a3102ef62..9090467b53 100644 --- a/build/api/ui.api.md +++ b/build/api/ui.api.md @@ -2683,7 +2683,7 @@ export interface TableProps { } // @public (undocumented) -export const TableRow: MemoExoticComponent<({ active, children, id, justification, onClick: onClickProp }: TableRowProps) => JSX.Element>; +export const TableRow: MemoExoticComponent<({ active, children, justification, onClick: onClick }: TableRowProps) => JSX.Element>; // @public (undocumented) export interface TableRowProps { @@ -2692,11 +2692,9 @@ export interface TableRowProps { // (undocumented) children?: ReactNode; // (undocumented) - id?: string | number; - // (undocumented) justification?: Justification; // (undocumented) - onClick?: (id: number | string) => void; + onClick?: MouseEventHandler; } // @internal diff --git a/build/api/utilities.api.md b/build/api/utilities.api.md index 9a7cd9cda5..b853e4e312 100644 --- a/build/api/utilities.api.md +++ b/build/api/utilities.api.md @@ -79,6 +79,11 @@ export function controlsThemeClassName = // @public (undocumented) export function dataAttribute(value: unknown): string | true | undefined; +// @public (undocumented) +export const dateToStringWithoutTimezone: (date: Date, { includeTime }?: { + includeTime?: boolean | undefined; +}) => string; + // @public (undocumented) export function deduplicateClassName(classNameArray: string[]): string[]; @@ -302,6 +307,11 @@ export type SemverString = `${number}.${number}.${number}`; // @public (undocumented) export function setHasOneOf(set: Set, values: T[]): boolean; +// @public (undocumented) +export const shouldCancelStart: (event: { + target?: unknown; +}) => boolean; + export { Simplify } // @public (undocumented)