From daac4cb5cf77afa24403cc6fc789f435acba3883 Mon Sep 17 00:00:00 2001 From: David Matejka Date: Tue, 31 Jan 2023 13:22:53 +0100 Subject: [PATCH] split binding into binding and react-binding package --- packages/admin/package.json | 2 +- .../src/components/ApplicationEntrypoint.tsx | 2 +- .../admin/src/components/Auto/AutoCell.tsx | 2 +- .../admin/src/components/Auto/AutoField.tsx | 2 +- .../admin/src/components/Auto/AutoFields.tsx | 2 +- .../admin/src/components/Auto/AutoForm.tsx | 2 +- .../admin/src/components/Auto/AutoGrid.tsx | 2 +- .../admin/src/components/Auto/AutoLabel.tsx | 2 +- packages/admin/src/components/Auto/utils.tsx | 2 +- .../admin/src/components/Identity/HasRole.tsx | 2 +- .../Identity/IdentityEnvironmentExtension.ts | 2 +- .../components/Identity/IdentityProvider.tsx | 2 +- .../NavigationProvider/NavigationProvider.tsx | 2 +- .../Project/ProjectEnvironmentExtension.tsx | 2 +- .../SimpleRelativeFieldProxy.tsx | 2 +- .../SimpleRelativeSingleField.tsx | 2 +- .../components/bindingFacade/blocks/Block.tsx | 2 +- .../blocks/DiscriminatedBlocks.tsx | 2 +- .../bindingFacade/blocks/blockAnalyzer.ts | 2 +- .../blocks/getDiscriminatedBlock.ts | 2 +- .../bindingFacade/blocks/useBlockProps.ts | 2 +- .../ClearFieldButtonInner.tsx | 2 +- .../bindingFacade/buttons/PageLinkById.tsx | 2 +- .../bindingFacade/buttons/PersistButton.tsx | 2 +- .../BlockRepeater/AddNewBlockButtonInner.tsx | 2 +- .../BlockRepeater/BlockRepeater.tsx | 2 +- .../BlockRepeater/SortableBlock.tsx | 2 +- .../DataGrid/base/DataGridColumn.ts | 2 +- .../DataGridContainer/DataGridContainer.tsx | 2 +- .../DataGridContainerGrid.tsx | 2 +- .../DataGridContainerTable.tsx | 2 +- .../DataGrid/base/DataGridContainer/Types.ts | 2 +- .../DataGrid/base/DataGridFullFilters.tsx | 2 +- .../DataGrid/base/DataGridHeaderCell.tsx | 2 +- .../DataGrid/base/DataGridState.ts | 2 +- .../collections/DataGrid/base/GetNewFilter.ts | 2 +- .../DataGrid/base/GetNewOrderBy.ts | 2 +- .../DataGrid/base/getColumnFilter.ts | 2 +- .../DataGrid/base/getColumnOrderBy.ts | 2 +- .../base/useDataGridDisplayedState.ts | 2 +- .../DataGrid/base/useDataGridState.ts | 2 +- .../DataGrid/base/useDataGridTotalCount.ts | 4 +- .../DataGrid/cells/BooleanCell.tsx | 2 +- .../DataGrid/cells/CoalesceTextCell.tsx | 2 +- .../collections/DataGrid/cells/DateCell.tsx | 2 +- .../collections/DataGrid/cells/EnumCell.tsx | 2 +- .../DataGrid/cells/GenericCell.tsx | 2 +- .../DataGrid/cells/HasManyAbsentCell.tsx | 2 +- .../DataGrid/cells/HasManySelectCell.tsx | 2 +- .../DataGrid/cells/HasOneSelectCell.tsx | 2 +- .../DataGrid/cells/NullConditionFilter.tsx | 2 +- .../collections/DataGrid/cells/NumberCell.tsx | 2 +- .../DataGrid/cells/SelectCellFilter.tsx | 2 +- .../collections/DataGrid/cells/TextCell.tsx | 2 +- .../DataGrid/grid/ControlledDataGrid.tsx | 2 +- .../collections/DataGrid/grid/DataGrid.tsx | 2 +- .../DataGrid/grid/collectFilters.ts | 2 +- .../DataGrid/grid/collectOrderBy.ts | 2 +- .../collections/DataGrid/grid/renderGrid.tsx | 2 +- .../collections/Repeater/Repeater.tsx | 2 +- .../Repeater/RepeaterFieldContainer.tsx | 2 +- .../collections/Repeater/RepeaterInner.tsx | 2 +- .../collections/Repeater/RepeaterItem.tsx | 2 +- .../helpers/CreateNewEntityButton.tsx | 2 +- .../helpers/DeleteEntityButton.tsx | 2 +- .../NormalizedDiscriminatedData.ts | 2 +- .../ResolvedDiscriminatedDatum.ts | 2 +- .../discrimination/SugaredDiscriminateBy.ts | 2 +- .../discrimination/getDiscriminatedDatum.ts | 2 +- .../discrimination/useDiscriminatedData.ts | 2 +- .../DimensionsSwitcher/DimensionsRenderer.tsx | 2 +- .../DimensionsSwitcher/DimensionsSwitcher.tsx | 2 +- .../environment/LabelMiddleware.tsx | 2 +- .../environment/SideDimensions.tsx | 2 +- .../bindingFacade/environment/Variable.tsx | 2 +- .../bindingFacade/errors/AccessorErrors.tsx | 2 +- .../bindingFacade/errors/useAccessorErrors.ts | 2 +- .../fieldViews/BooleanFieldView.tsx | 2 +- .../fieldViews/CoalesceFieldView.tsx | 2 +- .../fieldViews/DateFieldView.tsx | 2 +- .../fieldViews/FieldFallbackView.tsx | 2 +- .../fieldViews/FileUrlFieldView.tsx | 2 +- .../fieldViews/ImageFieldView.tsx | 2 +- .../fieldViews/VideoFieldView.tsx | 2 +- .../ChoiceField/BaseDynamicChoiceField.tsx | 2 +- .../fields/ChoiceField/ChoiceField.tsx | 2 +- .../ChoiceField/DynamicMultiChoiceField.tsx | 2 +- .../ChoiceField/DynamicSingleChoiceField.tsx | 2 +- .../ChoiceField/StaticSingleChoiceField.tsx | 2 +- .../hooks/useCreateOptionsFilter.ts | 2 +- .../ChoiceField/hooks/useCurrentValues.ts | 2 +- .../hooks/useCurrentlyChosenEntities.ts | 4 +- .../hooks/useDesugaredOptionPath.ts | 2 +- .../hooks/useDynamicMultipleChoiceField.ts | 2 +- ...MultipleChoiceWithConnectingEntityField.ts | 2 +- .../hooks/useDynamicSingleChoiceField.tsx | 2 +- .../hooks/useNormalizedOptions.tsx | 2 +- .../fields/ChoiceField/hooks/useOnAddNew.tsx | 2 +- .../ChoiceField/hooks/useSearchFields.ts | 2 +- .../ChoiceField/hooks/useSelectOptions.ts | 2 +- .../hooks/useStaticSingleChoiceField.ts | 2 +- .../hooks/useTopLevelOptionAccessor.ts | 4 +- .../renderDynamicChoiceFieldStatic.tsx | 2 +- .../fields/LocationField/LocationField.tsx | 2 +- .../bindingFacade/fields/RadioField.tsx | 2 +- .../fields/SelectField/MultiSelectField.tsx | 2 +- .../fields/SelectField/SelectField.tsx | 2 +- .../bindingFacade/fields/SlugField.tsx | 2 +- .../bindingFacade/fields/useFieldControl.ts | 4 +- .../renderers/FeedbackRenderer.tsx | 2 +- .../renderers/LayoutRenderer.tsx | 2 +- .../ImmutableEntityListRenderer.tsx | 2 +- .../MutableEntityListRenderer.tsx | 2 +- .../pageRenderers/DataGridPageRenderer.tsx | 2 +- .../ImmutableEntityListPageRenderer.tsx | 2 +- .../ImmutableEntityListTablePageRenderer.tsx | 2 +- .../MutableEntityListPageRenderer.tsx | 2 +- .../methods/getElementDataAttributes.ts | 2 +- .../ContemberEditor/methods/toLatestFormat.ts | 2 +- .../richText/RichTextField/RichTextField.tsx | 2 +- .../RichTextField/useRichTextFieldNodes.ts | 2 +- .../richText/blockEditor/BlockEditor.tsx | 2 +- .../BlockHoveringToolbarContents.tsx | 2 +- .../blockEditor/FieldBackedElement.ts | 2 +- .../blockEditor/editor/EditorWithBlocks.ts | 2 +- .../blockEditor/editor/initBlockEditor.ts | 2 +- .../blockEditor/editor/overrideInsertData.ts | 2 +- .../elements/ElementWithReference.ts | 2 +- .../blockEditor/elements/ReferenceElement.tsx | 2 +- .../blockEditor/embed/core/EmbedHandler.ts | 2 +- .../embed/handlers/GoogleFormEmbedHandler.tsx | 2 +- .../embed/handlers/SoundCloudEmbedHandler.tsx | 2 +- .../embed/handlers/SpotifyEmbedHandler.tsx | 2 +- .../embed/handlers/VimeoEmbedHandler.tsx | 2 +- .../embed/handlers/YouTubeEmbedHandler.tsx | 2 +- .../references/ReferenceElementWrapper.tsx | 2 +- .../references/ReferencesProvider.tsx | 2 +- .../references/useCreateElementReference.ts | 2 +- .../references/useGetReferenceEntityList.ts | 2 +- .../references/useGetReferencedEntity.ts | 2 +- .../useInsertElementWithReference.ts | 2 +- .../renderers/ReferenceElementRenderer.tsx | 2 +- .../blockEditor/state/SortedBlocksContext.tsx | 2 +- .../state/useBlockEditorOnChange.ts | 2 +- .../blockEditor/state/useBlockEditorState.ts | 21 +++++++-- .../blockEditor/state/useBlockElementCache.ts | 2 +- .../state/useBlockElementPathRefs.ts | 2 +- .../blockEditor/state/useRefreshBlocks.ts | 2 +- .../blockEditor/templating/ContentOutlet.ts | 2 +- .../blockEditor/templating/TextField.ts | 2 +- .../templating/editorTemplateAnalyzer.ts | 2 +- .../templating/getEditorTemplate.tsx | 2 +- .../templating/useEditorReferenceBlocks.ts | 2 +- .../blockEditor/useBlockEditorSlateNodes.ts | 2 +- .../blockEditor/useGetParentEntityRef.ts | 4 +- ...atedEditorFormerlyKnownAsRichTextField.tsx | 2 +- .../useRichTextFieldNodes.ts | 2 +- .../toolbars/HoveringToolbarContents.tsx | 2 +- .../richText/toolbars/ToolbarButtonSpec.ts | 2 +- .../bindingFacade/ui/DerivedFieldLink.tsx | 2 +- .../fileDataExtractors/FileDataExtractor.ts | 2 +- .../getAudioFileDataExtractor.tsx | 4 +- .../getFileUrlDataExtractor.tsx | 4 +- .../getGenericFileMetadataExtractor.tsx | 4 +- .../getImageFileDataExtractor.tsx | 4 +- .../getVideoFileDataExtractor.tsx | 4 +- .../fileHandler/DiscriminatedFileHandler.tsx | 2 +- .../upload/fileHandler/FileHandler.ts | 2 +- .../fileHandler/SingleKindFileHandler.tsx | 2 +- .../upload/fileHandler/useFileHandler.ts | 4 +- .../utils/createEntityConnector.ts | 2 +- .../fileHandler/utils/disconnectAtBase.ts | 2 +- .../utils/staticRenderFileKind.tsx | 4 +- .../upload/fileKinds/FileKind.tsx | 2 +- .../upload/fileKinds/FullFileKind.ts | 2 +- .../upload/fileKinds/HybridFileKind.ts | 2 +- .../upload/fileKinds/components/AnyFiles.tsx | 2 +- .../fileKinds/components/AudioFiles.tsx | 2 +- .../fileKinds/components/ImageFiles.tsx | 2 +- .../fileKinds/components/VideoFiles.tsx | 2 +- .../fileKinds/fileKindTemplateAnalyzer.ts | 2 +- .../internalComponents/BareFileRepeater.tsx | 2 +- .../BareFileRepeaterContainer.tsx | 2 +- .../internalComponents/BareUploadField.tsx | 2 +- .../InitializedFilePreview.tsx | 2 +- .../SingleFilePreview/SingleFilePreview.tsx | 2 +- .../SingleKindFileRepeater.tsx | 2 +- .../SingleKindUploadField.tsx | 2 +- .../hooks/useConnectSelectedEntities.ts | 2 +- .../hooks/useNormalizedUploadState.ts | 2 +- .../selection/SelectFileDialog.tsx | 2 +- .../selection/SelectFileInput.tsx | 2 +- .../selection/SingleKindSelectFileDialog.tsx | 2 +- .../selection/useResolvedFileSelection.ts | 2 +- .../upload/wrappers/generic/FileRepeater.tsx | 4 +- .../upload/wrappers/generic/UploadField.tsx | 2 +- .../wrappers/withKind/AnyFileRepeater.tsx | 2 +- .../wrappers/withKind/AnyUploadField.tsx | 2 +- .../wrappers/withKind/AudioFileRepeater.tsx | 2 +- .../wrappers/withKind/AudioUploadField.tsx | 2 +- .../wrappers/withKind/ImageFileRepeater.tsx | 2 +- .../wrappers/withKind/ImageUploadField.tsx | 2 +- .../wrappers/withKind/VideoFileRepeater.tsx | 2 +- .../wrappers/withKind/VideoUploadField.tsx | 2 +- .../src/components/pageRouting/Pages.tsx | 2 +- .../pageRouting/pageComponents/CreatePage.tsx | 2 +- .../pageComponents/DataGridPage.tsx | 2 +- .../pageRouting/pageComponents/DetailPage.tsx | 2 +- .../pageRouting/pageComponents/EditPage.tsx | 2 +- .../pageRouting/pageComponents/ListPage.tsx | 2 +- .../pageComponents/MultiEditPage.tsx | 2 +- .../pageComponents/NotFoundWrapper.tsx | 2 +- .../pageRouting/pageComponents/TablePage.tsx | 2 +- .../useEntityRedirectOnPersistSuccess.ts | 4 +- .../pageRouting/useOnPersistSuccess.ts | 2 +- .../components/ui/usePersistWithFeedback.tsx | 2 +- packages/admin/src/index.ts | 2 +- packages/admin/src/routing/binding/Link.tsx | 2 +- .../admin/src/routing/binding/LinkButton.tsx | 2 +- .../admin/src/routing/binding/LinkLanguage.ts | 2 +- .../useBindingLinkParametersResolver.ts | 2 +- .../admin/src/routing/binding/useRedirect.tsx | 2 +- packages/admin/src/routing/urlMapper.ts | 2 +- packages/admin/src/tenant/lib/useMutation.ts | 2 +- packages/admin/src/tenant/lib/useQuery.ts | 2 +- packages/admin/src/tenant/lib/variables.ts | 2 +- packages/admin/src/tsconfig.json | 2 +- .../tests/playwright/cases/fileSelection.tsx | 2 +- packages/binding/package.json | 11 +---- .../useBindingOperations.ts | 5 -- .../accessorTree/AccessorTreeStateAction.ts | 21 --------- packages/binding/src/accessorTree/index.ts | 12 ----- .../src/accessors/BindingOperations.ts | 4 +- packages/binding/src/accessors/ExtendTree.ts | 3 +- .../binding/src/accessors/TreeRootAccessor.ts | 4 +- packages/binding/src/core/DataBinding.ts | 27 +++++------ packages/binding/src/core/EventManager.ts | 4 +- packages/binding/src/core/index.ts | 7 ++- packages/binding/src/core/schema/index.ts | 2 + packages/binding/src/dao/Environment.ts | 8 +++- packages/binding/src/dao/index.ts | 1 + packages/binding/src/index.ts | 5 -- .../src/queryLanguage/QueryLanguage.ts | 3 +- packages/binding/src/tsconfig.json | 5 +- packages/react-binding/api-extractor.json | 3 ++ packages/react-binding/package.json | 46 +++++++++++++++++++ .../src}/MarkerTreeGenerator.ts | 10 ++-- .../accessorPropagation/AccessorProvider.tsx | 2 +- .../BindingOperationsContext.ts | 10 ++-- .../BindingOperationsProvider.tsx | 4 +- .../accessorPropagation/EntityKeyContext.ts | 0 .../accessorPropagation/EntityKeyProvider.tsx | 0 .../EnvironmentContext.tsx | 2 +- .../accessorPropagation/TreeRootIdContext.ts | 2 +- .../TreeRootIdProvider.tsx | 2 +- .../src/accessorPropagation/index.ts | 0 .../useAccessorUpdateSubscription.ts | 4 +- .../useBindingOperations.ts | 5 ++ .../useDesugaredRelativeEntityList.ts | 4 +- .../useDesugaredRelativeSingleEntity.ts | 4 +- .../useDesugaredRelativeSingleField.ts | 4 +- .../src/accessorPropagation/useEntity.ts | 6 +-- .../src/accessorPropagation/useEntityKey.ts | 2 +- .../src/accessorPropagation/useEntityList.ts | 6 +-- .../useEntityListSubTree.ts | 6 +-- .../useEntityListSubTreeParameters.ts | 2 +- .../accessorPropagation/useEntitySubTree.ts | 6 +-- .../useEntitySubTreeParameters.ts | 2 +- .../src/accessorPropagation/useEnvironment.ts | 2 +- .../src/accessorPropagation/useExtendTree.ts | 6 +-- .../src/accessorPropagation/useField.ts | 6 +-- .../accessorPropagation/useGetEntityByKey.ts | 2 +- .../useGetEntityListSubTree.ts | 4 +- .../useGetEntitySubTree.ts | 4 +- .../accessorPropagation/useGetTreeFilters.ts | 0 .../src/accessorPropagation/useHasEntity.ts | 0 .../src/accessorPropagation/usePersist.ts | 2 +- .../src/accessorPropagation/useTreeRootId.ts | 2 +- .../accessorSorting/SetOrderFieldOnCreate.tsx | 8 ++-- .../src/accessorSorting/SortedEntities.ts | 2 +- .../src/accessorSorting/addEntityAtIndex.ts | 3 +- .../src/accessorSorting/errors.ts | 6 +-- .../src/accessorSorting/index.ts | 0 .../src/accessorSorting/moveEntity.ts | 3 +- .../accessorSorting/repairEntitiesOrder.ts | 3 +- .../src/accessorSorting/sortEntities.ts | 3 +- .../src/accessorSorting/useSortedEntities.ts | 10 ++-- .../src/accessorTree/AccessorTree.tsx | 0 .../src/accessorTree/AccessorTreeState.ts | 17 +++---- .../accessorTree/AccessorTreeStateAction.ts | 22 +++++++++ .../accessorTree/AccessorTreeStateContext.ts | 0 .../accessorTree/AccessorTreeStateMetadata.ts | 0 .../accessorTree/AccessorTreeStateOptions.ts | 0 .../src/accessorTree/DirtinessContext.ts | 0 .../src/accessorTree/MutationStateContext.ts | 0 .../accessorTree/accessorTreeStateReducer.ts | 0 .../react-binding/src/accessorTree/index.ts | 12 +++++ .../src/accessorTree/useAccessorTreeState.ts | 2 +- .../src/accessorTree/useDataBinding.ts | 43 +++++++++++------ .../src/accessorTree/useDirtinessState.ts | 0 .../src/accessorTree/useMutationState.ts | 0 .../src/core/IncrementalMarkerBuilder.ts | 12 +++-- .../src/coreComponents/Component.tsx | 6 +-- .../coreComponents/DataBindingProvider.tsx | 0 .../src/coreComponents/Entity.tsx | 2 +- .../src/coreComponents/EntityList.tsx | 2 +- .../src/coreComponents/EntityListSubTree.tsx | 10 ++-- .../src/coreComponents/EntitySubTree.tsx | 12 ++--- .../src/coreComponents/Field.tsx | 6 +-- .../src/coreComponents/HasMany.tsx | 10 ++-- .../src/coreComponents/HasOne.tsx | 10 ++-- .../src/coreComponents/MarkerProvider.ts | 4 +- .../src/coreComponents/ParentEntity.tsx | 4 +- .../src/coreComponents/index.ts | 0 .../src/entityEvents/index.ts | 0 .../src/entityEvents/useDerivedField.ts | 4 +- .../entityEvents/useEntityBeforePersist.ts | 2 +- .../src/entityEvents/useEntityBeforeUpdate.ts | 2 +- .../src/entityEvents/useEntityEvent.ts | 4 +- .../src/entityEvents/useEntityPersistError.ts | 2 +- .../entityEvents/useEntityPersistSuccess.ts | 2 +- .../src/entityEvents/useOnConnectionUpdate.ts | 4 +- .../src/helperComponents/DeferredSubTrees.tsx | 10 ++-- .../src/helperComponents/EntityView.tsx | 4 +- .../src/helperComponents/FieldView.tsx | 8 ++-- .../src/helperComponents/If.tsx | 6 +-- .../src/helperComponents/StaticRender.tsx | 0 .../src/helperComponents/SugaredField.tsx | 4 +- .../helpers/FilterEvaluator.ts | 8 ++-- .../helpers/FilterFieldsCollector.ts | 6 +-- .../helpers/evaluateCondition.ts | 4 +- .../src/helperComponents/index.ts | 0 packages/react-binding/src/index.ts | 8 ++++ packages/react-binding/src/tsconfig.json | 13 ++++++ .../react-binding/src/utils/assertNever.ts | 10 ++++ .../tests/cases/unit/core/bindingFactory.ts | 25 +++++----- .../cases/unit/core/entityOperations.test.tsx | 0 .../cases/unit/core/eventManager.test.tsx | 0 .../helperComponents/FilterEvaluator.spec.ts | 0 .../FilterFieldsCollector.spec.ts | 4 +- .../evaluateCondition.spec.ts | 0 .../cases/unit/helperComponents/schema.ts | 3 +- .../unit/model/markerTreeGenerator.spec.tsx | 4 +- packages/react-binding/tests/tsconfig.json | 10 ++++ packages/react-binding/tsconfig.json | 8 ++++ packages/react-binding/vite.config.js | 3 ++ pnpm-lock.yaml | 35 +++++++++++++- tsconfig.json | 1 + 348 files changed, 676 insertions(+), 515 deletions(-) delete mode 100644 packages/binding/src/accessorPropagation/useBindingOperations.ts delete mode 100644 packages/binding/src/accessorTree/AccessorTreeStateAction.ts create mode 100644 packages/react-binding/api-extractor.json create mode 100644 packages/react-binding/package.json rename packages/{binding/src/core => react-binding/src}/MarkerTreeGenerator.ts (93%) rename packages/{binding => react-binding}/src/accessorPropagation/AccessorProvider.tsx (90%) rename packages/{binding => react-binding}/src/accessorPropagation/BindingOperationsContext.ts (82%) rename packages/{binding => react-binding}/src/accessorPropagation/BindingOperationsProvider.tsx (79%) rename packages/{binding => react-binding}/src/accessorPropagation/EntityKeyContext.ts (100%) rename packages/{binding => react-binding}/src/accessorPropagation/EntityKeyProvider.tsx (100%) rename packages/{binding => react-binding}/src/accessorPropagation/EnvironmentContext.tsx (96%) rename packages/{binding => react-binding}/src/accessorPropagation/TreeRootIdContext.ts (76%) rename packages/{binding => react-binding}/src/accessorPropagation/TreeRootIdProvider.tsx (87%) rename packages/{binding => react-binding}/src/accessorPropagation/index.ts (100%) rename packages/{binding => react-binding}/src/accessorPropagation/useAccessorUpdateSubscription.ts (97%) create mode 100644 packages/react-binding/src/accessorPropagation/useBindingOperations.ts rename packages/{binding => react-binding}/src/accessorPropagation/useDesugaredRelativeEntityList.ts (96%) rename packages/{binding => react-binding}/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts (95%) rename packages/{binding => react-binding}/src/accessorPropagation/useDesugaredRelativeSingleField.ts (95%) rename packages/{binding => react-binding}/src/accessorPropagation/useEntity.ts (92%) rename packages/{binding => react-binding}/src/accessorPropagation/useEntityKey.ts (89%) rename packages/{binding => react-binding}/src/accessorPropagation/useEntityList.ts (90%) rename packages/{binding => react-binding}/src/accessorPropagation/useEntityListSubTree.ts (87%) rename packages/{binding => react-binding}/src/accessorPropagation/useEntityListSubTreeParameters.ts (98%) rename packages/{binding => react-binding}/src/accessorPropagation/useEntitySubTree.ts (86%) rename packages/{binding => react-binding}/src/accessorPropagation/useEntitySubTreeParameters.ts (97%) rename packages/{binding => react-binding}/src/accessorPropagation/useEnvironment.ts (77%) rename packages/{binding => react-binding}/src/accessorPropagation/useExtendTree.ts (84%) rename packages/{binding => react-binding}/src/accessorPropagation/useField.ts (90%) rename packages/{binding => react-binding}/src/accessorPropagation/useGetEntityByKey.ts (73%) rename packages/{binding => react-binding}/src/accessorPropagation/useGetEntityListSubTree.ts (91%) rename packages/{binding => react-binding}/src/accessorPropagation/useGetEntitySubTree.ts (92%) rename packages/{binding => react-binding}/src/accessorPropagation/useGetTreeFilters.ts (100%) rename packages/{binding => react-binding}/src/accessorPropagation/useHasEntity.ts (100%) rename packages/{binding => react-binding}/src/accessorPropagation/usePersist.ts (72%) rename packages/{binding => react-binding}/src/accessorPropagation/useTreeRootId.ts (77%) rename packages/{binding => react-binding}/src/accessorSorting/SetOrderFieldOnCreate.tsx (97%) rename packages/{binding => react-binding}/src/accessorSorting/SortedEntities.ts (87%) rename packages/{binding => react-binding}/src/accessorSorting/addEntityAtIndex.ts (85%) rename packages/{binding => react-binding}/src/accessorSorting/errors.ts (79%) rename packages/{binding => react-binding}/src/accessorSorting/index.ts (100%) rename packages/{binding => react-binding}/src/accessorSorting/moveEntity.ts (93%) rename packages/{binding => react-binding}/src/accessorSorting/repairEntitiesOrder.ts (81%) rename packages/{binding => react-binding}/src/accessorSorting/sortEntities.ts (80%) rename packages/{binding => react-binding}/src/accessorSorting/useSortedEntities.ts (94%) rename packages/{binding => react-binding}/src/accessorTree/AccessorTree.tsx (100%) rename packages/{binding => react-binding}/src/accessorTree/AccessorTreeState.ts (52%) create mode 100644 packages/react-binding/src/accessorTree/AccessorTreeStateAction.ts rename packages/{binding => react-binding}/src/accessorTree/AccessorTreeStateContext.ts (100%) rename packages/{binding => react-binding}/src/accessorTree/AccessorTreeStateMetadata.ts (100%) rename packages/{binding => react-binding}/src/accessorTree/AccessorTreeStateOptions.ts (100%) rename packages/{binding => react-binding}/src/accessorTree/DirtinessContext.ts (100%) rename packages/{binding => react-binding}/src/accessorTree/MutationStateContext.ts (100%) rename packages/{binding => react-binding}/src/accessorTree/accessorTreeStateReducer.ts (100%) create mode 100644 packages/react-binding/src/accessorTree/index.ts rename packages/{binding => react-binding}/src/accessorTree/useAccessorTreeState.ts (84%) rename packages/{binding => react-binding}/src/accessorTree/useDataBinding.ts (69%) rename packages/{binding => react-binding}/src/accessorTree/useDirtinessState.ts (100%) rename packages/{binding => react-binding}/src/accessorTree/useMutationState.ts (100%) rename packages/{binding => react-binding}/src/core/IncrementalMarkerBuilder.ts (88%) rename packages/{binding => react-binding}/src/coreComponents/Component.tsx (94%) rename packages/{binding => react-binding}/src/coreComponents/DataBindingProvider.tsx (100%) rename packages/{binding => react-binding}/src/coreComponents/Entity.tsx (90%) rename packages/{binding => react-binding}/src/coreComponents/EntityList.tsx (95%) rename packages/{binding => react-binding}/src/coreComponents/EntityListSubTree.tsx (90%) rename packages/{binding => react-binding}/src/coreComponents/EntitySubTree.tsx (91%) rename packages/{binding => react-binding}/src/coreComponents/Field.tsx (86%) rename packages/{binding => react-binding}/src/coreComponents/HasMany.tsx (82%) rename packages/{binding => react-binding}/src/coreComponents/HasOne.tsx (79%) rename packages/{binding => react-binding}/src/coreComponents/MarkerProvider.ts (96%) rename packages/{binding => react-binding}/src/coreComponents/ParentEntity.tsx (77%) rename packages/{binding => react-binding}/src/coreComponents/index.ts (100%) rename packages/{binding => react-binding}/src/entityEvents/index.ts (100%) rename packages/{binding => react-binding}/src/entityEvents/useDerivedField.ts (94%) rename packages/{binding => react-binding}/src/entityEvents/useEntityBeforePersist.ts (78%) rename packages/{binding => react-binding}/src/entityEvents/useEntityBeforeUpdate.ts (78%) rename packages/{binding => react-binding}/src/entityEvents/useEntityEvent.ts (94%) rename packages/{binding => react-binding}/src/entityEvents/useEntityPersistError.ts (78%) rename packages/{binding => react-binding}/src/entityEvents/useEntityPersistSuccess.ts (78%) rename packages/{binding => react-binding}/src/entityEvents/useOnConnectionUpdate.ts (69%) rename packages/{binding => react-binding}/src/helperComponents/DeferredSubTrees.tsx (95%) rename packages/{binding => react-binding}/src/helperComponents/EntityView.tsx (77%) rename packages/{binding => react-binding}/src/helperComponents/FieldView.tsx (95%) rename packages/{binding => react-binding}/src/helperComponents/If.tsx (92%) rename packages/{binding => react-binding}/src/helperComponents/StaticRender.tsx (100%) rename packages/{binding => react-binding}/src/helperComponents/SugaredField.tsx (84%) rename packages/{binding => react-binding}/src/helperComponents/helpers/FilterEvaluator.ts (85%) rename packages/{binding => react-binding}/src/helperComponents/helpers/FilterFieldsCollector.ts (89%) rename packages/{binding => react-binding}/src/helperComponents/helpers/evaluateCondition.ts (95%) rename packages/{binding => react-binding}/src/helperComponents/index.ts (100%) create mode 100644 packages/react-binding/src/index.ts create mode 100644 packages/react-binding/src/tsconfig.json create mode 100644 packages/react-binding/src/utils/assertNever.ts rename packages/{binding => react-binding}/tests/cases/unit/core/bindingFactory.ts (56%) rename packages/{binding => react-binding}/tests/cases/unit/core/entityOperations.test.tsx (100%) rename packages/{binding => react-binding}/tests/cases/unit/core/eventManager.test.tsx (100%) rename packages/{binding => react-binding}/tests/cases/unit/helperComponents/FilterEvaluator.spec.ts (100%) rename packages/{binding => react-binding}/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts (87%) rename packages/{binding => react-binding}/tests/cases/unit/helperComponents/evaluateCondition.spec.ts (100%) rename packages/{binding => react-binding}/tests/cases/unit/helperComponents/schema.ts (92%) rename packages/{binding => react-binding}/tests/cases/unit/model/markerTreeGenerator.spec.tsx (98%) create mode 100644 packages/react-binding/tests/tsconfig.json create mode 100644 packages/react-binding/tsconfig.json create mode 100644 packages/react-binding/vite.config.js diff --git a/packages/admin/package.json b/packages/admin/package.json index 84f84be0a5..c94b58954e 100644 --- a/packages/admin/package.json +++ b/packages/admin/package.json @@ -43,8 +43,8 @@ }, "dependencies": { "@babel/core": "7.17.10", - "@contember/binding": "workspace:*", "@contember/client": "workspace:*", + "@contember/react-binding": "workspace:*", "@contember/react-client": "workspace:*", "@contember/react-multipass-rendering": "workspace:*", "@contember/react-utils": "workspace:*", diff --git a/packages/admin/src/components/ApplicationEntrypoint.tsx b/packages/admin/src/components/ApplicationEntrypoint.tsx index 3af62d8b3d..f3d031980b 100644 --- a/packages/admin/src/components/ApplicationEntrypoint.tsx +++ b/packages/admin/src/components/ApplicationEntrypoint.tsx @@ -1,4 +1,4 @@ -import { Environment, EnvironmentContext, EnvironmentExtensionProvider } from '@contember/binding' +import { Environment, EnvironmentContext, EnvironmentExtensionProvider } from '@contember/react-binding' import { ContemberClient, ContemberClientProps } from '@contember/react-client' import { DialogProvider, SectionTabsProvider, StyleProvider, Toaster, ToasterProvider } from '@contember/ui' import { ReactNode } from 'react' diff --git a/packages/admin/src/components/Auto/AutoCell.tsx b/packages/admin/src/components/Auto/AutoCell.tsx index 4fb393d559..fbef16796e 100644 --- a/packages/admin/src/components/Auto/AutoCell.tsx +++ b/packages/admin/src/components/Auto/AutoCell.tsx @@ -1,4 +1,4 @@ -import { Component, HasOne, PRIMARY_KEY_NAME, Schema, useEntityPersistSuccess } from '@contember/binding' +import { Component, HasOne, PRIMARY_KEY_NAME, Schema, useEntityPersistSuccess } from '@contember/react-binding' import { BooleanCell, CheckboxField, diff --git a/packages/admin/src/components/Auto/AutoField.tsx b/packages/admin/src/components/Auto/AutoField.tsx index 56b926c4bf..c7aef1a3c3 100644 --- a/packages/admin/src/components/Auto/AutoField.tsx +++ b/packages/admin/src/components/Auto/AutoField.tsx @@ -1,4 +1,4 @@ -import { Component, Field, Schema } from '@contember/binding' +import { Component, Field, Schema } from '@contember/react-binding' import { CheckboxField, DateField, DateTimeField, FloatField, MultiSelectField, NumberField, SelectField, TextareaField, TextField } from '../bindingFacade' import { getHumanFriendlyField, resolveConnectingEntity, resolveSortableBy } from './utils' import { AutoFields } from './AutoFields' diff --git a/packages/admin/src/components/Auto/AutoFields.tsx b/packages/admin/src/components/Auto/AutoFields.tsx index ed52d22e89..627589eb7a 100644 --- a/packages/admin/src/components/Auto/AutoFields.tsx +++ b/packages/admin/src/components/Auto/AutoFields.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import { AutoField } from './AutoField' import { RoutingLinkTarget } from '../../routing' diff --git a/packages/admin/src/components/Auto/AutoForm.tsx b/packages/admin/src/components/Auto/AutoForm.tsx index 3c27eead6f..23d1646d9e 100644 --- a/packages/admin/src/components/Auto/AutoForm.tsx +++ b/packages/admin/src/components/Auto/AutoForm.tsx @@ -1,4 +1,4 @@ -import { Component, EntityAccessor, EntityId, EntitySubTree } from '@contember/binding' +import { Component, EntityAccessor, EntityId, EntitySubTree } from '@contember/react-binding' import { NotFoundWrapper } from '../pageRouting' import { AutoFields } from './AutoFields' import { RoutingLinkTarget } from '../../routing' diff --git a/packages/admin/src/components/Auto/AutoGrid.tsx b/packages/admin/src/components/Auto/AutoGrid.tsx index 3d721584ec..f992904c78 100644 --- a/packages/admin/src/components/Auto/AutoGrid.tsx +++ b/packages/admin/src/components/Auto/AutoGrid.tsx @@ -1,4 +1,4 @@ -import { Component, QueryLanguage, Schema } from '@contember/binding' +import { Component, QueryLanguage, Schema } from '@contember/react-binding' import { DataGrid, DataGridContainerPublicProps, DataGridProps, DeleteEntityButton, GenericCell } from '../bindingFacade' import { LinkButton, RoutingLinkTarget } from '../../routing' import { AutoCell } from './AutoCell' diff --git a/packages/admin/src/components/Auto/AutoLabel.tsx b/packages/admin/src/components/Auto/AutoLabel.tsx index 3fc2eca020..a9f520751f 100644 --- a/packages/admin/src/components/Auto/AutoLabel.tsx +++ b/packages/admin/src/components/Auto/AutoLabel.tsx @@ -1,4 +1,4 @@ -import { Component, Field } from '@contember/binding' +import { Component, Field } from '@contember/react-binding' import { Link, RoutingLinkTarget } from '../../routing' import { formatString } from './utils' diff --git a/packages/admin/src/components/Auto/utils.tsx b/packages/admin/src/components/Auto/utils.tsx index a3ae566576..8d3ccb0080 100644 --- a/packages/admin/src/components/Auto/utils.tsx +++ b/packages/admin/src/components/Auto/utils.tsx @@ -1,4 +1,4 @@ -import { PRIMARY_KEY_NAME, Schema, SchemaColumnType, SchemaEntity, SchemaRelation } from '@contember/binding' +import { PRIMARY_KEY_NAME, Schema, SchemaColumnType, SchemaEntity, SchemaRelation } from '@contember/react-binding' export const getHumanFriendlyField = (entitySchema: SchemaEntity) => { for (const field of ['name', 'title', 'heading', 'label', 'caption', 'slug', 'code', 'description']) { diff --git a/packages/admin/src/components/Identity/HasRole.tsx b/packages/admin/src/components/Identity/HasRole.tsx index a57f475c87..b9a132df94 100644 --- a/packages/admin/src/components/Identity/HasRole.tsx +++ b/packages/admin/src/components/Identity/HasRole.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import { ReactNode } from 'react' import { identityEnvironmentExtension } from './IdentityEnvironmentExtension' import { useProjectUserRoles } from '../../acl' diff --git a/packages/admin/src/components/Identity/IdentityEnvironmentExtension.ts b/packages/admin/src/components/Identity/IdentityEnvironmentExtension.ts index 20fa6c6086..40973437a1 100644 --- a/packages/admin/src/components/Identity/IdentityEnvironmentExtension.ts +++ b/packages/admin/src/components/Identity/IdentityEnvironmentExtension.ts @@ -1,4 +1,4 @@ -import { BindingError, Environment } from '@contember/binding' +import { BindingError, Environment } from '@contember/react-binding' import { Identity } from './IdentityProvider' export const identityEnvironmentExtension = Environment.createExtension((state: Identity | null | undefined) => { diff --git a/packages/admin/src/components/Identity/IdentityProvider.tsx b/packages/admin/src/components/Identity/IdentityProvider.tsx index c43af6b1e3..275461b1b8 100644 --- a/packages/admin/src/components/Identity/IdentityProvider.tsx +++ b/packages/admin/src/components/Identity/IdentityProvider.tsx @@ -5,7 +5,7 @@ import { ContainerSpinner, Message } from '@contember/ui' import { MiscPageLayout } from '../MiscPageLayout' import { InvalidIdentityFallback } from './InvalidIdentityFallback' import { useLogout } from './useLogout' -import { EnvironmentExtensionProvider } from '@contember/binding' +import { EnvironmentExtensionProvider } from '@contember/react-binding' import { identityEnvironmentExtension } from './IdentityEnvironmentExtension' export interface Identity { diff --git a/packages/admin/src/components/NavigationProvider/NavigationProvider.tsx b/packages/admin/src/components/NavigationProvider/NavigationProvider.tsx index 13a9ba491e..61cc1222a1 100644 --- a/packages/admin/src/components/NavigationProvider/NavigationProvider.tsx +++ b/packages/admin/src/components/NavigationProvider/NavigationProvider.tsx @@ -1,7 +1,7 @@ import { NavigationContext } from '@contember/ui' import { ReactNode } from 'react' import { isRoutingLinkTarget, PageNotFound, parseLinkTarget, useRoutingLinkFactory } from '../../routing' -import { useEnvironment } from '@contember/binding' +import { useEnvironment } from '@contember/react-binding' export interface NavigationProviderProps { children?: ReactNode diff --git a/packages/admin/src/components/Project/ProjectEnvironmentExtension.tsx b/packages/admin/src/components/Project/ProjectEnvironmentExtension.tsx index 6e7bf13f3a..b26da3cf65 100644 --- a/packages/admin/src/components/Project/ProjectEnvironmentExtension.tsx +++ b/packages/admin/src/components/Project/ProjectEnvironmentExtension.tsx @@ -1,4 +1,4 @@ -import { BindingError, Environment } from '@contember/binding' +import { BindingError, Environment } from '@contember/react-binding' export const projectEnvironmentExtension = Environment.createExtension((slug: string | null | undefined) => { if (slug === undefined) { diff --git a/packages/admin/src/components/bindingFacade/auxiliary/SimpleRelativeSingleField/SimpleRelativeFieldProxy.tsx b/packages/admin/src/components/bindingFacade/auxiliary/SimpleRelativeSingleField/SimpleRelativeFieldProxy.tsx index 120263b53b..ae9afa29eb 100644 --- a/packages/admin/src/components/bindingFacade/auxiliary/SimpleRelativeSingleField/SimpleRelativeFieldProxy.tsx +++ b/packages/admin/src/components/bindingFacade/auxiliary/SimpleRelativeSingleField/SimpleRelativeFieldProxy.tsx @@ -1,4 +1,4 @@ -import { SugaredRelativeSingleField, useEnvironment, useField, useMutationState } from '@contember/binding' +import { SugaredRelativeSingleField, useEnvironment, useField, useMutationState } from '@contember/react-binding' import { FieldContainer, FieldContainerProps } from '@contember/ui' import { memo, ReactNode, useMemo } from 'react' import { useAccessorErrors } from '../../errors' diff --git a/packages/admin/src/components/bindingFacade/auxiliary/SimpleRelativeSingleField/SimpleRelativeSingleField.tsx b/packages/admin/src/components/bindingFacade/auxiliary/SimpleRelativeSingleField/SimpleRelativeSingleField.tsx index 99f3af6834..785905442f 100644 --- a/packages/admin/src/components/bindingFacade/auxiliary/SimpleRelativeSingleField/SimpleRelativeSingleField.tsx +++ b/packages/admin/src/components/bindingFacade/auxiliary/SimpleRelativeSingleField/SimpleRelativeSingleField.tsx @@ -1,4 +1,4 @@ -import { Component, Environment, Field, FieldAccessor, FieldBasicProps, FieldValue } from '@contember/binding' +import { Component, Environment, Field, FieldAccessor, FieldBasicProps, FieldValue } from '@contember/react-binding' import type { FieldContainerProps } from '@contember/ui' import type { NamedExoticComponent, ReactNode } from 'react' import { SimpleRelativeSingleFieldProxy } from './SimpleRelativeFieldProxy' diff --git a/packages/admin/src/components/bindingFacade/blocks/Block.tsx b/packages/admin/src/components/bindingFacade/blocks/Block.tsx index 19c5a29d98..384e193660 100644 --- a/packages/admin/src/components/bindingFacade/blocks/Block.tsx +++ b/packages/admin/src/components/bindingFacade/blocks/Block.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { FunctionComponent, ReactNode } from 'react' import type { SugaredDiscriminateBy } from '../discrimination' diff --git a/packages/admin/src/components/bindingFacade/blocks/DiscriminatedBlocks.tsx b/packages/admin/src/components/bindingFacade/blocks/DiscriminatedBlocks.tsx index c093d7b13a..4d1a64d2f6 100644 --- a/packages/admin/src/components/bindingFacade/blocks/DiscriminatedBlocks.tsx +++ b/packages/admin/src/components/bindingFacade/blocks/DiscriminatedBlocks.tsx @@ -1,4 +1,4 @@ -import { Component, SugaredRelativeSingleField } from '@contember/binding' +import { Component, SugaredRelativeSingleField } from '@contember/react-binding' import type { FieldContainerProps } from '@contember/ui' import { FunctionComponent, ReactNode, useMemo } from 'react' import { ChoiceFieldData, NormalizedStaticOption, SelectFieldInner, StaticSingleChoiceField } from '../fields' diff --git a/packages/admin/src/components/bindingFacade/blocks/blockAnalyzer.ts b/packages/admin/src/components/bindingFacade/blocks/blockAnalyzer.ts index ec5d999305..57e76a4120 100644 --- a/packages/admin/src/components/bindingFacade/blocks/blockAnalyzer.ts +++ b/packages/admin/src/components/bindingFacade/blocks/blockAnalyzer.ts @@ -1,4 +1,4 @@ -import type { Environment } from '@contember/binding' +import type { Environment } from '@contember/react-binding' import { ChildrenAnalyzer, Leaf } from '@contember/react-multipass-rendering' import { Block, BlockProps } from './Block' diff --git a/packages/admin/src/components/bindingFacade/blocks/getDiscriminatedBlock.ts b/packages/admin/src/components/bindingFacade/blocks/getDiscriminatedBlock.ts index 978b291c38..536fa521fa 100644 --- a/packages/admin/src/components/bindingFacade/blocks/getDiscriminatedBlock.ts +++ b/packages/admin/src/components/bindingFacade/blocks/getDiscriminatedBlock.ts @@ -1,4 +1,4 @@ -import type { FieldAccessor, FieldValue } from '@contember/binding' +import type { FieldAccessor, FieldValue } from '@contember/react-binding' import { getDiscriminatedDatum } from '../discrimination' import type { NormalizedBlocks } from './useNormalizedBlocks' diff --git a/packages/admin/src/components/bindingFacade/blocks/useBlockProps.ts b/packages/admin/src/components/bindingFacade/blocks/useBlockProps.ts index 74670f6701..f36b68b7b1 100644 --- a/packages/admin/src/components/bindingFacade/blocks/useBlockProps.ts +++ b/packages/admin/src/components/bindingFacade/blocks/useBlockProps.ts @@ -1,4 +1,4 @@ -import { useEnvironment } from '@contember/binding' +import { useEnvironment } from '@contember/react-binding' import { ReactNode, useMemo } from 'react' import type { BlockProps } from './Block' import { blockAnalyzer } from './blockAnalyzer' diff --git a/packages/admin/src/components/bindingFacade/buttons/ClearFieldButton/ClearFieldButtonInner.tsx b/packages/admin/src/components/bindingFacade/buttons/ClearFieldButton/ClearFieldButtonInner.tsx index 97acee892f..18988050a6 100644 --- a/packages/admin/src/components/bindingFacade/buttons/ClearFieldButton/ClearFieldButtonInner.tsx +++ b/packages/admin/src/components/bindingFacade/buttons/ClearFieldButton/ClearFieldButtonInner.tsx @@ -1,4 +1,4 @@ -import type { FieldAccessor } from '@contember/binding' +import type { FieldAccessor } from '@contember/react-binding' import { Button, ButtonProps, Icon } from '@contember/ui' import { useCallback } from 'react' diff --git a/packages/admin/src/components/bindingFacade/buttons/PageLinkById.tsx b/packages/admin/src/components/bindingFacade/buttons/PageLinkById.tsx index 2ad9e14d47..7b66b80c34 100644 --- a/packages/admin/src/components/bindingFacade/buttons/PageLinkById.tsx +++ b/packages/admin/src/components/bindingFacade/buttons/PageLinkById.tsx @@ -1,4 +1,4 @@ -import { EntityAccessor, useEntity } from '@contember/binding' +import { EntityAccessor, useEntity } from '@contember/react-binding' import { ComponentType, memo, ReactNode, useMemo } from 'react' import { InnerRoutingLinkProps, Link, RequestState } from '../../../routing' diff --git a/packages/admin/src/components/bindingFacade/buttons/PersistButton.tsx b/packages/admin/src/components/bindingFacade/buttons/PersistButton.tsx index 370a5f68fc..dfedd9bbcc 100644 --- a/packages/admin/src/components/bindingFacade/buttons/PersistButton.tsx +++ b/packages/admin/src/components/bindingFacade/buttons/PersistButton.tsx @@ -1,4 +1,4 @@ -import { useDirtinessState, useMutationState } from '@contember/binding' +import { useDirtinessState, useMutationState } from '@contember/react-binding' import { SaveButton, SaveButtonProps } from '@contember/ui' import { forwardRef, memo, useCallback } from 'react' import { usePersistWithFeedback } from '../../ui' diff --git a/packages/admin/src/components/bindingFacade/collections/BlockRepeater/AddNewBlockButtonInner.tsx b/packages/admin/src/components/bindingFacade/collections/BlockRepeater/AddNewBlockButtonInner.tsx index c5fd116706..f6bb00ccd1 100644 --- a/packages/admin/src/components/bindingFacade/collections/BlockRepeater/AddNewBlockButtonInner.tsx +++ b/packages/admin/src/components/bindingFacade/collections/BlockRepeater/AddNewBlockButtonInner.tsx @@ -1,4 +1,4 @@ -import { SugaredRelativeSingleField, useDesugaredRelativeSingleField } from '@contember/binding' +import { SugaredRelativeSingleField, useDesugaredRelativeSingleField } from '@contember/react-binding' import { Button, ButtonGroup, DropdownRenderProps } from '@contember/ui' import { memo } from 'react' import type { NormalizedBlocks } from '../../blocks' diff --git a/packages/admin/src/components/bindingFacade/collections/BlockRepeater/BlockRepeater.tsx b/packages/admin/src/components/bindingFacade/collections/BlockRepeater/BlockRepeater.tsx index 471cb78c4d..9c7af303eb 100644 --- a/packages/admin/src/components/bindingFacade/collections/BlockRepeater/BlockRepeater.tsx +++ b/packages/admin/src/components/bindingFacade/collections/BlockRepeater/BlockRepeater.tsx @@ -1,4 +1,4 @@ -import { Component, SugaredFieldProps } from '@contember/binding' +import { Component, SugaredFieldProps } from '@contember/react-binding' import type { FunctionComponent } from 'react' import { DiscriminatedBlocks, useNormalizedBlocks } from '../../blocks' import { Repeater, RepeaterProps } from '../Repeater' diff --git a/packages/admin/src/components/bindingFacade/collections/BlockRepeater/SortableBlock.tsx b/packages/admin/src/components/bindingFacade/collections/BlockRepeater/SortableBlock.tsx index b941564556..6d61b9c938 100644 --- a/packages/admin/src/components/bindingFacade/collections/BlockRepeater/SortableBlock.tsx +++ b/packages/admin/src/components/bindingFacade/collections/BlockRepeater/SortableBlock.tsx @@ -1,4 +1,4 @@ -import { SugaredRelativeSingleField, useField } from '@contember/binding' +import { SugaredRelativeSingleField, useField } from '@contember/react-binding' import { memo } from 'react' import { getDiscriminatedBlock, NormalizedBlocks } from '../../blocks' import { RepeaterItem, RepeaterItemProps } from '../Repeater' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridColumn.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridColumn.ts index 3cfb91a6e3..fdebf85587 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridColumn.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridColumn.ts @@ -1,4 +1,4 @@ -import { BindingError, Environment } from '@contember/binding' +import { BindingError, Environment } from '@contember/react-binding' import type { ComponentType, ReactElement, ReactNode } from 'react' import type { DataGridCellPublicProps } from './DataGridCellPublicProps' import type { DataGridColumnKey } from './DataGridColumnKey' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainer.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainer.tsx index 2dde2dd71a..610d237339 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainer.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainer.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import { Stack, useComponentClassName } from '@contember/ui' import { FunctionComponent } from 'react' import { useMessageFormatter } from '../../../../../../i18n' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerGrid.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerGrid.tsx index e5eab00b0d..0e40934d4d 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerGrid.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerGrid.tsx @@ -1,4 +1,4 @@ -import { Entity } from '@contember/binding' +import { Entity } from '@contember/react-binding' import { Grid, useComponentClassName } from '@contember/ui' import { memo } from 'react' import { DataGridContainerProps } from './Types' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerTable.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerTable.tsx index 3ecf2c0288..a3489cf587 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerTable.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/DataGridContainerTable.tsx @@ -1,4 +1,4 @@ -import { Entity, EntityId } from '@contember/binding' +import { Entity, EntityId } from '@contember/react-binding' import { Table, TableCell, TableRow, useComponentClassName } from '@contember/ui' import { memo, useMemo } from 'react' import { useMessageFormatter } from '../../../../../../i18n' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/Types.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/Types.ts index 1ccf85d313..349a70fc91 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/Types.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridContainer/Types.ts @@ -1,4 +1,4 @@ -import { EntityAccessor, EntityId, EntityListBaseProps, EntityName, Filter } from '@contember/binding' +import { EntityAccessor, EntityId, EntityListBaseProps, EntityName, Filter } from '@contember/react-binding' import { ComponentType, ReactNode } from 'react' import { EmptyMessageProps } from '../../../helpers' import type { GridPagingAction } from '../../paging' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridFullFilters.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridFullFilters.tsx index 1594535a6e..1a8bb5bde6 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridFullFilters.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridFullFilters.tsx @@ -1,4 +1,4 @@ -import type { Environment } from '@contember/binding' +import type { Environment } from '@contember/react-binding' import { Box, Button, ButtonGroup, Dropdown, DropdownProps, Icon, Table, TableCell, TableHeaderCell, TableRow } from '@contember/ui' import { createElement, Fragment, ReactElement, useMemo } from 'react' import type { MessageFormatter } from '../../../../../i18n' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridHeaderCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridHeaderCell.tsx index 77a8ec271e..7e3b8644a2 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridHeaderCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridHeaderCell.tsx @@ -1,4 +1,4 @@ -import type { Environment } from '@contember/binding' +import type { Environment } from '@contember/react-binding' import { ActionableBox, Box, Dropdown, DropdownProps, Icon, Justification, TableHeaderCell } from '@contember/ui' import { ComponentType, createElement, ReactElement, ReactNode, useMemo } from 'react' import type { FilterRendererProps } from './DataGridColumn' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridState.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridState.ts index 38ee319d9e..72e6eaa98e 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridState.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/DataGridState.ts @@ -1,4 +1,4 @@ -import { Filter, OrderBy, QualifiedEntityList } from '@contember/binding' +import { Filter, OrderBy, QualifiedEntityList } from '@contember/react-binding' import type { DispatchChangePage, GridPagingState } from '../paging' import type { DataGridColumns } from './DataGridColumn' import type { DataGridFilterArtifactStore } from './DataGridFilterArtifactStore' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/GetNewFilter.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/GetNewFilter.ts index 500c12e460..8765594a3a 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/GetNewFilter.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/GetNewFilter.ts @@ -1,4 +1,4 @@ -import type { Environment, SugaredFilter } from '@contember/binding' +import type { Environment, SugaredFilter } from '@contember/react-binding' import type { DataGridFilterArtifact } from './DataGridFilterArtifact' export interface GetNewFilterOptions { diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/GetNewOrderBy.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/GetNewOrderBy.ts index 08193181a8..48a3d92436 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/GetNewOrderBy.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/GetNewOrderBy.ts @@ -1,4 +1,4 @@ -import type { Environment, SugaredOrderBy } from '@contember/binding' +import type { Environment, SugaredOrderBy } from '@contember/react-binding' import type { DataGridOrderDirection } from './DataGridOrderDirection' export interface GetNewOrderByOptions { diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/getColumnFilter.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/getColumnFilter.ts index 25d692781a..ae69c28b2a 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/getColumnFilter.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/getColumnFilter.ts @@ -1,4 +1,4 @@ -import { Environment, Filter, QueryLanguage } from '@contember/binding' +import { Environment, Filter, QueryLanguage } from '@contember/react-binding' import type { DataGridColumnProps } from './DataGridColumn' import type { DataGridFilterArtifact } from './DataGridFilterArtifact' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/getColumnOrderBy.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/getColumnOrderBy.ts index 91f8f3afbe..e36aaf70e7 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/getColumnOrderBy.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/getColumnOrderBy.ts @@ -1,4 +1,4 @@ -import { Environment, OrderBy, QueryLanguage } from '@contember/binding' +import { Environment, OrderBy, QueryLanguage } from '@contember/react-binding' import type { DataGridColumns } from './DataGridColumn' import type { DataGridColumnKey } from './DataGridColumnKey' import type { DataGridOrderDirection } from './DataGridOrderDirection' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridDisplayedState.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridDisplayedState.ts index cd4ae9fa15..d1b5f0a920 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridDisplayedState.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridDisplayedState.ts @@ -1,7 +1,7 @@ import { ReactNode, useEffect, useState } from 'react' import { DataGridState, DataGridStateMethods } from './DataGridState' import { renderGrid } from '../grid/renderGrid' -import { TreeRootId, useEnvironment, useExtendTree } from '@contember/binding' +import { TreeRootId, useEnvironment, useExtendTree } from '@contember/react-binding' export const useDataGridDisplayedState = (stateMethods: DataGridStateMethods, desiredState: DataGridState, tile?: ReactNode): { gridState: DataGridState | undefined diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridState.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridState.ts index ffcf1cd1e9..625a6b5158 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridState.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridState.ts @@ -1,4 +1,4 @@ -import { Filter, QueryLanguage, useEnvironment } from '@contember/binding' +import { Filter, QueryLanguage, useEnvironment } from '@contember/react-binding' import { useSessionStorageState } from '@contember/react-utils' import { useMemo } from 'react' import { DataGridProps } from '../grid' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridTotalCount.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridTotalCount.ts index 9e6894d55e..9b28880676 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridTotalCount.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/base/useDataGridTotalCount.ts @@ -1,9 +1,9 @@ -import type { EntityName, Filter } from '@contember/binding' +import type { EntityName, Filter } from '@contember/react-binding' import { GraphQlBuilder } from '@contember/client' import { useContentApiRequest } from '@contember/react-client' import { useEffect } from 'react' import { useAbortController } from '@contember/react-utils' -import { DataBindingExtendAborted } from '@contember/binding' +import { DataBindingExtendAborted } from '@contember/react-binding' export const useDataGridTotalCount = (entityName: EntityName, filter: Filter | undefined): number | undefined => { const [queryState, sendQuery] = useContentApiRequest<{ diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/BooleanCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/BooleanCell.tsx index d1373aabe3..d558cc1824 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/BooleanCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/BooleanCell.tsx @@ -1,4 +1,4 @@ -import { Component, QueryLanguage, wrapFilterInHasOnes } from '@contember/binding' +import { Component, QueryLanguage, wrapFilterInHasOnes } from '@contember/react-binding' import type { Input } from '@contember/client' import { Checkbox, FieldContainer, Stack } from '@contember/ui' import type { FunctionComponent } from 'react' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/CoalesceTextCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/CoalesceTextCell.tsx index f151ffa8f6..5480793cd2 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/CoalesceTextCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/CoalesceTextCell.tsx @@ -1,5 +1,5 @@ import { CoalesceFieldView, CoalesceFieldViewProps, FieldFallbackViewPublicProps } from '../../../fieldViews' -import { Component, FieldValue, Filter, QueryLanguage, wrapFilterInHasOnes } from '@contember/binding' +import { Component, FieldValue, Filter, QueryLanguage, wrapFilterInHasOnes } from '@contember/react-binding' import { DataGridColumn, DataGridColumnPublicProps } from '../base' import { FC, ReactElement } from 'react' import { createGenericTextCellFilterCondition, GenericTextCellFilter } from './GenericTextCellFilter' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/DateCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/DateCell.tsx index b82f371e1a..3bc6b743c7 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/DateCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/DateCell.tsx @@ -1,4 +1,4 @@ -import { Component, QueryLanguage, wrapFilterInHasOnes } from '@contember/binding' +import { Component, QueryLanguage, wrapFilterInHasOnes } from '@contember/react-binding' import type { Input } from '@contember/client' import { DateInput, FieldContainer, Stack, toDateString } from '@contember/ui' import { forwardRef, FunctionComponent, memo, ReactNode, useCallback } from 'react' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/EnumCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/EnumCell.tsx index 49fa73cc25..08f4f8327d 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/EnumCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/EnumCell.tsx @@ -1,6 +1,6 @@ import { ReactNode, useMemo } from 'react' import { DataGridColumn, DataGridColumnPublicProps } from '../base' -import { Component, QueryLanguage, SugaredField, SugaredFieldProps, wrapFilterInHasOnes } from '@contember/binding' +import { Component, QueryLanguage, SugaredField, SugaredFieldProps, wrapFilterInHasOnes } from '@contember/react-binding' import { GraphQlLiteral, Input } from '@contember/client' import { FieldFallbackView, FieldFallbackViewPublicProps } from '../../../fieldViews' import { Checkbox, FieldContainer } from '@contember/ui' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/GenericCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/GenericCell.tsx index f7e889d243..440b6ec36c 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/GenericCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/GenericCell.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { FunctionComponent } from 'react' import { DataGridColumn, DataGridColumnPublicProps } from '../base' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasManyAbsentCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasManyAbsentCell.tsx index 4fa875bb22..049a1e9c9c 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasManyAbsentCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasManyAbsentCell.tsx @@ -5,7 +5,7 @@ import { QueryLanguage, SugaredRelativeEntityList, wrapFilterInHasOnes, -} from '@contember/binding' +} from '@contember/react-binding' import { Checkbox, FieldContainer } from '@contember/ui' import type { ComponentType, FunctionComponent, ReactElement, ReactNode } from 'react' import type { FieldFallbackViewPublicProps } from '../../../fieldViews' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasManySelectCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasManySelectCell.tsx index c7d68a1749..75f66e9c67 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasManySelectCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasManySelectCell.tsx @@ -7,7 +7,7 @@ import { SugaredRelativeSingleEntity, useEntityList, wrapFilterInHasOnes, -} from '@contember/binding' +} from '@contember/react-binding' import { Fragment, FunctionComponent, ReactElement, ReactNode, useMemo } from 'react' import { BaseDynamicChoiceField } from '../../../fields' import { renderDynamicChoiceFieldStatic } from '../../../fields/ChoiceField/renderDynamicChoiceFieldStatic' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasOneSelectCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasOneSelectCell.tsx index 089515f9f2..e8a8ce8fd1 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasOneSelectCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/HasOneSelectCell.tsx @@ -5,7 +5,7 @@ import { SugaredRelativeSingleEntity, useEntity, wrapFilterInHasOnes, -} from '@contember/binding' +} from '@contember/react-binding' import type { FunctionComponent } from 'react' import { DataGridColumn, DataGridColumnPublicProps } from '../base' import { renderDynamicChoiceFieldStatic } from '../../../fields/ChoiceField/renderDynamicChoiceFieldStatic' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/NullConditionFilter.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/NullConditionFilter.tsx index 4ffd182098..8d2ccec0c4 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/NullConditionFilter.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/NullConditionFilter.tsx @@ -1,5 +1,5 @@ import { FilterRendererProps } from '../base' -import { QueryLanguage, SugaredFieldProps } from '@contember/binding' +import { QueryLanguage, SugaredFieldProps } from '@contember/react-binding' import { Checkbox, FieldContainer } from '@contember/ui' import { useMessageFormatter } from '../../../../../i18n' import { dataGridCellsDictionary } from './dataGridCellsDictionary' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/NumberCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/NumberCell.tsx index e13e0bfeae..a1d17d8ce0 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/NumberCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/NumberCell.tsx @@ -1,4 +1,4 @@ -import { Component, Field, FieldValue, QueryLanguage, SugaredRelativeSingleField, wrapFilterInHasOnes } from '@contember/binding' +import { Component, Field, FieldValue, QueryLanguage, SugaredRelativeSingleField, wrapFilterInHasOnes } from '@contember/react-binding' import { Input } from '@contember/client' import { NumberInput, Select, Stack } from '@contember/ui' import type { FunctionComponent, ReactElement, ReactNode } from 'react' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/SelectCellFilter.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/SelectCellFilter.tsx index 7e9d6defa1..c316f4e864 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/SelectCellFilter.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/SelectCellFilter.tsx @@ -5,7 +5,7 @@ import { BaseDynamicChoiceField, ChoiceFieldData, MultiSelectFieldInner } from ' import { useSelectOptions } from '../../../fields/ChoiceField/hooks/useSelectOptions' import { FilterRendererProps } from '../base' import { dataGridCellsDictionary } from './dataGridCellsDictionary' -import { EntityAccessor, EntityId } from '@contember/binding' +import { EntityAccessor, EntityId } from '@contember/react-binding' import { useCurrentlyChosenEntities } from '../../../fields/ChoiceField/hooks/useCurrentlyChosenEntities' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/TextCell.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/TextCell.tsx index 0ee6656a48..30bf107a9e 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/TextCell.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/cells/TextCell.tsx @@ -5,7 +5,7 @@ import { QueryLanguage, SugaredRelativeSingleField, wrapFilterInHasOnes, -} from '@contember/binding' +} from '@contember/react-binding' import { Checkbox, FieldContainer, Stack } from '@contember/ui' import type { FunctionComponent, ReactElement, ReactNode } from 'react' import { useMessageFormatter } from '../../../../../i18n' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/ControlledDataGrid.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/ControlledDataGrid.tsx index e412bc036a..214441ef7f 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/ControlledDataGrid.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/ControlledDataGrid.tsx @@ -1,4 +1,4 @@ -import { Component, SugaredQualifiedEntityList, useEnvironment } from '@contember/binding' +import { Component, SugaredQualifiedEntityList, useEnvironment } from '@contember/react-binding' import { ContainerSpinner } from '@contember/ui' import { ComponentType, ReactElement, ReactNode, useMemo } from 'react' import type { DataGridContainerProps, DataGridContainerPublicProps } from '../base' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/DataGrid.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/DataGrid.tsx index 459d2e8c20..e791246c33 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/DataGrid.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/DataGrid.tsx @@ -1,4 +1,4 @@ -import { Component, QueryLanguage, SugaredQualifiedEntityList } from '@contember/binding' +import { Component, QueryLanguage, SugaredQualifiedEntityList } from '@contember/react-binding' import { ComponentType, ReactElement, ReactNode } from 'react' import { DataGridContainerProps, DataGridContainerPublicProps, DataGridState, DATA_GRID_DEFAULT_ITEMS_PER_PAGE, useDataGrid } from '../base' import { extractDataGridColumns } from '../structure' diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/collectFilters.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/collectFilters.ts index 9a3a490ea2..9c551d4981 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/collectFilters.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/collectFilters.ts @@ -1,4 +1,4 @@ -import type { Environment, Filter } from '@contember/binding' +import type { Environment, Filter } from '@contember/react-binding' import { DataGridColumns, DataGridFilterArtifactStore, getColumnFilter } from '../base' export const collectFilters = ( diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/collectOrderBy.ts b/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/collectOrderBy.ts index 0dc02e7181..a4330ea084 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/collectOrderBy.ts +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/collectOrderBy.ts @@ -1,4 +1,4 @@ -import type { Environment, OrderBy } from '@contember/binding' +import type { Environment, OrderBy } from '@contember/react-binding' import { DataGridColumns, DataGridOrderDirectionStore, getColumnOrderBy } from '../base' export const collectOrderBy = ( diff --git a/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/renderGrid.tsx b/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/renderGrid.tsx index dbde459862..deba5f666f 100644 --- a/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/renderGrid.tsx +++ b/packages/admin/src/components/bindingFacade/collections/DataGrid/grid/renderGrid.tsx @@ -1,4 +1,4 @@ -import { EntityListSubTree, Environment, TreeRootId } from '@contember/binding' +import { EntityListSubTree, Environment, TreeRootId } from '@contember/react-binding' import { ComponentType, Fragment, ReactElement } from 'react' import { DataGridContainer, diff --git a/packages/admin/src/components/bindingFacade/collections/Repeater/Repeater.tsx b/packages/admin/src/components/bindingFacade/collections/Repeater/Repeater.tsx index 61a2c946ef..c35a591bfe 100644 --- a/packages/admin/src/components/bindingFacade/collections/Repeater/Repeater.tsx +++ b/packages/admin/src/components/bindingFacade/collections/Repeater/Repeater.tsx @@ -1,4 +1,4 @@ -import { BindingError, Component, HasMany, SugaredRelativeEntityList, useEntityList } from '@contember/binding' +import { BindingError, Component, HasMany, SugaredRelativeEntityList, useEntityList } from '@contember/react-binding' import type { ReactElement } from 'react' import { RepeaterInner, RepeaterInnerProps } from './RepeaterInner' diff --git a/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterFieldContainer.tsx b/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterFieldContainer.tsx index 833273de5f..c67b0e4da8 100644 --- a/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterFieldContainer.tsx +++ b/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterFieldContainer.tsx @@ -1,4 +1,4 @@ -import type { EntityAccessor, EntityListAccessor } from '@contember/binding' +import type { EntityAccessor, EntityListAccessor } from '@contember/react-binding' import { FieldContainer, Stack } from '@contember/ui' import { memo, ReactNode } from 'react' import type { MessageFormatter } from '../../../../i18n' diff --git a/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterInner.tsx b/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterInner.tsx index 6fca790e59..63eec00b60 100644 --- a/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterInner.tsx +++ b/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterInner.tsx @@ -10,7 +10,7 @@ import { SugaredFieldProps, useMutationState, useSortedEntities, -} from '@contember/binding' +} from '@contember/react-binding' import { ComponentType, Fragment, ReactElement, ReactNode, useCallback } from 'react' import type { SortEndHandler } from 'react-sortable-hoc' import { useMessageFormatter } from '../../../../i18n' diff --git a/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterItem.tsx b/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterItem.tsx index a1b04f4474..4bab3e684c 100644 --- a/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterItem.tsx +++ b/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterItem.tsx @@ -1,4 +1,4 @@ -import { BindingError, RemovalType } from '@contember/binding' +import { BindingError, RemovalType } from '@contember/react-binding' import { RepeaterItemContainer, RepeaterItemContainerProps } from '@contember/ui' import { memo, ReactNode } from 'react' import { DeleteEntityButton } from '../helpers' diff --git a/packages/admin/src/components/bindingFacade/collections/helpers/CreateNewEntityButton.tsx b/packages/admin/src/components/bindingFacade/collections/helpers/CreateNewEntityButton.tsx index 5e4dd6e3bf..bdeb5e84a6 100644 --- a/packages/admin/src/components/bindingFacade/collections/helpers/CreateNewEntityButton.tsx +++ b/packages/admin/src/components/bindingFacade/collections/helpers/CreateNewEntityButton.tsx @@ -1,4 +1,4 @@ -import { EntityAccessor, useMutationState } from '@contember/binding' +import { EntityAccessor, useMutationState } from '@contember/react-binding' import { Button, ButtonProps, Icon, IconProps, useClassNamePrefix } from '@contember/ui' import { ComponentType, memo, ReactNode } from 'react' diff --git a/packages/admin/src/components/bindingFacade/collections/helpers/DeleteEntityButton.tsx b/packages/admin/src/components/bindingFacade/collections/helpers/DeleteEntityButton.tsx index 24c775fad6..d15cb2f6d6 100644 --- a/packages/admin/src/components/bindingFacade/collections/helpers/DeleteEntityButton.tsx +++ b/packages/admin/src/components/bindingFacade/collections/helpers/DeleteEntityButton.tsx @@ -1,4 +1,4 @@ -import { EntityAccessor, useEntity, useMutationState } from '@contember/binding' +import { EntityAccessor, useEntity, useMutationState } from '@contember/react-binding' import { Button, ButtonOwnProps, ButtonProps, Icon, toThemeClass } from '@contember/ui' import classNames from 'classnames' import { memo, ReactNode, useCallback } from 'react' diff --git a/packages/admin/src/components/bindingFacade/discrimination/NormalizedDiscriminatedData.ts b/packages/admin/src/components/bindingFacade/discrimination/NormalizedDiscriminatedData.ts index 6e36b6eeca..9ad0e870be 100644 --- a/packages/admin/src/components/bindingFacade/discrimination/NormalizedDiscriminatedData.ts +++ b/packages/admin/src/components/bindingFacade/discrimination/NormalizedDiscriminatedData.ts @@ -1,4 +1,4 @@ -import type { FieldValue } from '@contember/binding' +import type { FieldValue } from '@contember/react-binding' import type { ResolvedDiscriminatedDatum } from './ResolvedDiscriminatedDatum' export type NormalizedDiscriminatedData = Map> diff --git a/packages/admin/src/components/bindingFacade/discrimination/ResolvedDiscriminatedDatum.ts b/packages/admin/src/components/bindingFacade/discrimination/ResolvedDiscriminatedDatum.ts index 1b84aa5262..9981b7baba 100644 --- a/packages/admin/src/components/bindingFacade/discrimination/ResolvedDiscriminatedDatum.ts +++ b/packages/admin/src/components/bindingFacade/discrimination/ResolvedDiscriminatedDatum.ts @@ -1,4 +1,4 @@ -import type { FieldValue } from '@contember/binding' +import type { FieldValue } from '@contember/react-binding' export interface ResolvedDiscriminatedDatum { discriminateBy: FieldValue diff --git a/packages/admin/src/components/bindingFacade/discrimination/SugaredDiscriminateBy.ts b/packages/admin/src/components/bindingFacade/discrimination/SugaredDiscriminateBy.ts index 2d70909c2e..e9a221b68a 100644 --- a/packages/admin/src/components/bindingFacade/discrimination/SugaredDiscriminateBy.ts +++ b/packages/admin/src/components/bindingFacade/discrimination/SugaredDiscriminateBy.ts @@ -1,3 +1,3 @@ -import type { OptionallyVariableFieldValue } from '@contember/binding' +import type { OptionallyVariableFieldValue } from '@contember/react-binding' export type SugaredDiscriminateBy = OptionallyVariableFieldValue diff --git a/packages/admin/src/components/bindingFacade/discrimination/getDiscriminatedDatum.ts b/packages/admin/src/components/bindingFacade/discrimination/getDiscriminatedDatum.ts index 9fd43ec743..e219e090a3 100644 --- a/packages/admin/src/components/bindingFacade/discrimination/getDiscriminatedDatum.ts +++ b/packages/admin/src/components/bindingFacade/discrimination/getDiscriminatedDatum.ts @@ -1,4 +1,4 @@ -import { FieldAccessor, FieldValue } from '@contember/binding' +import { FieldAccessor, FieldValue } from '@contember/react-binding' import type { NormalizedDiscriminatedData } from './NormalizedDiscriminatedData' import type { ResolvedDiscriminatedDatum } from './ResolvedDiscriminatedDatum' diff --git a/packages/admin/src/components/bindingFacade/discrimination/useDiscriminatedData.ts b/packages/admin/src/components/bindingFacade/discrimination/useDiscriminatedData.ts index a7afb9dd96..cac86e6d28 100644 --- a/packages/admin/src/components/bindingFacade/discrimination/useDiscriminatedData.ts +++ b/packages/admin/src/components/bindingFacade/discrimination/useDiscriminatedData.ts @@ -1,4 +1,4 @@ -import { useEnvironment, VariableInputTransformer } from '@contember/binding' +import { useEnvironment, VariableInputTransformer } from '@contember/react-binding' import { useMemo } from 'react' import type { DiscriminatedDatum } from './DiscriminatedDatum' import type { NormalizedDiscriminatedData } from './NormalizedDiscriminatedData' diff --git a/packages/admin/src/components/bindingFacade/environment/DimensionsSwitcher/DimensionsRenderer.tsx b/packages/admin/src/components/bindingFacade/environment/DimensionsSwitcher/DimensionsRenderer.tsx index dd6adafce1..72ec102e3e 100644 --- a/packages/admin/src/components/bindingFacade/environment/DimensionsSwitcher/DimensionsRenderer.tsx +++ b/packages/admin/src/components/bindingFacade/environment/DimensionsSwitcher/DimensionsRenderer.tsx @@ -1,4 +1,4 @@ -import { Entity, EntityAccessor, EntityListAccessor, useEnvironment } from '@contember/binding' +import { Entity, EntityAccessor, EntityListAccessor, useEnvironment } from '@contember/react-binding' import { emptyArray } from '@contember/react-utils' import { AnchorButton, ButtonGroup, ButtonProps, Checkbox, Dropdown, DropdownProps, FieldContainer } from '@contember/ui' import { ReactNode, useCallback, useEffect, useMemo } from 'react' diff --git a/packages/admin/src/components/bindingFacade/environment/DimensionsSwitcher/DimensionsSwitcher.tsx b/packages/admin/src/components/bindingFacade/environment/DimensionsSwitcher/DimensionsSwitcher.tsx index 8d747e21ac..d147857744 100644 --- a/packages/admin/src/components/bindingFacade/environment/DimensionsSwitcher/DimensionsSwitcher.tsx +++ b/packages/admin/src/components/bindingFacade/environment/DimensionsSwitcher/DimensionsSwitcher.tsx @@ -7,7 +7,7 @@ import { QueryLanguage, SugaredQualifiedFieldList, useEnvironment, -} from '@contember/binding' +} from '@contember/react-binding' import { Spinner } from '@contember/ui' import { memo, useMemo } from 'react' import { DimensionsRenderer, DimensionsRendererProps } from './DimensionsRenderer' diff --git a/packages/admin/src/components/bindingFacade/environment/LabelMiddleware.tsx b/packages/admin/src/components/bindingFacade/environment/LabelMiddleware.tsx index b4bda6cc37..aab1757251 100644 --- a/packages/admin/src/components/bindingFacade/environment/LabelMiddleware.tsx +++ b/packages/admin/src/components/bindingFacade/environment/LabelMiddleware.tsx @@ -1,5 +1,5 @@ import { createContext, ReactChild, ReactNode, useCallback, useContext } from 'react' -import { Environment, useEnvironment } from '@contember/binding' +import { Environment, useEnvironment } from '@contember/react-binding' export type LabelMiddleware = (label: ReactNode, environment: Environment) => ReactNode diff --git a/packages/admin/src/components/bindingFacade/environment/SideDimensions.tsx b/packages/admin/src/components/bindingFacade/environment/SideDimensions.tsx index 9c428c952e..2c73282d7e 100644 --- a/packages/admin/src/components/bindingFacade/environment/SideDimensions.tsx +++ b/packages/admin/src/components/bindingFacade/environment/SideDimensions.tsx @@ -6,7 +6,7 @@ import { HasOne, StaticRenderProvider, SugaredRelativeSingleEntity, -} from '@contember/binding' +} from '@contember/react-binding' import { PureComponent, ReactElement, ReactNode, ReactNodeArray } from 'react' import { LabelMiddleware, LabelMiddlewareProvider } from './LabelMiddleware' diff --git a/packages/admin/src/components/bindingFacade/environment/Variable.tsx b/packages/admin/src/components/bindingFacade/environment/Variable.tsx index d2705604eb..13afba60e7 100644 --- a/packages/admin/src/components/bindingFacade/environment/Variable.tsx +++ b/packages/admin/src/components/bindingFacade/environment/Variable.tsx @@ -1,4 +1,4 @@ -import { Environment, useEnvironment } from '@contember/binding' +import { Environment, useEnvironment } from '@contember/react-binding' import { memo, ReactElement, ReactNode, useMemo } from 'react' interface VariableProps { diff --git a/packages/admin/src/components/bindingFacade/errors/AccessorErrors.tsx b/packages/admin/src/components/bindingFacade/errors/AccessorErrors.tsx index c44d59598a..44b854ba76 100644 --- a/packages/admin/src/components/bindingFacade/errors/AccessorErrors.tsx +++ b/packages/admin/src/components/bindingFacade/errors/AccessorErrors.tsx @@ -1,4 +1,4 @@ -import type { EntityAccessor, EntityListAccessor, FieldAccessor } from '@contember/binding' +import type { EntityAccessor, EntityListAccessor, FieldAccessor } from '@contember/react-binding' import { ErrorList, ErrorListProps } from '@contember/ui' import type { ReactElement } from 'react' import { useAccessorErrors } from './useAccessorErrors' diff --git a/packages/admin/src/components/bindingFacade/errors/useAccessorErrors.ts b/packages/admin/src/components/bindingFacade/errors/useAccessorErrors.ts index 0e0881163e..9ffd96b040 100644 --- a/packages/admin/src/components/bindingFacade/errors/useAccessorErrors.ts +++ b/packages/admin/src/components/bindingFacade/errors/useAccessorErrors.ts @@ -1,4 +1,4 @@ -import type { ErrorAccessor } from '@contember/binding' +import type { ErrorAccessor } from '@contember/react-binding' import { useMessageFormatter } from '../../../i18n' import { errorCodeDictionary } from './errorCodeDictionary' import { useCallback, useMemo } from 'react' diff --git a/packages/admin/src/components/bindingFacade/fieldViews/BooleanFieldView.tsx b/packages/admin/src/components/bindingFacade/fieldViews/BooleanFieldView.tsx index 1814f9d90e..88b52ca130 100644 --- a/packages/admin/src/components/bindingFacade/fieldViews/BooleanFieldView.tsx +++ b/packages/admin/src/components/bindingFacade/fieldViews/BooleanFieldView.tsx @@ -1,4 +1,4 @@ -import { Component, SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { Component, SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import type { FunctionComponent, ReactNode } from 'react' import { useMessageFormatter } from '../../../i18n' import { FieldFallbackView, FieldFallbackViewPublicProps } from './FieldFallbackView' diff --git a/packages/admin/src/components/bindingFacade/fieldViews/CoalesceFieldView.tsx b/packages/admin/src/components/bindingFacade/fieldViews/CoalesceFieldView.tsx index e424e78b34..5d51284136 100644 --- a/packages/admin/src/components/bindingFacade/fieldViews/CoalesceFieldView.tsx +++ b/packages/admin/src/components/bindingFacade/fieldViews/CoalesceFieldView.tsx @@ -5,7 +5,7 @@ import { QueryLanguage, SugarableRelativeSingleField, useEntity, useEnvironment, -} from '@contember/binding' +} from '@contember/react-binding' import { ReactElement, ReactNode, useMemo } from 'react' import { FieldFallbackView, FieldFallbackViewPublicProps } from './FieldFallbackView' diff --git a/packages/admin/src/components/bindingFacade/fieldViews/DateFieldView.tsx b/packages/admin/src/components/bindingFacade/fieldViews/DateFieldView.tsx index aa8707ab0f..2f394cb522 100644 --- a/packages/admin/src/components/bindingFacade/fieldViews/DateFieldView.tsx +++ b/packages/admin/src/components/bindingFacade/fieldViews/DateFieldView.tsx @@ -1,4 +1,4 @@ -import { Component, SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { Component, SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import type { FunctionComponent, ReactNode } from 'react' import { FieldFallbackView, FieldFallbackViewPublicProps } from './FieldFallbackView' diff --git a/packages/admin/src/components/bindingFacade/fieldViews/FieldFallbackView.tsx b/packages/admin/src/components/bindingFacade/fieldViews/FieldFallbackView.tsx index a1f5fe0663..9090d04c5f 100644 --- a/packages/admin/src/components/bindingFacade/fieldViews/FieldFallbackView.tsx +++ b/packages/admin/src/components/bindingFacade/fieldViews/FieldFallbackView.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { FunctionComponent, ReactNode } from 'react' import { useMessageFormatter } from '../../../i18n' import { fieldViewDictionary } from './fieldViewDictionary' diff --git a/packages/admin/src/components/bindingFacade/fieldViews/FileUrlFieldView.tsx b/packages/admin/src/components/bindingFacade/fieldViews/FileUrlFieldView.tsx index 15f9b54114..017b8f63a9 100644 --- a/packages/admin/src/components/bindingFacade/fieldViews/FileUrlFieldView.tsx +++ b/packages/admin/src/components/bindingFacade/fieldViews/FileUrlFieldView.tsx @@ -1,4 +1,4 @@ -import { Component, SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { Component, SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import type { AnchorHTMLAttributes, FunctionComponent } from 'react' export interface FileUrlFieldViewProps extends Omit, 'href'> { diff --git a/packages/admin/src/components/bindingFacade/fieldViews/ImageFieldView.tsx b/packages/admin/src/components/bindingFacade/fieldViews/ImageFieldView.tsx index 6c3a6e6840..0fa319aa50 100644 --- a/packages/admin/src/components/bindingFacade/fieldViews/ImageFieldView.tsx +++ b/packages/admin/src/components/bindingFacade/fieldViews/ImageFieldView.tsx @@ -1,4 +1,4 @@ -import { Component, FieldValue, SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { Component, FieldValue, SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import type { ImgHTMLAttributes, ReactElement } from 'react' import { FieldFallbackView, FieldFallbackViewPublicProps } from './FieldFallbackView' diff --git a/packages/admin/src/components/bindingFacade/fieldViews/VideoFieldView.tsx b/packages/admin/src/components/bindingFacade/fieldViews/VideoFieldView.tsx index 091e07f5b4..4d2aebccb1 100644 --- a/packages/admin/src/components/bindingFacade/fieldViews/VideoFieldView.tsx +++ b/packages/admin/src/components/bindingFacade/fieldViews/VideoFieldView.tsx @@ -1,4 +1,4 @@ -import { Component, FieldValue, SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { Component, FieldValue, SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import type { ReactElement, VideoHTMLAttributes } from 'react' import { FieldFallbackView, FieldFallbackViewPublicProps } from './FieldFallbackView' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/BaseDynamicChoiceField.tsx b/packages/admin/src/components/bindingFacade/fields/ChoiceField/BaseDynamicChoiceField.tsx index ef92657cca..0011b206c3 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/BaseDynamicChoiceField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/BaseDynamicChoiceField.tsx @@ -6,7 +6,7 @@ import { SugaredQualifiedEntityList, SugaredQualifiedFieldList, SugaredRelativeSingleField, -} from '@contember/binding' +} from '@contember/react-binding' import { ReactElement, ReactNode } from 'react' import { ChoiceFieldData } from './ChoiceFieldData' import { SelectFuseOptionsProps } from './hooks/useFuseFilteredOptions' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/ChoiceField.tsx b/packages/admin/src/components/bindingFacade/fields/ChoiceField/ChoiceField.tsx index df8ed1bafc..954649238d 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/ChoiceField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/ChoiceField.tsx @@ -1,4 +1,4 @@ -import { Component, EntityAccessor, FieldValue } from '@contember/binding' +import { Component, EntityAccessor, FieldValue } from '@contember/react-binding' import type { FunctionComponent } from 'react' import type { ChoiceFieldData } from './ChoiceFieldData' import { StaticSingleChoiceField, StaticSingleChoiceFieldProps } from './StaticSingleChoiceField' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/DynamicMultiChoiceField.tsx b/packages/admin/src/components/bindingFacade/fields/ChoiceField/DynamicMultiChoiceField.tsx index 788118caef..fa92fa2a4f 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/DynamicMultiChoiceField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/DynamicMultiChoiceField.tsx @@ -1,4 +1,4 @@ -import { Component, EntityAccessor, HasMany, HasManyProps, HasOne, SugaredField } from '@contember/binding' +import { Component, EntityAccessor, HasMany, HasManyProps, HasOne, SugaredField } from '@contember/react-binding' import type { FunctionComponent } from 'react' import type { ChoiceFieldData } from './ChoiceFieldData' import { DynamicMultipleChoiceFieldProps, useDynamicMultipleChoiceField } from './hooks/useDynamicMultipleChoiceField' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/DynamicSingleChoiceField.tsx b/packages/admin/src/components/bindingFacade/fields/ChoiceField/DynamicSingleChoiceField.tsx index d0ff3a2eab..8c9ba2e616 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/DynamicSingleChoiceField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/DynamicSingleChoiceField.tsx @@ -1,4 +1,4 @@ -import { Component, EntityAccessor, HasOne } from '@contember/binding' +import { Component, EntityAccessor, HasOne } from '@contember/react-binding' import type { FunctionComponent } from 'react' import type { ChoiceFieldData } from './ChoiceFieldData' import { DynamicSingleChoiceFieldProps, useDynamicSingleChoiceField } from './hooks/useDynamicSingleChoiceField' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/StaticSingleChoiceField.tsx b/packages/admin/src/components/bindingFacade/fields/ChoiceField/StaticSingleChoiceField.tsx index 7f91dc0a06..9f0e51d0ce 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/StaticSingleChoiceField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/StaticSingleChoiceField.tsx @@ -4,7 +4,7 @@ import { FieldValue, OptionallyVariableFieldValue, SugaredRelativeSingleField, -} from '@contember/binding' +} from '@contember/react-binding' import { FunctionComponent, ReactNode } from 'react' import type { ChoiceFieldData } from './ChoiceFieldData' import { useStaticSingleChoiceField } from './hooks/useStaticSingleChoiceField' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCreateOptionsFilter.ts b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCreateOptionsFilter.ts index ad2e1be1c9..cf709b19a7 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCreateOptionsFilter.ts +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCreateOptionsFilter.ts @@ -1,7 +1,7 @@ import { LazyChoiceFieldSettings, ChoiceFieldSearchByFields } from '../BaseDynamicChoiceField' import { useCallback } from 'react' import { useSearchFields } from './useSearchFields' -import { BindingError, Filter, wrapFilterInHasOnes } from '@contember/binding' +import { BindingError, Filter, wrapFilterInHasOnes } from '@contember/react-binding' import { DesugaredOptionPath } from './useDesugaredOptionPath' export const useCreateOptionsFilter = ( diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCurrentValues.ts b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCurrentValues.ts index 002f25554b..531b979393 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCurrentValues.ts +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCurrentValues.ts @@ -1,7 +1,7 @@ import { useDesugaredOptionPath } from './useDesugaredOptionPath' import { useNormalizedOptions } from './useNormalizedOptions' import { BaseDynamicChoiceField } from '../BaseDynamicChoiceField' -import { EntityAccessor } from '@contember/binding' +import { EntityAccessor } from '@contember/react-binding' export const useCurrentValues = ( optionProps: BaseDynamicChoiceField, diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCurrentlyChosenEntities.ts b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCurrentlyChosenEntities.ts index 5da0e0c3f4..db5cea0963 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCurrentlyChosenEntities.ts +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useCurrentlyChosenEntities.ts @@ -1,5 +1,5 @@ import { BaseDynamicChoiceField } from '../BaseDynamicChoiceField' -import { EntityId, Filter, TreeRootId, useEnvironment, useExtendTree } from '@contember/binding' +import { EntityAccessor, EntityId, Filter, TreeRootId, useEnvironment, useExtendTree } from '@contember/react-binding' import { useDesugaredOptionPath } from './useDesugaredOptionPath' import { useEffect, useMemo, useState } from 'react' import { useTopLevelOptionAccessors } from './useTopLevelOptionAccessor' @@ -8,7 +8,7 @@ import { renderDynamicChoiceFieldStatic } from '../renderDynamicChoiceFieldStati export const useCurrentlyChosenEntities = ( optionProps: BaseDynamicChoiceField, ids: EntityId[], -) => { +): EntityAccessor[] => { const filter = useMemo(() => ({ id: { in: ids }, }), [ids]) diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDesugaredOptionPath.ts b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDesugaredOptionPath.ts index aeef1da975..b5a0f1326a 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDesugaredOptionPath.ts +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDesugaredOptionPath.ts @@ -14,7 +14,7 @@ import { SugaredQualifiedEntityList, SugaredQualifiedFieldList, useEnvironment, -} from '@contember/binding' +} from '@contember/react-binding' export type DesugaredOptionPath = QualifiedFieldList | QualifiedEntityList; diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicMultipleChoiceField.ts b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicMultipleChoiceField.ts index 745c4498bb..5f1b8b0567 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicMultipleChoiceField.ts +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicMultipleChoiceField.ts @@ -1,4 +1,4 @@ -import { EntityAccessor, SugaredRelativeEntityList, useEntityList, useSortedEntities } from '@contember/binding' +import { EntityAccessor, SugaredRelativeEntityList, useEntityList, useSortedEntities } from '@contember/react-binding' import { useCallback } from 'react' import { BaseDynamicChoiceField } from '../BaseDynamicChoiceField' import type { ChoiceFieldData } from '../ChoiceFieldData' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicMultipleChoiceWithConnectingEntityField.ts b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicMultipleChoiceWithConnectingEntityField.ts index 3cbf1f0e36..8b4ab89be7 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicMultipleChoiceWithConnectingEntityField.ts +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicMultipleChoiceWithConnectingEntityField.ts @@ -5,7 +5,7 @@ import { useDesugaredRelativeSingleEntity, useEntityList, useSortedEntities, -} from '@contember/binding' +} from '@contember/react-binding' import { useCallback, useMemo } from 'react' import type { ChoiceFieldData } from '../ChoiceFieldData' import { useSelectOptions } from './useSelectOptions' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicSingleChoiceField.tsx b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicSingleChoiceField.tsx index e4c07cf600..393ad31602 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicSingleChoiceField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useDynamicSingleChoiceField.tsx @@ -6,7 +6,7 @@ import { useAccessorUpdateSubscription, useEntity, useEnvironment, -} from '@contember/binding' +} from '@contember/react-binding' import { useCallback, useMemo } from 'react' import { BaseDynamicChoiceField, BaseDynamicChoiceFieldOptions } from '../BaseDynamicChoiceField' import type { ChoiceFieldData } from '../ChoiceFieldData' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useNormalizedOptions.tsx b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useNormalizedOptions.tsx index a215d09fb9..3f013bc979 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useNormalizedOptions.tsx +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useNormalizedOptions.tsx @@ -1,7 +1,7 @@ import { ChoiceFieldData } from '../ChoiceFieldData' import { useMemo } from 'react' import { BaseDynamicChoiceField } from '../BaseDynamicChoiceField' -import { Entity, EntityAccessor } from '@contember/binding' +import { Entity, EntityAccessor } from '@contember/react-binding' import { DesugaredOptionPath } from './useDesugaredOptionPath' import { useSearchFields } from './useSearchFields' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useOnAddNew.tsx b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useOnAddNew.tsx index a7552962e5..df274b5164 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useOnAddNew.tsx +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useOnAddNew.tsx @@ -4,7 +4,7 @@ import { EntityAccessor, useAccessorTreeState, useGetEntityListSubTree, -} from '@contember/binding' +} from '@contember/react-binding' import { Button, Stack, useDialog } from '@contember/ui' import { useMemo } from 'react' import { useMessageFormatter } from '../../../../../i18n' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useSearchFields.ts b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useSearchFields.ts index 7b3e3d278b..2e930655e2 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useSearchFields.ts +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useSearchFields.ts @@ -1,6 +1,6 @@ import { ChoiceFieldSearchByFields } from '../BaseDynamicChoiceField' import { useMemo } from 'react' -import { QueryLanguage, RelativeSingleField, useEnvironment } from '@contember/binding' +import { QueryLanguage, RelativeSingleField, useEnvironment } from '@contember/react-binding' export const useSearchFields = (searchByFields: ChoiceFieldSearchByFields | undefined): RelativeSingleField[] => { const sugaredSearchFields = useMemo( diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useSelectOptions.ts b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useSelectOptions.ts index df4c9dc7df..b86207b146 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useSelectOptions.ts +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useSelectOptions.ts @@ -1,5 +1,5 @@ import { BaseDynamicChoiceField } from '../BaseDynamicChoiceField' -import { EntityAccessor, Filter, TreeRootId, useEnvironment, useExtendTree, useTreeRootId } from '@contember/binding' +import { EntityAccessor, Filter, TreeRootId, useEnvironment, useExtendTree, useTreeRootId } from '@contember/react-binding' import { ChoiceFieldData } from '../ChoiceFieldData' import { useEffect, useMemo, useRef, useState } from 'react' import { useDesugaredOptionPath } from './useDesugaredOptionPath' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useStaticSingleChoiceField.ts b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useStaticSingleChoiceField.ts index bc4d32b921..e4bba9a5ae 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useStaticSingleChoiceField.ts +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useStaticSingleChoiceField.ts @@ -1,5 +1,5 @@ import { ChoiceFieldData } from '../ChoiceFieldData' -import { FieldValue, useEnvironment, useField, VariableInputTransformer } from '@contember/binding' +import { FieldValue, useEnvironment, useField, VariableInputTransformer } from '@contember/react-binding' import { useCallback, useMemo, useState } from 'react' import { OptionallyVariableStaticOption, StaticSingleChoiceFieldProps } from '../StaticSingleChoiceField' import { useAccessorErrors } from '../../../errors' diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useTopLevelOptionAccessor.ts b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useTopLevelOptionAccessor.ts index 1a761b894b..9285ba8c25 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useTopLevelOptionAccessor.ts +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/hooks/useTopLevelOptionAccessor.ts @@ -1,8 +1,8 @@ import { useMemo } from 'react' -import { SugaredQualifiedEntityList, TreeRootId, useEntityListSubTree } from '@contember/binding' +import { EntityAccessor, SugaredQualifiedEntityList, TreeRootId, useEntityListSubTree } from '@contember/react-binding' import { DesugaredOptionPath } from './useDesugaredOptionPath' -export const useTopLevelOptionAccessors = (desugaredOptionPath: DesugaredOptionPath, treeRootId: TreeRootId | undefined) => { +export const useTopLevelOptionAccessors = (desugaredOptionPath: DesugaredOptionPath, treeRootId: TreeRootId | undefined): EntityAccessor[] => { const entityList = useMemo( () => ({ entities: desugaredOptionPath, ...desugaredOptionPath }), [desugaredOptionPath], diff --git a/packages/admin/src/components/bindingFacade/fields/ChoiceField/renderDynamicChoiceFieldStatic.tsx b/packages/admin/src/components/bindingFacade/fields/ChoiceField/renderDynamicChoiceFieldStatic.tsx index 2364fe8a7e..f67126cdc2 100644 --- a/packages/admin/src/components/bindingFacade/fields/ChoiceField/renderDynamicChoiceFieldStatic.tsx +++ b/packages/admin/src/components/bindingFacade/fields/ChoiceField/renderDynamicChoiceFieldStatic.tsx @@ -1,5 +1,5 @@ import { ReactElement } from 'react' -import { EntityListSubTree, Environment, Field, Filter } from '@contember/binding' +import { EntityListSubTree, Environment, Field, Filter } from '@contember/react-binding' import { BaseDynamicChoiceField } from './BaseDynamicChoiceField' import { getDesugaredEntityList, getDesugaredFieldList } from './hooks/useDesugaredOptionPath' diff --git a/packages/admin/src/components/bindingFacade/fields/LocationField/LocationField.tsx b/packages/admin/src/components/bindingFacade/fields/LocationField/LocationField.tsx index db7691f669..e16343e841 100644 --- a/packages/admin/src/components/bindingFacade/fields/LocationField/LocationField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/LocationField/LocationField.tsx @@ -1,4 +1,4 @@ -import { Component, SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { Component, SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import { FieldContainer, FieldContainerProps } from '@contember/ui' import * as Leaflet from 'leaflet' import { FunctionComponent, useCallback, useEffect, useState } from 'react' diff --git a/packages/admin/src/components/bindingFacade/fields/RadioField.tsx b/packages/admin/src/components/bindingFacade/fields/RadioField.tsx index 9c85df7155..9020e1de4a 100644 --- a/packages/admin/src/components/bindingFacade/fields/RadioField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/RadioField.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { FieldErrors, RadioProps } from '@contember/ui' import { FieldContainer, FieldContainerProps, Radio } from '@contember/ui' import type { FunctionComponent } from 'react' diff --git a/packages/admin/src/components/bindingFacade/fields/SelectField/MultiSelectField.tsx b/packages/admin/src/components/bindingFacade/fields/SelectField/MultiSelectField.tsx index 393e88ab6c..65db1833aa 100644 --- a/packages/admin/src/components/bindingFacade/fields/SelectField/MultiSelectField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/SelectField/MultiSelectField.tsx @@ -1,4 +1,4 @@ -import { Component, EntityAccessor } from '@contember/binding' +import { Component, EntityAccessor } from '@contember/react-binding' import { FieldContainer, FieldContainerProps, FieldErrors, getPortalRoot, PublicCommonReactSelectStylesProps, SelectCreateNewWrapper } from '@contember/ui' import { FunctionComponent, memo, MouseEventHandler, useCallback } from 'react' import type { MultiValueGenericProps, MultiValueProps, Props as SelectProps } from 'react-select' diff --git a/packages/admin/src/components/bindingFacade/fields/SelectField/SelectField.tsx b/packages/admin/src/components/bindingFacade/fields/SelectField/SelectField.tsx index bb7e2bd6de..9c5c69df1c 100644 --- a/packages/admin/src/components/bindingFacade/fields/SelectField/SelectField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/SelectField/SelectField.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import { FieldContainer, FieldContainerProps, FieldErrors, getPortalRoot, PublicCommonReactSelectStylesProps, SelectCreateNewWrapper } from '@contember/ui' import { FunctionComponent, memo } from 'react' import type { Props as SelectProps } from 'react-select' diff --git a/packages/admin/src/components/bindingFacade/fields/SlugField.tsx b/packages/admin/src/components/bindingFacade/fields/SlugField.tsx index 06b78d31db..55e229c053 100644 --- a/packages/admin/src/components/bindingFacade/fields/SlugField.tsx +++ b/packages/admin/src/components/bindingFacade/fields/SlugField.tsx @@ -5,7 +5,7 @@ import { SugaredRelativeSingleField, useDerivedField, useEnvironment, -} from '@contember/binding' +} from '@contember/react-binding' import { ControlProps, SlugInput } from '@contember/ui' import slugify from '@sindresorhus/slugify' import { useCallback, useMemo } from 'react' diff --git a/packages/admin/src/components/bindingFacade/fields/useFieldControl.ts b/packages/admin/src/components/bindingFacade/fields/useFieldControl.ts index 136851ee60..81b5c8ef92 100644 --- a/packages/admin/src/components/bindingFacade/fields/useFieldControl.ts +++ b/packages/admin/src/components/bindingFacade/fields/useFieldControl.ts @@ -1,5 +1,5 @@ -import type { FieldAccessor, FieldValue } from '@contember/binding' -import { useEntityBeforePersist } from '@contember/binding' +import type { FieldAccessor, FieldValue } from '@contember/react-binding' +import { useEntityBeforePersist } from '@contember/react-binding' import type { AllControlProps, ControlProps } from '@contember/ui' import { Ref, useCallback, useEffect, useRef, useState } from 'react' import type { SimpleRelativeSingleFieldMetadata } from '../auxiliary' diff --git a/packages/admin/src/components/bindingFacade/renderers/FeedbackRenderer.tsx b/packages/admin/src/components/bindingFacade/renderers/FeedbackRenderer.tsx index 5a5c246358..720ef45206 100644 --- a/packages/admin/src/components/bindingFacade/renderers/FeedbackRenderer.tsx +++ b/packages/admin/src/components/bindingFacade/renderers/FeedbackRenderer.tsx @@ -1,4 +1,4 @@ -import type { AccessorTreeState } from '@contember/binding' +import type { AccessorTreeState } from '@contember/react-binding' import { ContainerSpinner, Message } from '@contember/ui' import { ReactNode, useEffect } from 'react' import { useRedirect } from '../../../routing' diff --git a/packages/admin/src/components/bindingFacade/renderers/LayoutRenderer.tsx b/packages/admin/src/components/bindingFacade/renderers/LayoutRenderer.tsx index fe1b345df1..1c0635e1d8 100644 --- a/packages/admin/src/components/bindingFacade/renderers/LayoutRenderer.tsx +++ b/packages/admin/src/components/bindingFacade/renderers/LayoutRenderer.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import { LayoutPage, LayoutPageProps } from '@contember/ui' import { FunctionComponent } from 'react' diff --git a/packages/admin/src/components/bindingFacade/renderers/listRenderers/ImmutableEntityListRenderer.tsx b/packages/admin/src/components/bindingFacade/renderers/listRenderers/ImmutableEntityListRenderer.tsx index e9f9699f3b..da72960a88 100644 --- a/packages/admin/src/components/bindingFacade/renderers/listRenderers/ImmutableEntityListRenderer.tsx +++ b/packages/admin/src/components/bindingFacade/renderers/listRenderers/ImmutableEntityListRenderer.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement, ReactNode } from 'react' import { RepeaterInner, RepeaterInnerProps } from '../../collections' diff --git a/packages/admin/src/components/bindingFacade/renderers/listRenderers/MutableEntityListRenderer.tsx b/packages/admin/src/components/bindingFacade/renderers/listRenderers/MutableEntityListRenderer.tsx index d9532fd020..7d506d39a0 100644 --- a/packages/admin/src/components/bindingFacade/renderers/listRenderers/MutableEntityListRenderer.tsx +++ b/packages/admin/src/components/bindingFacade/renderers/listRenderers/MutableEntityListRenderer.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement, ReactNode } from 'react' import { RepeaterInner, RepeaterInnerProps } from '../../collections' diff --git a/packages/admin/src/components/bindingFacade/renderers/pageRenderers/DataGridPageRenderer.tsx b/packages/admin/src/components/bindingFacade/renderers/pageRenderers/DataGridPageRenderer.tsx index a095753bee..1be993ed93 100644 --- a/packages/admin/src/components/bindingFacade/renderers/pageRenderers/DataGridPageRenderer.tsx +++ b/packages/admin/src/components/bindingFacade/renderers/pageRenderers/DataGridPageRenderer.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import { DataGridContainer, DataGridContainerProps } from '../../collections' import { LayoutRenderer, LayoutRendererProps } from '../LayoutRenderer' diff --git a/packages/admin/src/components/bindingFacade/renderers/pageRenderers/ImmutableEntityListPageRenderer.tsx b/packages/admin/src/components/bindingFacade/renderers/pageRenderers/ImmutableEntityListPageRenderer.tsx index c5c7e30bd9..cb61c2999b 100644 --- a/packages/admin/src/components/bindingFacade/renderers/pageRenderers/ImmutableEntityListPageRenderer.tsx +++ b/packages/admin/src/components/bindingFacade/renderers/pageRenderers/ImmutableEntityListPageRenderer.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import { LayoutRenderer, LayoutRendererProps } from '../LayoutRenderer' import { ImmutableEntityListRenderer, ImmutableEntityListRendererProps } from '../listRenderers' diff --git a/packages/admin/src/components/bindingFacade/renderers/pageRenderers/ImmutableEntityListTablePageRenderer.tsx b/packages/admin/src/components/bindingFacade/renderers/pageRenderers/ImmutableEntityListTablePageRenderer.tsx index af3da491eb..3233f7be04 100644 --- a/packages/admin/src/components/bindingFacade/renderers/pageRenderers/ImmutableEntityListTablePageRenderer.tsx +++ b/packages/admin/src/components/bindingFacade/renderers/pageRenderers/ImmutableEntityListTablePageRenderer.tsx @@ -1,4 +1,4 @@ -import { Component, Entity, EntityAccessor, EntityListAccessor } from '@contember/binding' +import { Component, Entity, EntityAccessor, EntityListAccessor } from '@contember/react-binding' import { Table, TableCell, TableProps, TableRow, TableRowProps } from '@contember/ui' import { memo, ReactElement, ReactNode } from 'react' import { DeleteEntityButton, EmptyMessage, EmptyMessageOuterProps } from '../../collections' diff --git a/packages/admin/src/components/bindingFacade/renderers/pageRenderers/MutableEntityListPageRenderer.tsx b/packages/admin/src/components/bindingFacade/renderers/pageRenderers/MutableEntityListPageRenderer.tsx index e0deaa70f4..bfa1217e35 100644 --- a/packages/admin/src/components/bindingFacade/renderers/pageRenderers/MutableEntityListPageRenderer.tsx +++ b/packages/admin/src/components/bindingFacade/renderers/pageRenderers/MutableEntityListPageRenderer.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import { PersistButton } from '../../buttons' import { LayoutRenderer, LayoutRendererProps } from '../LayoutRenderer' diff --git a/packages/admin/src/components/bindingFacade/richText/ContemberEditor/methods/getElementDataAttributes.ts b/packages/admin/src/components/bindingFacade/richText/ContemberEditor/methods/getElementDataAttributes.ts index ee8689bf59..061352fd47 100644 --- a/packages/admin/src/components/bindingFacade/richText/ContemberEditor/methods/getElementDataAttributes.ts +++ b/packages/admin/src/components/bindingFacade/richText/ContemberEditor/methods/getElementDataAttributes.ts @@ -1,4 +1,4 @@ -import type { Scalar } from '@contember/binding' +import type { Scalar } from '@contember/react-binding' import { Element as SlateElement } from 'slate' export interface ElementDataAttributes { diff --git a/packages/admin/src/components/bindingFacade/richText/ContemberEditor/methods/toLatestFormat.ts b/packages/admin/src/components/bindingFacade/richText/ContemberEditor/methods/toLatestFormat.ts index 022934d935..cbb7f1ea28 100644 --- a/packages/admin/src/components/bindingFacade/richText/ContemberEditor/methods/toLatestFormat.ts +++ b/packages/admin/src/components/bindingFacade/richText/ContemberEditor/methods/toLatestFormat.ts @@ -1,4 +1,4 @@ -import { BindingError } from '@contember/binding' +import { BindingError } from '@contember/react-binding' import type { SerializableEditorNode } from '../../baseEditor' import { Editor as SlateEditor, Element as SlateElement } from 'slate' diff --git a/packages/admin/src/components/bindingFacade/richText/RichTextField/RichTextField.tsx b/packages/admin/src/components/bindingFacade/richText/RichTextField/RichTextField.tsx index 6969aada1b..4fd6bf4edd 100644 --- a/packages/admin/src/components/bindingFacade/richText/RichTextField/RichTextField.tsx +++ b/packages/admin/src/components/bindingFacade/richText/RichTextField/RichTextField.tsx @@ -6,7 +6,7 @@ import { QueryLanguage, useEntity, useMutationState, -} from '@contember/binding' +} from '@contember/react-binding' import { EditorCanvas, EditorCanvasDistinction, FieldContainer, FieldContainerProps } from '@contember/ui' import { FunctionComponent, useCallback, useMemo, useState } from 'react' import { Descendant, Editor, Element as SlateElement, Node as SlateNode, NodeEntry, Transforms } from 'slate' diff --git a/packages/admin/src/components/bindingFacade/richText/RichTextField/useRichTextFieldNodes.ts b/packages/admin/src/components/bindingFacade/richText/RichTextField/useRichTextFieldNodes.ts index 232e8acb43..3069f4526e 100644 --- a/packages/admin/src/components/bindingFacade/richText/RichTextField/useRichTextFieldNodes.ts +++ b/packages/admin/src/components/bindingFacade/richText/RichTextField/useRichTextFieldNodes.ts @@ -1,4 +1,4 @@ -import { BindingError, FieldAccessor } from '@contember/binding' +import { BindingError, FieldAccessor } from '@contember/react-binding' import { Descendant, Editor } from 'slate' export interface UseRichTextFieldEditorNodeOptions { diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/BlockEditor.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/BlockEditor.tsx index 0cb070ee6d..63a25a04bd 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/BlockEditor.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/BlockEditor.tsx @@ -10,7 +10,7 @@ import { useDesugaredRelativeSingleField, useEnvironment, VariableInputTransformer, -} from '@contember/binding' +} from '@contember/react-binding' import { emptyArray, noop } from '@contember/react-utils' import { EditorCanvas, EditorCanvasSize, FieldContainer, Scheme } from '@contember/ui' import { Fragment, FunctionComponent, ReactElement, ReactNode, useCallback, useLayoutEffect, useMemo, useState } from 'react' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/BlockHoveringToolbarContents.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/BlockHoveringToolbarContents.tsx index 6f48cc4f2a..e37fd21f90 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/BlockHoveringToolbarContents.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/BlockHoveringToolbarContents.tsx @@ -1,4 +1,4 @@ -import { BindingError, Environment, useEnvironment, VariableInputTransformer } from '@contember/binding' +import { BindingError, Environment, useEnvironment, VariableInputTransformer } from '@contember/react-binding' import { EditorToolbar, IconSourceSpecification, ToolbarGroup } from '@contember/ui' import { memo, MouseEvent as ReactMouseEvent, useMemo } from 'react' import { useSlateStatic } from 'slate-react' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/FieldBackedElement.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/FieldBackedElement.ts index 73e2a04073..2988a975cd 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/FieldBackedElement.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/FieldBackedElement.ts @@ -1,4 +1,4 @@ -import { SugarableRelativeSingleField } from '@contember/binding' +import { SugarableRelativeSingleField } from '@contember/react-binding' import { EditorCanvasDistinction, Size } from '@contember/ui' import { ReactNode } from 'react' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/EditorWithBlocks.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/EditorWithBlocks.ts index b5e1d1e890..db40f8aedc 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/EditorWithBlocks.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/EditorWithBlocks.ts @@ -1,4 +1,4 @@ -import type { EntityAccessor, FieldValue } from '@contember/binding' +import type { EntityAccessor, FieldValue } from '@contember/react-binding' import type * as Slate from 'slate' import { Editor } from 'slate' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/initBlockEditor.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/initBlockEditor.ts index 95a6ea7bb0..b6ffc9eb6a 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/initBlockEditor.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/initBlockEditor.ts @@ -1,4 +1,4 @@ -import { BindingError } from '@contember/binding' +import { BindingError } from '@contember/react-binding' import * as Slate from 'slate' import { Descendant, Editor, Element as SlateElement, Node as SlateNode } from 'slate' import { CreateEditorPublicOptions, initializeEditor } from '../../editorFactory' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/overrideInsertData.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/overrideInsertData.ts index 94595198f8..19c81f68b9 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/overrideInsertData.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/editor/overrideInsertData.ts @@ -1,4 +1,4 @@ -import type { FieldValue, RelativeSingleField } from '@contember/binding' +import type { FieldValue, RelativeSingleField } from '@contember/react-binding' import { Descendant, Element as SlateElement, Node as SlateNode, Text } from 'slate' import type { ResolvedDiscriminatedDatum } from '../../../discrimination' import { ReferenceElement, referenceElementType } from '../elements' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/elements/ElementWithReference.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/elements/ElementWithReference.ts index e436b26388..82ff300088 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/elements/ElementWithReference.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/elements/ElementWithReference.ts @@ -1,5 +1,5 @@ import { Element, Node, Text } from 'slate' -import { EntityId } from '@contember/binding' +import { EntityId } from '@contember/react-binding' // This isn't necessarily meant to represent an actual element that will appear in the editor. export interface ElementWithReference extends Element { diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/elements/ReferenceElement.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/elements/ReferenceElement.tsx index 6fcb03f29a..5a0d05bc69 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/elements/ReferenceElement.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/elements/ReferenceElement.tsx @@ -2,7 +2,7 @@ import { Ancestor, Element, Node, Path } from 'slate' import type { ElementWithReference } from './ElementWithReference' import { CustomElementPlugin } from '../../baseEditor' import { ReferenceElementRenderer } from '../renderers' -import { BindingError, EntityAccessor, EntityId, FieldValue, RelativeSingleField } from '@contember/binding' +import { BindingError, EntityAccessor, EntityId, FieldValue, RelativeSingleField } from '@contember/react-binding' import { getDiscriminatedDatum } from '../../../discrimination' import { EditorReferenceBlocks } from '../templating' import { NormalizedEmbedHandlers } from '../embed' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/core/EmbedHandler.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/core/EmbedHandler.ts index ed01e72b50..849df2c0aa 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/core/EmbedHandler.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/core/EmbedHandler.ts @@ -1,4 +1,4 @@ -import type { EntityAccessor, Environment } from '@contember/binding' +import type { EntityAccessor, Environment } from '@contember/react-binding' import type { ReactNode } from 'react' import type { NormalizedDiscriminatedData, SugaredDiscriminateBy } from '../../../../discrimination' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/GoogleFormEmbedHandler.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/GoogleFormEmbedHandler.tsx index 1a3ace092b..fea2c6745f 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/GoogleFormEmbedHandler.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/GoogleFormEmbedHandler.tsx @@ -1,4 +1,4 @@ -import { SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import { memo, ReactNode } from 'react' import type { SugaredDiscriminateBy } from '../../../../discrimination' import type { EmbedHandler, PopulateEmbedDataOptions } from '../core' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/SoundCloudEmbedHandler.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/SoundCloudEmbedHandler.tsx index b4819d0bf9..6dd45e4aa0 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/SoundCloudEmbedHandler.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/SoundCloudEmbedHandler.tsx @@ -1,4 +1,4 @@ -import { SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import { memo, ReactNode } from 'react' import type { SugaredDiscriminateBy } from '../../../../discrimination' import type { EmbedHandler, PopulateEmbedDataOptions } from '../core' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/SpotifyEmbedHandler.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/SpotifyEmbedHandler.tsx index ae459a41f1..11d1696953 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/SpotifyEmbedHandler.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/SpotifyEmbedHandler.tsx @@ -1,4 +1,4 @@ -import { SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import { memo, ReactNode } from 'react' import type { SugaredDiscriminateBy } from '../../../../discrimination' import type { EmbedHandler, PopulateEmbedDataOptions } from '../core' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/VimeoEmbedHandler.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/VimeoEmbedHandler.tsx index adddd420d1..37eac873fe 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/VimeoEmbedHandler.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/VimeoEmbedHandler.tsx @@ -1,4 +1,4 @@ -import { SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import { memo, ReactNode } from 'react' import type { SugaredDiscriminateBy } from '../../../../discrimination' import type { EmbedHandler, PopulateEmbedDataOptions } from '../core' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/YouTubeEmbedHandler.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/YouTubeEmbedHandler.tsx index dce2c75b66..486c967ff6 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/YouTubeEmbedHandler.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/embed/handlers/YouTubeEmbedHandler.tsx @@ -1,4 +1,4 @@ -import { SugaredField, SugaredFieldProps, useField } from '@contember/binding' +import { SugaredField, SugaredFieldProps, useField } from '@contember/react-binding' import { memo, ReactNode } from 'react' import type { SugaredDiscriminateBy } from '../../../../discrimination' import type { EmbedHandler, PopulateEmbedDataOptions } from '../core' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/ReferenceElementWrapper.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/ReferenceElementWrapper.tsx index 6c69183449..bee51ab864 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/ReferenceElementWrapper.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/ReferenceElementWrapper.tsx @@ -1,6 +1,6 @@ import { FC, ReactNode } from 'react' import { ElementWithReference } from '../elements' -import { AccessorProvider } from '@contember/binding' +import { AccessorProvider } from '@contember/react-binding' import { useReferencedEntity } from './useReferencedEntity' import { ReactEditor, useSlateStatic } from 'slate-react' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/ReferencesProvider.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/ReferencesProvider.tsx index f4000acac1..25932fa298 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/ReferencesProvider.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/ReferencesProvider.tsx @@ -1,5 +1,5 @@ import { createContext, FC, ReactNode } from 'react' -import { BindingError } from '@contember/binding' +import { BindingError } from '@contember/react-binding' import { GetReferencedEntity } from './useGetReferencedEntity' export const ReferencesContext = createContext(() => { diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useCreateElementReference.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useCreateElementReference.ts index 73b570d69d..6f29a90ea3 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useCreateElementReference.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useCreateElementReference.ts @@ -8,7 +8,7 @@ import { SugaredFieldProps, SugaredRelativeEntityList, useBindingOperations, -} from '@contember/binding' +} from '@contember/react-binding' import { MutableRefObject, useCallback } from 'react' import { useGetReferenceEntityList } from './useGetReferenceEntityList' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useGetReferenceEntityList.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useGetReferenceEntityList.ts index d9e8506807..1973f4d451 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useGetReferenceEntityList.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useGetReferenceEntityList.ts @@ -5,7 +5,7 @@ import { EntityListAccessor, SugaredRelativeEntityList, useEntityList, -} from '@contember/binding' +} from '@contember/react-binding' import { MutableRefObject, useCallback } from 'react' import { useConstantValueInvariant } from '@contember/react-utils' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useGetReferencedEntity.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useGetReferencedEntity.ts index 05ab4444df..6100b155ce 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useGetReferencedEntity.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useGetReferencedEntity.ts @@ -1,5 +1,5 @@ import { Path } from 'slate' -import { EntityAccessor, EntityId } from '@contember/binding' +import { EntityAccessor, EntityId } from '@contember/react-binding' import { ReferencesOptions, useGetReferenceEntityList } from './useGetReferenceEntityList' import { useCallback } from 'react' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useInsertElementWithReference.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useInsertElementWithReference.ts index 4b026fbabb..d03abfede4 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useInsertElementWithReference.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/references/useInsertElementWithReference.ts @@ -1,6 +1,6 @@ import { useCallback } from 'react' import { Editor, Element as SlateElement, Transforms } from 'slate' -import { EntityAccessor, FieldValue } from '@contember/binding' +import { EntityAccessor, FieldValue } from '@contember/react-binding' import { prepareElementForInsertion } from '../utils' import { ElementWithReference } from '../elements' import { CreateElementReferences } from './useCreateElementReference' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/renderers/ReferenceElementRenderer.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/renderers/ReferenceElementRenderer.tsx index c0833d6195..2feed78815 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/renderers/ReferenceElementRenderer.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/renderers/ReferenceElementRenderer.tsx @@ -1,4 +1,4 @@ -import { BindingError, Entity, RelativeSingleField, useEntity } from '@contember/binding' +import { BindingError, Entity, RelativeSingleField, useEntity } from '@contember/react-binding' import { ActionableBox, Box, EditorPlaceholder, FieldSet } from '@contember/ui' import { memo, MouseEvent as ReactMouseEvent, ReactNode, useCallback } from 'react' import { Transforms } from 'slate' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/SortedBlocksContext.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/SortedBlocksContext.tsx index ab0a621d4c..39b3113d5a 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/SortedBlocksContext.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/SortedBlocksContext.tsx @@ -1,4 +1,4 @@ import { createContext } from 'react' -import { EntityAccessor } from '@contember/binding' +import { EntityAccessor } from '@contember/react-binding' export const SortedBlocksContext = createContext([]) diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockEditorOnChange.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockEditorOnChange.ts index cd78f9abb3..86d0f48094 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockEditorOnChange.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockEditorOnChange.ts @@ -9,7 +9,7 @@ import { SugaredRelativeEntityList, useDesugaredRelativeEntityList, useDesugaredRelativeSingleField, -} from '@contember/binding' +} from '@contember/react-binding' import { useGetParentEntityRef } from '../useGetParentEntityRef' import { BlockElementCache } from './useBlockElementCache' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockEditorState.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockEditorState.ts index 5e41786d18..3c5e9b55b2 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockEditorState.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockEditorState.ts @@ -1,12 +1,25 @@ import { useBlockElementCache } from './useBlockElementCache' -import { Editor } from 'slate' -import { SugaredFieldProps, SugaredRelativeEntityList, useEntityList, useSortedEntities } from '@contember/binding' +import { Descendant, Editor } from 'slate' +import { + EntityAccessor, + SugaredFieldProps, + SugaredRelativeEntityList, + useEntityList, + useSortedEntities, +} from '@contember/react-binding' import { useBlockElementPathRefs } from './useBlockElementPathRefs' import { useBlockEditorOnChange } from './useBlockEditorOnChange' -import { useRef } from 'react' +import { MutableRefObject, useRef } from 'react' import { useBlockEditorSlateNodes } from '../useBlockEditorSlateNodes' import { useRefreshBlocks } from './useRefreshBlocks' +export interface useBlockEditorStateResult { + onChange: () => void + nodes: Descendant[] + sortedBlocksRef: MutableRefObject + refreshBlocks: () => void +} + export const useBlockEditorState = ({ editor, blockList, sortableBy, contentField, monolithicReferencesMode, referencesField }: { editor: Editor, blockList: SugaredRelativeEntityList, @@ -14,7 +27,7 @@ export const useBlockEditorState = ({ editor, blockList, sortableBy, contentFiel contentField: SugaredFieldProps['field'] referencesField?: SugaredRelativeEntityList | string monolithicReferencesMode?: boolean -}) => { +}): useBlockEditorStateResult => { const { entities: sortedBlocks } = useSortedEntities(useEntityList(blockList), sortableBy) const sortedBlocksRef = useRef(sortedBlocks) sortedBlocksRef.current = sortedBlocks diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockElementCache.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockElementCache.ts index 03f7fa2ba9..a180255085 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockElementCache.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockElementCache.ts @@ -4,7 +4,7 @@ import { SugaredRelativeEntityList, useDesugaredRelativeSingleField, useEntityBeforeUpdate, -} from '@contember/binding' +} from '@contember/react-binding' import { useCallback, useState } from 'react' import { Editor, Element as SlateElement } from 'slate' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockElementPathRefs.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockElementPathRefs.ts index 62e049bbdc..0ad599d0a3 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockElementPathRefs.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useBlockElementPathRefs.ts @@ -5,7 +5,7 @@ import { SugaredRelativeEntityList, useDesugaredRelativeEntityList, useEntityPersistSuccess, -} from '@contember/binding' +} from '@contember/react-binding' export type BlockElementPathRefs = Map export const useBlockElementPathRefs = ({ editor, blockList }: { diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useRefreshBlocks.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useRefreshBlocks.ts index d56e3af31f..e768da794d 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useRefreshBlocks.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/state/useRefreshBlocks.ts @@ -3,7 +3,7 @@ import { EntityAccessor, EntityId, EntityListAccessor, SugaredFieldProps, SugaredRelativeEntityList, useDesugaredRelativeEntityList, useDesugaredRelativeSingleField, useEntityBeforePersist, -} from '@contember/binding' +} from '@contember/react-binding' import { Descendant, Editor, Element as SlateElement, Element } from 'slate' import { isElementWithReference } from '../elements' import { useGetParentEntityRef } from '../useGetParentEntityRef' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/ContentOutlet.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/ContentOutlet.ts index 3be6c85e3d..5af4652d0f 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/ContentOutlet.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/ContentOutlet.ts @@ -1,4 +1,4 @@ -import { BindingError } from '@contember/binding' +import { BindingError } from '@contember/react-binding' export interface ContentOutletProps { placeholder?: string diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/TextField.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/TextField.ts index 68a634c37a..d9afa21f12 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/TextField.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/TextField.ts @@ -1,4 +1,4 @@ -import { BindingError, Component, SugaredRelativeSingleField } from '@contember/binding' +import { BindingError, Component, SugaredRelativeSingleField } from '@contember/react-binding' import type { FunctionComponent } from 'react' import type { BaseTextField } from './BaseTextField' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/editorTemplateAnalyzer.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/editorTemplateAnalyzer.ts index 651a63bec7..76b3170da0 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/editorTemplateAnalyzer.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/editorTemplateAnalyzer.ts @@ -1,4 +1,4 @@ -import type { Environment } from '@contember/binding' +import type { Environment } from '@contember/react-binding' import { ChildrenAnalyzer, Leaf } from '@contember/react-multipass-rendering' import type { ReactNode } from 'react' import { ContentOutlet, ContentOutletProps } from './ContentOutlet' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/getEditorTemplate.tsx b/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/getEditorTemplate.tsx index 2623917112..8040ddd2e1 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/getEditorTemplate.tsx +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/getEditorTemplate.tsx @@ -1,4 +1,4 @@ -import { BindingError, Environment } from '@contember/binding' +import { BindingError, Environment } from '@contember/react-binding' import type { ReactNode } from 'react' import { assertNever } from '../../../../../utils' import type { ContentOutletProps } from './ContentOutlet' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/useEditorReferenceBlocks.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/useEditorReferenceBlocks.ts index 2a207e1613..219e1cd6b5 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/useEditorReferenceBlocks.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/templating/useEditorReferenceBlocks.ts @@ -1,4 +1,4 @@ -import { useEnvironment } from '@contember/binding' +import { useEnvironment } from '@contember/react-binding' import { useConstantValueInvariant } from '@contember/react-utils' import { ReactNode, useMemo } from 'react' import { BlockProps, useBlockProps } from '../../../blocks' diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/useBlockEditorSlateNodes.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/useBlockEditorSlateNodes.ts index bebd98cd3d..b539c8f967 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/useBlockEditorSlateNodes.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/useBlockEditorSlateNodes.ts @@ -4,7 +4,7 @@ import { EntityId, SugaredFieldProps, useDesugaredRelativeSingleField, -} from '@contember/binding' +} from '@contember/react-binding' import { Descendant, Editor, Element as SlateElement, PathRef } from 'slate' export interface UseBlockEditorSlateNodesOptions { diff --git a/packages/admin/src/components/bindingFacade/richText/blockEditor/useGetParentEntityRef.ts b/packages/admin/src/components/bindingFacade/richText/blockEditor/useGetParentEntityRef.ts index 4e09aeff61..8bf550ebde 100644 --- a/packages/admin/src/components/bindingFacade/richText/blockEditor/useGetParentEntityRef.ts +++ b/packages/admin/src/components/bindingFacade/richText/blockEditor/useGetParentEntityRef.ts @@ -1,11 +1,11 @@ -import { useEntityKey, useGetEntityByKey } from '@contember/binding' +import { EntityAccessor, useEntityKey, useGetEntityByKey } from '@contember/react-binding' import { useEffect, useRef, useState } from 'react' export const useGetParentEntityRef = () => { const key = useEntityKey() const getEntity = useGetEntityByKey() const [initialGetter] = useState(() => () => getEntity(key)) - const ref = useRef(initialGetter) + const ref = useRef<() => EntityAccessor>(initialGetter) useEffect(() => { ref.current = () => getEntity(key) }, [getEntity, key]) diff --git a/packages/admin/src/components/bindingFacade/richText/legacyDeprecatedEditorFormerlyKnownAsRichTextField/LegacyDeprecatedEditorFormerlyKnownAsRichTextField.tsx b/packages/admin/src/components/bindingFacade/richText/legacyDeprecatedEditorFormerlyKnownAsRichTextField/LegacyDeprecatedEditorFormerlyKnownAsRichTextField.tsx index 82daecb0a6..55e31ed76b 100644 --- a/packages/admin/src/components/bindingFacade/richText/legacyDeprecatedEditorFormerlyKnownAsRichTextField/LegacyDeprecatedEditorFormerlyKnownAsRichTextField.tsx +++ b/packages/admin/src/components/bindingFacade/richText/legacyDeprecatedEditorFormerlyKnownAsRichTextField/LegacyDeprecatedEditorFormerlyKnownAsRichTextField.tsx @@ -6,7 +6,7 @@ import { QueryLanguage, useEntity, useMutationState, -} from '@contember/binding' +} from '@contember/react-binding' import { EditorCanvas, FieldContainer, FieldContainerProps } from '@contember/ui' import { FunctionComponent, useCallback, useMemo, useState } from 'react' import { Descendant, Node as SlateNode } from 'slate' diff --git a/packages/admin/src/components/bindingFacade/richText/legacyDeprecatedEditorFormerlyKnownAsRichTextField/useRichTextFieldNodes.ts b/packages/admin/src/components/bindingFacade/richText/legacyDeprecatedEditorFormerlyKnownAsRichTextField/useRichTextFieldNodes.ts index a1394264e0..bca7c270e7 100644 --- a/packages/admin/src/components/bindingFacade/richText/legacyDeprecatedEditorFormerlyKnownAsRichTextField/useRichTextFieldNodes.ts +++ b/packages/admin/src/components/bindingFacade/richText/legacyDeprecatedEditorFormerlyKnownAsRichTextField/useRichTextFieldNodes.ts @@ -1,4 +1,4 @@ -import { BindingError, FieldAccessor } from '@contember/binding' +import { BindingError, FieldAccessor } from '@contember/react-binding' import { Descendant, Editor } from 'slate' export interface UseRichTextFieldEditorNodeOptions { diff --git a/packages/admin/src/components/bindingFacade/richText/toolbars/HoveringToolbarContents.tsx b/packages/admin/src/components/bindingFacade/richText/toolbars/HoveringToolbarContents.tsx index dd175fd447..a915572583 100644 --- a/packages/admin/src/components/bindingFacade/richText/toolbars/HoveringToolbarContents.tsx +++ b/packages/admin/src/components/bindingFacade/richText/toolbars/HoveringToolbarContents.tsx @@ -1,4 +1,4 @@ -import { Entity, useEnvironment, VariableInputTransformer } from '@contember/binding' +import { Entity, useEnvironment, VariableInputTransformer } from '@contember/react-binding' import { EditorToolbar, ToolbarGroup, useDialog } from '@contember/ui' import { memo, MouseEvent as ReactMouseEvent } from 'react' import { Transforms } from 'slate' diff --git a/packages/admin/src/components/bindingFacade/richText/toolbars/ToolbarButtonSpec.ts b/packages/admin/src/components/bindingFacade/richText/toolbars/ToolbarButtonSpec.ts index 4a99db165b..20333bc712 100644 --- a/packages/admin/src/components/bindingFacade/richText/toolbars/ToolbarButtonSpec.ts +++ b/packages/admin/src/components/bindingFacade/richText/toolbars/ToolbarButtonSpec.ts @@ -1,4 +1,4 @@ -import type { EntityAccessor, EntityId } from '@contember/binding' +import type { EntityAccessor, EntityId } from '@contember/react-binding' import type { IconSourceSpecification } from '@contember/ui' import type { FunctionComponent, ReactNode } from 'react' import type { Range as SlateRange } from 'slate' diff --git a/packages/admin/src/components/bindingFacade/ui/DerivedFieldLink.tsx b/packages/admin/src/components/bindingFacade/ui/DerivedFieldLink.tsx index 64c2fe2d64..69a505c7c9 100644 --- a/packages/admin/src/components/bindingFacade/ui/DerivedFieldLink.tsx +++ b/packages/admin/src/components/bindingFacade/ui/DerivedFieldLink.tsx @@ -1,4 +1,4 @@ -import { Component, FieldValue, SugaredField, SugaredRelativeSingleField, useDerivedField } from '@contember/binding' +import { Component, FieldValue, SugaredField, SugaredRelativeSingleField, useDerivedField } from '@contember/react-binding' import type { FunctionComponent } from 'react' export interface DerivedFieldLinkProps { diff --git a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/FileDataExtractor.ts b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/FileDataExtractor.ts index ff4e695b79..474cc31a54 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/FileDataExtractor.ts +++ b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/FileDataExtractor.ts @@ -1,4 +1,4 @@ -import type { EntityAccessor, Environment } from '@contember/binding' +import type { EntityAccessor, Environment } from '@contember/react-binding' import type { ReactNode } from 'react' import { AccessorErrorsHolder } from '../../errors' diff --git a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getAudioFileDataExtractor.tsx b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getAudioFileDataExtractor.tsx index d2c0d80d3b..dd6bc94365 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getAudioFileDataExtractor.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getAudioFileDataExtractor.tsx @@ -1,5 +1,5 @@ -import type { SugaredFieldProps } from '@contember/binding' -import { SugaredField } from '@contember/binding' +import type { SugaredFieldProps } from '@contember/react-binding' +import { SugaredField } from '@contember/react-binding' import { FileDataExtractor } from './FileDataExtractor' export interface AudioFileDataExtractorProps { diff --git a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getFileUrlDataExtractor.tsx b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getFileUrlDataExtractor.tsx index daaf020939..17ac473023 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getFileUrlDataExtractor.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getFileUrlDataExtractor.tsx @@ -1,5 +1,5 @@ -import type { SugaredFieldProps } from '@contember/binding' -import { QueryLanguage, SugaredField } from '@contember/binding' +import type { SugaredFieldProps } from '@contember/react-binding' +import { QueryLanguage, SugaredField } from '@contember/react-binding' import type { S3FileUploader } from '@contember/client' import { FileDataExtractor } from './FileDataExtractor' diff --git a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getGenericFileMetadataExtractor.tsx b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getGenericFileMetadataExtractor.tsx index 85d3c4daec..8b2cdb574f 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getGenericFileMetadataExtractor.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getGenericFileMetadataExtractor.tsx @@ -1,5 +1,5 @@ -import type { SugaredFieldProps } from '@contember/binding' -import { SugaredField } from '@contember/binding' +import type { SugaredFieldProps } from '@contember/react-binding' +import { SugaredField } from '@contember/react-binding' import { FileDataExtractor } from './FileDataExtractor' export interface GenericFileMetadataExtractorProps { diff --git a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getImageFileDataExtractor.tsx b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getImageFileDataExtractor.tsx index c6433849c7..a547746b94 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getImageFileDataExtractor.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getImageFileDataExtractor.tsx @@ -1,5 +1,5 @@ -import type { SugaredFieldProps } from '@contember/binding' -import { SugaredField } from '@contember/binding' +import type { SugaredFieldProps } from '@contember/react-binding' +import { SugaredField } from '@contember/react-binding' import { FileDataExtractor } from './FileDataExtractor' export interface ImageFileDataExtractorProps { diff --git a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getVideoFileDataExtractor.tsx b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getVideoFileDataExtractor.tsx index f5dfb3c820..103bf4197f 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getVideoFileDataExtractor.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getVideoFileDataExtractor.tsx @@ -1,5 +1,5 @@ -import type { SugaredFieldProps } from '@contember/binding' -import { SugaredField } from '@contember/binding' +import type { SugaredFieldProps } from '@contember/react-binding' +import { SugaredField } from '@contember/react-binding' import { FileDataExtractor } from './FileDataExtractor' export interface VideoFileDataExtractorProps { diff --git a/packages/admin/src/components/bindingFacade/upload/fileHandler/DiscriminatedFileHandler.tsx b/packages/admin/src/components/bindingFacade/upload/fileHandler/DiscriminatedFileHandler.tsx index 202190263e..ad7dc7f47a 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileHandler/DiscriminatedFileHandler.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileHandler/DiscriminatedFileHandler.tsx @@ -9,7 +9,7 @@ import { SugaredField, SugaredFieldProps, VariableInputTransformer, -} from '@contember/binding' +} from '@contember/react-binding' import { resolveAcceptingSingleKind } from './utils/resolveAccept' import { resolveAllAcceptedMimes } from './utils/resolveAllAcceptedMimes' import { Fragment, ReactElement } from 'react' diff --git a/packages/admin/src/components/bindingFacade/upload/fileHandler/FileHandler.ts b/packages/admin/src/components/bindingFacade/upload/fileHandler/FileHandler.ts index 1be77f523b..7d54804742 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileHandler/FileHandler.ts +++ b/packages/admin/src/components/bindingFacade/upload/fileHandler/FileHandler.ts @@ -1,4 +1,4 @@ -import { EntityAccessor, Environment } from '@contember/binding' +import { EntityAccessor, Environment } from '@contember/react-binding' import { ReactElement } from 'react' import { AccessorErrorsHolder } from '../../errors' import { AcceptFileOptions, FullFileKind } from '../fileKinds' diff --git a/packages/admin/src/components/bindingFacade/upload/fileHandler/SingleKindFileHandler.tsx b/packages/admin/src/components/bindingFacade/upload/fileHandler/SingleKindFileHandler.tsx index 4d4ff83b77..da907b6759 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileHandler/SingleKindFileHandler.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileHandler/SingleKindFileHandler.tsx @@ -1,6 +1,6 @@ import { AcceptedFile, FileHandler, ResolvedFileEntity } from './FileHandler' import { resolveAcceptingSingleKind } from './utils/resolveAccept' -import { EntityAccessor, Environment, SugaredFieldProps } from '@contember/binding' +import { EntityAccessor, Environment, SugaredFieldProps } from '@contember/react-binding' import { ReactElement } from 'react' import { disconnectAtBase } from './utils/disconnectAtBase' import { staticRenderFileKind } from './utils/staticRenderFileKind' diff --git a/packages/admin/src/components/bindingFacade/upload/fileHandler/useFileHandler.ts b/packages/admin/src/components/bindingFacade/upload/fileHandler/useFileHandler.ts index e610b98093..0ac2a6eb9d 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileHandler/useFileHandler.ts +++ b/packages/admin/src/components/bindingFacade/upload/fileHandler/useFileHandler.ts @@ -1,5 +1,5 @@ -import type { Environment } from '@contember/binding' -import { BindingError, useEnvironment, VariableInputTransformer } from '@contember/binding' +import type { Environment } from '@contember/react-binding' +import { BindingError, useEnvironment, VariableInputTransformer } from '@contember/react-binding' import type { NormalizedDiscriminatedData } from '../../discrimination' import { DiscriminatedFileKindsProps, diff --git a/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/createEntityConnector.ts b/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/createEntityConnector.ts index 56121e53f1..5bf31c045d 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/createEntityConnector.ts +++ b/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/createEntityConnector.ts @@ -1,4 +1,4 @@ -import { BindingError, EntityAccessor, Environment, QueryLanguage } from '@contember/binding' +import { BindingError, EntityAccessor, Environment, QueryLanguage } from '@contember/react-binding' import { EntityConnectorFactory } from '../../internalComponents/hooks/useConnectSelectedEntities' export const createEntityConnectorFactory = (env: Environment, ...baseEntity: (string | undefined)[]): EntityConnectorFactory => { diff --git a/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/disconnectAtBase.ts b/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/disconnectAtBase.ts index 75235b4216..d1e88fc1f6 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/disconnectAtBase.ts +++ b/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/disconnectAtBase.ts @@ -1,4 +1,4 @@ -import { EntityAccessor, QueryLanguage } from '@contember/binding' +import { EntityAccessor, QueryLanguage } from '@contember/react-binding' export const disconnectAtBase = (baseEntity: string, parentEntity: EntityAccessor) => { const desugaredBase = QueryLanguage.desugarRelativeSingleEntity(baseEntity, parentEntity.environment) diff --git a/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/staticRenderFileKind.tsx b/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/staticRenderFileKind.tsx index 376cf775ed..ccf9b53154 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/staticRenderFileKind.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileHandler/utils/staticRenderFileKind.tsx @@ -1,5 +1,5 @@ -import type { Environment } from '@contember/binding' -import { HasOne } from '@contember/binding' +import type { Environment } from '@contember/react-binding' +import { HasOne } from '@contember/react-binding' import { Fragment, ReactElement, ReactNode } from 'react' import { FullFileKind } from '../../fileKinds' diff --git a/packages/admin/src/components/bindingFacade/upload/fileKinds/FileKind.tsx b/packages/admin/src/components/bindingFacade/upload/fileKinds/FileKind.tsx index 4e78fa174d..cff967ad9f 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileKinds/FileKind.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileKinds/FileKind.tsx @@ -1,4 +1,4 @@ -import { BindingError } from '@contember/binding' +import { BindingError } from '@contember/react-binding' import type { ReactElement } from 'react' import { SugaredDiscriminateBy } from '../../discrimination' import { SelectFileInputSelectionComponentProps } from '../internalComponents/selection/SelectFileInput' diff --git a/packages/admin/src/components/bindingFacade/upload/fileKinds/FullFileKind.ts b/packages/admin/src/components/bindingFacade/upload/fileKinds/FullFileKind.ts index a41a0578f9..286d85d6cf 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileKinds/FullFileKind.ts +++ b/packages/admin/src/components/bindingFacade/upload/fileKinds/FullFileKind.ts @@ -1,4 +1,4 @@ -import type { AsyncBatchUpdatesOptions } from '@contember/binding' +import type { AsyncBatchUpdatesOptions } from '@contember/react-binding' import type { FileUploader, FileUploadError } from '@contember/client' import type { ReactNode } from 'react' import type { FileDataExtractor } from '../fileDataExtractors' diff --git a/packages/admin/src/components/bindingFacade/upload/fileKinds/HybridFileKind.ts b/packages/admin/src/components/bindingFacade/upload/fileKinds/HybridFileKind.ts index e3d8aee321..83eaffc70e 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileKinds/HybridFileKind.ts +++ b/packages/admin/src/components/bindingFacade/upload/fileKinds/HybridFileKind.ts @@ -1,6 +1,6 @@ import { ReactNode } from 'react' import { FullFileKind } from './FullFileKind' -import { EntityAccessor, SugaredFieldProps } from '@contember/binding' +import { EntityAccessor, SugaredFieldProps } from '@contember/react-binding' import { SelectFileInputSelectionComponentProps } from '../internalComponents/selection/SelectFileInput' export type DiscriminatedFileKindsProps = diff --git a/packages/admin/src/components/bindingFacade/upload/fileKinds/components/AnyFiles.tsx b/packages/admin/src/components/bindingFacade/upload/fileKinds/components/AnyFiles.tsx index 94742ea474..890e45c18d 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileKinds/components/AnyFiles.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileKinds/components/AnyFiles.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import { FileKind } from '../FileKind' import { getStockAnyFileKind, StockAnyFileKindProps } from '../factories/getStockAnyFileKind' diff --git a/packages/admin/src/components/bindingFacade/upload/fileKinds/components/AudioFiles.tsx b/packages/admin/src/components/bindingFacade/upload/fileKinds/components/AudioFiles.tsx index 2a4ec19ca7..2c51fc70cb 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileKinds/components/AudioFiles.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileKinds/components/AudioFiles.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import { FileKind } from '../FileKind' import type { StockAudioFileKindProps } from '../factories/getStockAudioFileKind' diff --git a/packages/admin/src/components/bindingFacade/upload/fileKinds/components/ImageFiles.tsx b/packages/admin/src/components/bindingFacade/upload/fileKinds/components/ImageFiles.tsx index 7489d6e52d..f26e57f477 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileKinds/components/ImageFiles.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileKinds/components/ImageFiles.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import { FileKind } from '../FileKind' import type { StockImageFileKindProps } from '../factories/getStockImageFileKind' diff --git a/packages/admin/src/components/bindingFacade/upload/fileKinds/components/VideoFiles.tsx b/packages/admin/src/components/bindingFacade/upload/fileKinds/components/VideoFiles.tsx index d5cc626d9f..5791ddc2a1 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileKinds/components/VideoFiles.tsx +++ b/packages/admin/src/components/bindingFacade/upload/fileKinds/components/VideoFiles.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import { FileKind } from '../FileKind' import { getStockVideoFileKind, StockVideoFileKindProps } from '../factories/getStockVideoFileKind' diff --git a/packages/admin/src/components/bindingFacade/upload/fileKinds/fileKindTemplateAnalyzer.ts b/packages/admin/src/components/bindingFacade/upload/fileKinds/fileKindTemplateAnalyzer.ts index 2644c57d41..8935200a1c 100644 --- a/packages/admin/src/components/bindingFacade/upload/fileKinds/fileKindTemplateAnalyzer.ts +++ b/packages/admin/src/components/bindingFacade/upload/fileKinds/fileKindTemplateAnalyzer.ts @@ -1,4 +1,4 @@ -import type { Environment } from '@contember/binding' +import type { Environment } from '@contember/react-binding' import { ChildrenAnalyzer, Leaf } from '@contember/react-multipass-rendering' import type { FileKindProps } from './FileKind' import { FileKind } from './FileKind' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/BareFileRepeater.tsx b/packages/admin/src/components/bindingFacade/upload/internalComponents/BareFileRepeater.tsx index 90ff03a3ac..e9e6ca8c5b 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/BareFileRepeater.tsx +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/BareFileRepeater.tsx @@ -1,4 +1,4 @@ -import { Component, SugaredFieldProps, SugaredRelativeEntityList } from '@contember/binding' +import { Component, SugaredFieldProps, SugaredRelativeEntityList } from '@contember/react-binding' import type { ComponentType } from 'react' import { Repeater } from '../../collections' import { diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/BareFileRepeaterContainer.tsx b/packages/admin/src/components/bindingFacade/upload/internalComponents/BareFileRepeaterContainer.tsx index 9d17cc5d8c..7b3cf99b82 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/BareFileRepeaterContainer.tsx +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/BareFileRepeaterContainer.tsx @@ -1,4 +1,4 @@ -import { SugaredFieldProps, useGetEntityByKey, useMutationState } from '@contember/binding' +import { SugaredFieldProps, useGetEntityByKey, useMutationState } from '@contember/react-binding' import type { FileId } from '@contember/react-client' import { useFileUpload } from '@contember/react-client' import { FunctionComponent, ReactNode, useCallback, useMemo, useState } from 'react' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/BareUploadField.tsx b/packages/admin/src/components/bindingFacade/upload/internalComponents/BareUploadField.tsx index bd2e909f3c..0727bcec00 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/BareUploadField.tsx +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/BareUploadField.tsx @@ -1,4 +1,4 @@ -import { Component, EntityAccessor, useEntity } from '@contember/binding' +import { Component, EntityAccessor, useEntity } from '@contember/react-binding' import { useCallback, useEffect, useMemo, useState } from 'react' import { useMessageFormatter } from '../../../../i18n' import { uploadDictionary } from '../uploadDictionary' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/InitializedFilePreview.tsx b/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/InitializedFilePreview.tsx index 232fd52f87..d838db3a1a 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/InitializedFilePreview.tsx +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/InitializedFilePreview.tsx @@ -1,4 +1,4 @@ -import { BindingError } from '@contember/binding' +import { BindingError } from '@contember/react-binding' import type { SingleFileUploadState } from '@contember/react-client' import { ErrorList, FilePreview, Message, UploadProgress } from '@contember/ui' import { ReactNode, useEffect, useRef, useState } from 'react' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/SingleFilePreview.tsx b/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/SingleFilePreview.tsx index c4035ee21c..7159254300 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/SingleFilePreview.tsx +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/SingleFilePreview.tsx @@ -1,4 +1,4 @@ -import { BindingError, Entity } from '@contember/binding' +import { BindingError, Entity } from '@contember/react-binding' import type { FileId, SingleFileUploadState } from '@contember/react-client' import { ActionableBox, Box, toEnumViewClass } from '@contember/ui' import { memo, ReactElement, useMemo } from 'react' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleKindFileRepeater.tsx b/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleKindFileRepeater.tsx index b57698d6c4..f687a36155 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleKindFileRepeater.tsx +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleKindFileRepeater.tsx @@ -1,4 +1,4 @@ -import { Component, SugaredFieldProps, SugaredRelativeEntityList, useEnvironment } from '@contember/binding' +import { Component, SugaredFieldProps, SugaredRelativeEntityList, useEnvironment } from '@contember/react-binding' import { useResolvedSingleKindFileSelection } from './selection/useResolvedSingleKindFileSelection' import { createEntityConnectorFactory } from '../fileHandler/utils/createEntityConnector' import { isEmptyByUrlField, SingleKindFileHandler, useSingleKindFileHandler } from '../fileHandler' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleKindUploadField.tsx b/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleKindUploadField.tsx index 9dd7b4d2c7..cb62d74424 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleKindUploadField.tsx +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleKindUploadField.tsx @@ -1,4 +1,4 @@ -import { Component, useEnvironment } from '@contember/binding' +import { Component, useEnvironment } from '@contember/react-binding' import { BareUploadField } from './BareUploadField' import { useResolvedSingleKindFileSelection } from './selection/useResolvedSingleKindFileSelection' import { createEntityConnectorFactory } from '../fileHandler/utils/createEntityConnector' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/hooks/useConnectSelectedEntities.ts b/packages/admin/src/components/bindingFacade/upload/internalComponents/hooks/useConnectSelectedEntities.ts index 0e6678b7e1..66904e568e 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/hooks/useConnectSelectedEntities.ts +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/hooks/useConnectSelectedEntities.ts @@ -1,4 +1,4 @@ -import { EntityAccessor } from '@contember/binding' +import { EntityAccessor } from '@contember/react-binding' import { useCallback } from 'react' import { unstable_batchedUpdates } from 'react-dom' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/hooks/useNormalizedUploadState.ts b/packages/admin/src/components/bindingFacade/upload/internalComponents/hooks/useNormalizedUploadState.ts index a227495eb1..fc22079062 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/hooks/useNormalizedUploadState.ts +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/hooks/useNormalizedUploadState.ts @@ -1,6 +1,6 @@ import { AcceptFileKindError, AcceptedFile, FileHandler } from '../../fileHandler' import { DropzoneState, useDropzone } from 'react-dropzone' -import { EntityAccessor, useBindingOperations, useMutationState } from '@contember/binding' +import { EntityAccessor, useBindingOperations, useMutationState } from '@contember/react-binding' import type { FileId, FileUpload, diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SelectFileDialog.tsx b/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SelectFileDialog.tsx index 12854a0436..6819de6c5e 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SelectFileDialog.tsx +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SelectFileDialog.tsx @@ -1,7 +1,7 @@ import { MessageFormatter } from '../../../../../i18n' import { UploadDictionary } from '../../uploadDictionary' import { ComponentType, ReactNode, useCallback, useMemo, useState } from 'react' -import { EntityId } from '@contember/binding' +import { EntityId } from '@contember/react-binding' import { Button, DialogModal, Heading, useChildrenAsLabel } from '@contember/ui' import { EntityConnector } from '../hooks/useConnectSelectedEntities' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SelectFileInput.tsx b/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SelectFileInput.tsx index 9c61a3695c..cfffd1c067 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SelectFileInput.tsx +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SelectFileInput.tsx @@ -1,4 +1,4 @@ -import { AccessorTree, Component, EntityAccessor, EntityId, useAccessorTreeState } from '@contember/binding' +import { AccessorTree, Component, EntityAccessor, EntityId, useAccessorTreeState } from '@contember/react-binding' import { Button, DropdownContentContainerProvider, useDialog } from '@contember/ui' import { ComponentType, MouseEventHandler, ReactNode, useCallback } from 'react' import { MessageFormatter } from '../../../../../i18n' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SingleKindSelectFileDialog.tsx b/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SingleKindSelectFileDialog.tsx index d4405598b5..b532176d5d 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SingleKindSelectFileDialog.tsx +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/SingleKindSelectFileDialog.tsx @@ -1,4 +1,4 @@ -import { DeferredSubTrees, EntityAccessor } from '@contember/binding' +import { DeferredSubTrees, EntityAccessor } from '@contember/react-binding' import { ComponentType, useCallback } from 'react' import { EntityConnectorFactory } from '../hooks/useConnectSelectedEntities' import { FileSelectionProps } from './SelectFileInput' diff --git a/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/useResolvedFileSelection.ts b/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/useResolvedFileSelection.ts index 01c71cf852..a7562a1bef 100644 --- a/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/useResolvedFileSelection.ts +++ b/packages/admin/src/components/bindingFacade/upload/internalComponents/selection/useResolvedFileSelection.ts @@ -2,7 +2,7 @@ import { DiscriminatedFileKindsProps, HybridFileKindProps, SingleKindFileProps } import { useMemo } from 'react' import { fileKindTemplateAnalyzer } from '../../fileKinds/fileKindTemplateAnalyzer' import { FileKindProps } from '../../fileKinds' -import { EntityAccessor, Environment, useEnvironment, VariableInputTransformer } from '@contember/binding' +import { EntityAccessor, Environment, useEnvironment, VariableInputTransformer } from '@contember/react-binding' import { ResolvedFileSelectionComponent } from './SelectFileDialog' import { useObjectMemo } from '@contember/react-utils' import { getResolvedSingleKindFileSelection } from './useResolvedSingleKindFileSelection' diff --git a/packages/admin/src/components/bindingFacade/upload/wrappers/generic/FileRepeater.tsx b/packages/admin/src/components/bindingFacade/upload/wrappers/generic/FileRepeater.tsx index f574514df6..35ef1a06d3 100644 --- a/packages/admin/src/components/bindingFacade/upload/wrappers/generic/FileRepeater.tsx +++ b/packages/admin/src/components/bindingFacade/upload/wrappers/generic/FileRepeater.tsx @@ -1,5 +1,5 @@ -import type { SugaredFieldProps, SugaredRelativeEntityList } from '@contember/binding' -import { Component } from '@contember/binding' +import type { SugaredFieldProps, SugaredRelativeEntityList } from '@contember/react-binding' +import { Component } from '@contember/react-binding' import type { ReactNode } from 'react' import { ReactElement } from 'react' import { BareFileRepeater, FileInputPublicProps, useFileSelection } from '../../internalComponents' diff --git a/packages/admin/src/components/bindingFacade/upload/wrappers/generic/UploadField.tsx b/packages/admin/src/components/bindingFacade/upload/wrappers/generic/UploadField.tsx index a3d295bb41..0c9139cbe3 100644 --- a/packages/admin/src/components/bindingFacade/upload/wrappers/generic/UploadField.tsx +++ b/packages/admin/src/components/bindingFacade/upload/wrappers/generic/UploadField.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactNode } from 'react' import { ReactElement } from 'react' import type { FileInputPublicProps } from '../../internalComponents' diff --git a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AnyFileRepeater.tsx b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AnyFileRepeater.tsx index aedf3aaa90..2fd05df645 100644 --- a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AnyFileRepeater.tsx +++ b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AnyFileRepeater.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import type { StockAnyFileKindProps } from '../../fileKinds' import { getStockAnyFileKind } from '../../fileKinds' diff --git a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AnyUploadField.tsx b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AnyUploadField.tsx index f6b5fe3f14..f423269c31 100644 --- a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AnyUploadField.tsx +++ b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AnyUploadField.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import type { StockAnyFileKindProps } from '../../fileKinds' import { getStockAnyFileKind } from '../../fileKinds' diff --git a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AudioFileRepeater.tsx b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AudioFileRepeater.tsx index e6efecd0b8..0e23b2a4bd 100644 --- a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AudioFileRepeater.tsx +++ b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AudioFileRepeater.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import type { StockAudioFileKindProps } from '../../fileKinds' import { getStockAudioFileKind } from '../../fileKinds' diff --git a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AudioUploadField.tsx b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AudioUploadField.tsx index caa75846e5..05783760ec 100644 --- a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AudioUploadField.tsx +++ b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/AudioUploadField.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import type { StockAudioFileKindProps } from '../../fileKinds' import { getStockAudioFileKind } from '../../fileKinds' diff --git a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/ImageFileRepeater.tsx b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/ImageFileRepeater.tsx index 1605b73b09..881cd0037b 100644 --- a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/ImageFileRepeater.tsx +++ b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/ImageFileRepeater.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import type { StockImageFileKindProps } from '../../fileKinds' import { getStockImageFileKind } from '../../fileKinds' diff --git a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/ImageUploadField.tsx b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/ImageUploadField.tsx index b091187022..f14b9aa0a9 100644 --- a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/ImageUploadField.tsx +++ b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/ImageUploadField.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import type { StockImageFileKindProps } from '../../fileKinds' import { getStockImageFileKind } from '../../fileKinds' diff --git a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/VideoFileRepeater.tsx b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/VideoFileRepeater.tsx index ad40d45559..24be7b0800 100644 --- a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/VideoFileRepeater.tsx +++ b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/VideoFileRepeater.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import type { StockVideoFileKindProps } from '../../fileKinds' import { getStockVideoFileKind } from '../../fileKinds' diff --git a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/VideoUploadField.tsx b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/VideoUploadField.tsx index a93c156e58..4d9bf972e0 100644 --- a/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/VideoUploadField.tsx +++ b/packages/admin/src/components/bindingFacade/upload/wrappers/withKind/VideoUploadField.tsx @@ -1,4 +1,4 @@ -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' import type { ReactElement } from 'react' import type { StockVideoFileKindProps } from '../../fileKinds' import { getStockVideoFileKind } from '../../fileKinds' diff --git a/packages/admin/src/components/pageRouting/Pages.tsx b/packages/admin/src/components/pageRouting/Pages.tsx index 91aa2723f7..9f643953c5 100644 --- a/packages/admin/src/components/pageRouting/Pages.tsx +++ b/packages/admin/src/components/pageRouting/Pages.tsx @@ -1,4 +1,4 @@ -import { EnvironmentContext, useEnvironment } from '@contember/binding' +import { EnvironmentContext, useEnvironment } from '@contember/react-binding' import { ContainerSpinner, Message } from '@contember/ui' import { ComponentType, diff --git a/packages/admin/src/components/pageRouting/pageComponents/CreatePage.tsx b/packages/admin/src/components/pageRouting/pageComponents/CreatePage.tsx index 14fe708dd5..8dc6651b55 100644 --- a/packages/admin/src/components/pageRouting/pageComponents/CreatePage.tsx +++ b/packages/admin/src/components/pageRouting/pageComponents/CreatePage.tsx @@ -4,7 +4,7 @@ import { EntitySubTreeAdditionalCreationProps, EntitySubTreeAdditionalProps, SugaredUnconstrainedQualifiedSingleEntity, -} from '@contember/binding' +} from '@contember/react-binding' import { ComponentType, memo, ReactNode } from 'react' import { FeedbackRenderer, LayoutRenderer, LayoutRendererProps, PersistButton } from '../../bindingFacade' import type { PageProvider } from '../Pages' diff --git a/packages/admin/src/components/pageRouting/pageComponents/DataGridPage.tsx b/packages/admin/src/components/pageRouting/pageComponents/DataGridPage.tsx index 20eb10a92e..cd11fdb70c 100644 --- a/packages/admin/src/components/pageRouting/pageComponents/DataGridPage.tsx +++ b/packages/admin/src/components/pageRouting/pageComponents/DataGridPage.tsx @@ -1,4 +1,4 @@ -import { DataBindingProvider } from '@contember/binding' +import { DataBindingProvider } from '@contember/react-binding' import { ComponentType, memo, ReactNode } from 'react' import { DataGrid, diff --git a/packages/admin/src/components/pageRouting/pageComponents/DetailPage.tsx b/packages/admin/src/components/pageRouting/pageComponents/DetailPage.tsx index 7c5eefe9f0..4c26a72a98 100644 --- a/packages/admin/src/components/pageRouting/pageComponents/DetailPage.tsx +++ b/packages/admin/src/components/pageRouting/pageComponents/DetailPage.tsx @@ -3,7 +3,7 @@ import { EntitySubTree, EntitySubTreeAdditionalProps, SugaredQualifiedSingleEntity, -} from '@contember/binding' +} from '@contember/react-binding' import { ComponentType, memo, ReactNode } from 'react' import { FeedbackRenderer, LayoutRenderer, LayoutRendererProps } from '../../bindingFacade' import type { PageProvider } from '../Pages' diff --git a/packages/admin/src/components/pageRouting/pageComponents/EditPage.tsx b/packages/admin/src/components/pageRouting/pageComponents/EditPage.tsx index d5d8f6c9db..8f1de6fa2d 100644 --- a/packages/admin/src/components/pageRouting/pageComponents/EditPage.tsx +++ b/packages/admin/src/components/pageRouting/pageComponents/EditPage.tsx @@ -3,7 +3,7 @@ import { EntitySubTree, EntitySubTreeAdditionalProps, SugaredQualifiedSingleEntity, -} from '@contember/binding' +} from '@contember/react-binding' import { ComponentType, memo, ReactNode } from 'react' import { FeedbackRenderer, LayoutRenderer, LayoutRendererProps, PersistButton } from '../../bindingFacade' import type { PageProvider } from '../Pages' diff --git a/packages/admin/src/components/pageRouting/pageComponents/ListPage.tsx b/packages/admin/src/components/pageRouting/pageComponents/ListPage.tsx index f69f89b60c..f58fdee68b 100644 --- a/packages/admin/src/components/pageRouting/pageComponents/ListPage.tsx +++ b/packages/admin/src/components/pageRouting/pageComponents/ListPage.tsx @@ -3,7 +3,7 @@ import { EntityListSubTree, EntityListSubTreeAdditionalProps, SugaredQualifiedEntityList, -} from '@contember/binding' +} from '@contember/react-binding' import { memo, ReactElement, ReactNode } from 'react' import { FeedbackRenderer, ImmutableEntityListPageRenderer, ImmutableEntityListPageRendererProps } from '../../bindingFacade' import type { PageProvider } from '../Pages' diff --git a/packages/admin/src/components/pageRouting/pageComponents/MultiEditPage.tsx b/packages/admin/src/components/pageRouting/pageComponents/MultiEditPage.tsx index 89d52a3151..13a4647e86 100644 --- a/packages/admin/src/components/pageRouting/pageComponents/MultiEditPage.tsx +++ b/packages/admin/src/components/pageRouting/pageComponents/MultiEditPage.tsx @@ -3,7 +3,7 @@ import { EntityListSubTree, EntityListSubTreeAdditionalProps, SugaredQualifiedEntityList, -} from '@contember/binding' +} from '@contember/react-binding' import { memo, ReactElement, ReactNode } from 'react' import { FeedbackRenderer, MutableEntityListPageRenderer, MutableEntityListPageRendererProps } from '../../bindingFacade' import type { PageProvider } from '../Pages' diff --git a/packages/admin/src/components/pageRouting/pageComponents/NotFoundWrapper.tsx b/packages/admin/src/components/pageRouting/pageComponents/NotFoundWrapper.tsx index 6deec1f8de..bbdbccba90 100644 --- a/packages/admin/src/components/pageRouting/pageComponents/NotFoundWrapper.tsx +++ b/packages/admin/src/components/pageRouting/pageComponents/NotFoundWrapper.tsx @@ -1,4 +1,4 @@ -import { Component, useEntity } from '@contember/binding' +import { Component, useEntity } from '@contember/react-binding' import { LayoutPage, Message } from '@contember/ui' import { ReactChild, ReactNode } from 'react' diff --git a/packages/admin/src/components/pageRouting/pageComponents/TablePage.tsx b/packages/admin/src/components/pageRouting/pageComponents/TablePage.tsx index fecf482fae..e5ea58520c 100644 --- a/packages/admin/src/components/pageRouting/pageComponents/TablePage.tsx +++ b/packages/admin/src/components/pageRouting/pageComponents/TablePage.tsx @@ -3,7 +3,7 @@ import { EntityListSubTree, EntityListSubTreeAdditionalProps, SugaredQualifiedEntityList, -} from '@contember/binding' +} from '@contember/react-binding' import { memo, ReactElement, ReactNode } from 'react' import { FeedbackRenderer, ImmutableEntityListTablePageRenderer, ImmutableEntityListTablePageRendererProps } from '../../bindingFacade' import type { PageProvider } from '../Pages' diff --git a/packages/admin/src/components/pageRouting/useEntityRedirectOnPersistSuccess.ts b/packages/admin/src/components/pageRouting/useEntityRedirectOnPersistSuccess.ts index bb67513a7d..078ebadfa8 100644 --- a/packages/admin/src/components/pageRouting/useEntityRedirectOnPersistSuccess.ts +++ b/packages/admin/src/components/pageRouting/useEntityRedirectOnPersistSuccess.ts @@ -1,5 +1,5 @@ -import type { EntityAccessor, EntityId, PersistSuccessOptions } from '@contember/binding' -import { useEnvironment } from '@contember/binding' +import type { EntityAccessor, EntityId, PersistSuccessOptions } from '@contember/react-binding' +import { useEnvironment } from '@contember/react-binding' import { useMemo } from 'react' import { createBindingLinkParametersResolver, diff --git a/packages/admin/src/components/pageRouting/useOnPersistSuccess.ts b/packages/admin/src/components/pageRouting/useOnPersistSuccess.ts index 17d0cbb2b2..51c078a5d5 100644 --- a/packages/admin/src/components/pageRouting/useOnPersistSuccess.ts +++ b/packages/admin/src/components/pageRouting/useOnPersistSuccess.ts @@ -1,4 +1,4 @@ -import { QueryLanguage, UnsugarableSingleEntityEventListeners } from '@contember/binding' +import { QueryLanguage, UnsugarableSingleEntityEventListeners } from '@contember/react-binding' import { RedirectOnSuccessTarget, useEntityRedirectOnPersistSuccess } from './useEntityRedirectOnPersistSuccess' import { useMemo } from 'react' diff --git a/packages/admin/src/components/ui/usePersistWithFeedback.tsx b/packages/admin/src/components/ui/usePersistWithFeedback.tsx index 3ae3273cdc..8052b0e266 100644 --- a/packages/admin/src/components/ui/usePersistWithFeedback.tsx +++ b/packages/admin/src/components/ui/usePersistWithFeedback.tsx @@ -1,4 +1,4 @@ -import { ErrorPersistResult, PersistOptions, SuccessfulPersistResult, usePersist } from '@contember/binding' +import { ErrorPersistResult, PersistOptions, SuccessfulPersistResult, usePersist } from '@contember/react-binding' import { useShowToast } from '@contember/ui' import { useCallback } from 'react' import { useMessageFormatter } from '../../i18n' diff --git a/packages/admin/src/index.ts b/packages/admin/src/index.ts index 26a6a68e46..7f0d202bf8 100644 --- a/packages/admin/src/index.ts +++ b/packages/admin/src/index.ts @@ -7,6 +7,6 @@ export * from './tenant' export type { AdminDictionary } from './adminDictionary' -export * from '@contember/binding' +export * from '@contember/react-binding' export * from '@contember/react-client' export * from '@contember/ui' diff --git a/packages/admin/src/routing/binding/Link.tsx b/packages/admin/src/routing/binding/Link.tsx index 8ebce5fb5d..daf21cbabf 100644 --- a/packages/admin/src/routing/binding/Link.tsx +++ b/packages/admin/src/routing/binding/Link.tsx @@ -1,4 +1,4 @@ -import { Component, Field, useEnvironment } from '@contember/binding' +import { Component, Field, useEnvironment } from '@contember/react-binding' import { AnchorHTMLAttributes, useMemo } from 'react' import { RoutingLink, RoutingLinkProps } from '../RoutingLink' import { RoutingParameter } from '../RoutingParameter' diff --git a/packages/admin/src/routing/binding/LinkButton.tsx b/packages/admin/src/routing/binding/LinkButton.tsx index 199609993a..fe274801a0 100644 --- a/packages/admin/src/routing/binding/LinkButton.tsx +++ b/packages/admin/src/routing/binding/LinkButton.tsx @@ -1,7 +1,7 @@ import { AnchorButton, AnchorButtonProps } from '@contember/ui' import type { LinkProps } from './Link' import { Link } from './Link' -import { Component } from '@contember/binding' +import { Component } from '@contember/react-binding' export type LinkButtonProps = LinkProps & AnchorButtonProps diff --git a/packages/admin/src/routing/binding/LinkLanguage.ts b/packages/admin/src/routing/binding/LinkLanguage.ts index f9c55fa922..49be6c4166 100644 --- a/packages/admin/src/routing/binding/LinkLanguage.ts +++ b/packages/admin/src/routing/binding/LinkLanguage.ts @@ -1,5 +1,5 @@ import { RoutingLinkTarget } from '../types' -import { Environment, QueryLanguage } from '@contember/binding' +import { Environment, QueryLanguage } from '@contember/react-binding' import { RoutingParameter } from '../RoutingParameter' export type LinkTarget = RoutingLinkTarget diff --git a/packages/admin/src/routing/binding/useBindingLinkParametersResolver.ts b/packages/admin/src/routing/binding/useBindingLinkParametersResolver.ts index ab4c4d273f..37a15b9ac8 100644 --- a/packages/admin/src/routing/binding/useBindingLinkParametersResolver.ts +++ b/packages/admin/src/routing/binding/useBindingLinkParametersResolver.ts @@ -1,4 +1,4 @@ -import { BindingError, EntityAccessor, useEntity, useHasEntity } from '@contember/binding' +import { BindingError, EntityAccessor, useEntity, useHasEntity } from '@contember/react-binding' import { useMemo } from 'react' import { RoutingParameterResolver } from '../types' import { PageNotFound } from '../urlMapper' diff --git a/packages/admin/src/routing/binding/useRedirect.tsx b/packages/admin/src/routing/binding/useRedirect.tsx index e5232dc451..20a3da7e01 100644 --- a/packages/admin/src/routing/binding/useRedirect.tsx +++ b/packages/admin/src/routing/binding/useRedirect.tsx @@ -3,7 +3,7 @@ import { useBindingLinkParametersResolver } from './useBindingLinkParametersReso import { useRoutingLinkFactory } from '../useRoutingLink' import { RequestParameters, RoutingLinkTarget } from '../types' import { parseLinkTarget } from './LinkLanguage' -import { useEnvironment } from '@contember/binding' +import { useEnvironment } from '@contember/react-binding' export const useRedirect = () => { const parametersResolver = useBindingLinkParametersResolver() diff --git a/packages/admin/src/routing/urlMapper.ts b/packages/admin/src/routing/urlMapper.ts index 1d56b2a4af..a34833c619 100644 --- a/packages/admin/src/routing/urlMapper.ts +++ b/packages/admin/src/routing/urlMapper.ts @@ -1,6 +1,6 @@ import * as pathToRegexp from 'path-to-regexp' import { MatchFunction, PathFunction } from 'path-to-regexp' -import { Environment } from '@contember/binding' +import { Environment } from '@contember/react-binding' import { RoutingContextValue } from './RoutingContext' import { RequestState } from './types' diff --git a/packages/admin/src/tenant/lib/useMutation.ts b/packages/admin/src/tenant/lib/useMutation.ts index 580fdfc8b0..02981b9e0f 100644 --- a/packages/admin/src/tenant/lib/useMutation.ts +++ b/packages/admin/src/tenant/lib/useMutation.ts @@ -1,7 +1,7 @@ import type { GraphQlClient } from '@contember/client' import { useCallback, useState } from 'react' import type { MutationRequestState } from './requestState' -import { JsonObject } from '@contember/binding' +import { JsonObject } from '@contember/react-binding' export type UseMutationReturn = [(variables: V) => Promise, MutationRequestState] diff --git a/packages/admin/src/tenant/lib/useQuery.ts b/packages/admin/src/tenant/lib/useQuery.ts index 3039e5f2ce..123272f287 100644 --- a/packages/admin/src/tenant/lib/useQuery.ts +++ b/packages/admin/src/tenant/lib/useQuery.ts @@ -2,7 +2,7 @@ import type { GraphQlClient } from '@contember/client' import { GraphQlClientVariables } from '@contember/client' import { useCallback, useEffect, useMemo, useState } from 'react' import type { QueryRequestObject, QueryRequestState } from './requestState' -import { JsonValue } from '@contember/binding' +import { JsonValue } from '@contember/react-binding' const useJsonMemo = (value: V): V => { const json = useMemo(() => JSON.stringify(value), [value]) diff --git a/packages/admin/src/tenant/lib/variables.ts b/packages/admin/src/tenant/lib/variables.ts index 64dd9934f7..8550b7b65c 100644 --- a/packages/admin/src/tenant/lib/variables.ts +++ b/packages/admin/src/tenant/lib/variables.ts @@ -1,4 +1,4 @@ -import { JsonValue } from '@contember/binding' +import { JsonValue } from '@contember/react-binding' export interface GQLVariableType { graphQlType: string diff --git a/packages/admin/src/tsconfig.json b/packages/admin/src/tsconfig.json index c45ceed861..d60aec005d 100644 --- a/packages/admin/src/tsconfig.json +++ b/packages/admin/src/tsconfig.json @@ -4,8 +4,8 @@ "outDir": "../dist/types", }, "references": [ - { "path": "../../binding/src" }, { "path": "../../client/src" }, + { "path": "../../react-binding/src"}, { "path": "../../react-client/src" }, { "path": "../../react-multipass-rendering/src" }, { "path": "../../react-utils/src" }, diff --git a/packages/admin/tests/playwright/cases/fileSelection.tsx b/packages/admin/tests/playwright/cases/fileSelection.tsx index 6399dc636f..28513de15b 100644 --- a/packages/admin/tests/playwright/cases/fileSelection.tsx +++ b/packages/admin/tests/playwright/cases/fileSelection.tsx @@ -1,4 +1,4 @@ -import { Component, EntityAccessor, EntityId, Field, StaticRender, useEntity } from '@contember/binding' +import { Component, EntityAccessor, EntityId, Field, StaticRender, useEntity } from '@contember/react-binding' import { Card, LinkCardProps } from '@contember/ui' import { useCallback, useMemo } from 'react' import { CreatePage, DataGrid, EditPage, FileSelectionProps, GenericCell, ImageUploadField, Layout, TextCell } from '../../../src' diff --git a/packages/binding/package.json b/packages/binding/package.json index 21fa16dd58..4ae748a604 100644 --- a/packages/binding/package.json +++ b/packages/binding/package.json @@ -28,22 +28,13 @@ }, "dependencies": { "@contember/client": "workspace:*", - "@contember/react-client": "workspace:*", - "@contember/react-multipass-rendering": "workspace:*", - "@contember/react-utils": "workspace:*", "chevrotain": "6.5.0", "fast-deep-equal": "^3.1.3", "js-levenshtein": "1.1.6", "uuid": "8.3.2" }, - "peerDependencies": { - "react": "^17 || ^18", - "react-dom": "^17 || ^18" - }, "devDependencies": { "@types/js-levenshtein": "1.1.0", - "@types/uuid": "8.3.1", - "react": "^18", - "react-dom": "^18" + "@types/uuid": "8.3.1" } } diff --git a/packages/binding/src/accessorPropagation/useBindingOperations.ts b/packages/binding/src/accessorPropagation/useBindingOperations.ts deleted file mode 100644 index 8818c5c382..0000000000 --- a/packages/binding/src/accessorPropagation/useBindingOperations.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { useContext } from 'react' -import type { BindingOperations } from '../accessors' -import { BindingOperationsContext } from './BindingOperationsContext' - -export const useBindingOperations = (): BindingOperations => useContext(BindingOperationsContext) diff --git a/packages/binding/src/accessorTree/AccessorTreeStateAction.ts b/packages/binding/src/accessorTree/AccessorTreeStateAction.ts deleted file mode 100644 index edbaca95ec..0000000000 --- a/packages/binding/src/accessorTree/AccessorTreeStateAction.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { TreeRootAccessor } from '../accessors' -import type { RequestError } from './RequestError' -import { DataBinding } from '../core' -import { Environment } from '../dao' - -export type AccessorTreeStateAction = - | { - type: 'setData' - data: TreeRootAccessor - binding: DataBinding - } - | { - type: 'failWithError' - error: RequestError - binding: DataBinding - } - | { - type: 'reset' - binding: DataBinding - environment: Environment - } diff --git a/packages/binding/src/accessorTree/index.ts b/packages/binding/src/accessorTree/index.ts index ac6cef8996..fd0758ef15 100644 --- a/packages/binding/src/accessorTree/index.ts +++ b/packages/binding/src/accessorTree/index.ts @@ -1,19 +1,7 @@ -export * from './AccessorTree' -export * from './AccessorTreeState' -export * from './AccessorTreeStateAction' -export * from './AccessorTreeStateMetadata' -export * from './AccessorTreeStateOptions' -export * from './accessorTreeStateReducer' -export * from './DirtinessContext' export * from './metadataToRequestError' export * from './MutationRequestResponse' -export * from './MutationStateContext' export * from './NormalizedPersistedData' export * from './PersistResult' export * from './QueryRequestResponse' export * from './RequestError' export * from './RuntimeId' -export * from './useAccessorTreeState' -export * from './useDataBinding' -export * from './useDirtinessState' -export * from './useMutationState' diff --git a/packages/binding/src/accessors/BindingOperations.ts b/packages/binding/src/accessors/BindingOperations.ts index 4644a454b7..bf797436aa 100644 --- a/packages/binding/src/accessors/BindingOperations.ts +++ b/packages/binding/src/accessors/BindingOperations.ts @@ -4,11 +4,11 @@ import type { BatchUpdatesOptions } from './BatchUpdatesOptions' import type { ExtendTree } from './ExtendTree' import type { Persist } from './Persist' -export interface BindingOperations extends AsyncBatchUpdatesOptions { +export interface BindingOperations extends AsyncBatchUpdatesOptions { // addEventListener: ... getTreeFilters: () => TreeFilter[] - extendTree: ExtendTree + extendTree: ExtendTree batchDeferredUpdates: (performUpdates: (bindingOperations: BatchUpdatesOptions) => void) => void // discardSubTree: ... persist: Persist diff --git a/packages/binding/src/accessors/ExtendTree.ts b/packages/binding/src/accessors/ExtendTree.ts index 532c5c8b6a..cd01a5eb50 100644 --- a/packages/binding/src/accessors/ExtendTree.ts +++ b/packages/binding/src/accessors/ExtendTree.ts @@ -1,4 +1,3 @@ -import type { ReactNode } from 'react' import type { Environment } from '../dao' import type { TreeRootId } from '../treeParameters' @@ -7,4 +6,4 @@ export interface ExtendTreeOptions { environment?: Environment } -export type ExtendTree = (newFragment: ReactNode, options?: ExtendTreeOptions) => Promise +export type ExtendTree = (newFragment: Node, options?: ExtendTreeOptions) => Promise diff --git a/packages/binding/src/accessors/TreeRootAccessor.ts b/packages/binding/src/accessors/TreeRootAccessor.ts index cc02d3cf86..8565c1d1d8 100644 --- a/packages/binding/src/accessors/TreeRootAccessor.ts +++ b/packages/binding/src/accessors/TreeRootAccessor.ts @@ -2,13 +2,13 @@ import type { BindingOperations } from './BindingOperations' // This allows us to have several parallel sub-trees without one having to be the main tree // and all the other ones subordinate. -export class TreeRootAccessor { +export class TreeRootAccessor { /** * Whenever an update occurs, a new instance of this class is created. */ public constructor( public readonly hasUnpersistedChanges: boolean, public readonly isMutating: boolean, - public readonly bindingOperations: BindingOperations, + public readonly bindingOperations: BindingOperations, ) {} } diff --git a/packages/binding/src/core/DataBinding.ts b/packages/binding/src/core/DataBinding.ts index 136a1c2b1b..173e146c7c 100644 --- a/packages/binding/src/core/DataBinding.ts +++ b/packages/binding/src/core/DataBinding.ts @@ -1,11 +1,10 @@ import type { GraphQlClient, GraphQlClientFailedRequestMetadata, TreeFilter } from '@contember/client' -import type { ReactNode } from 'react' import { AsyncBatchUpdatesOptions, BatchUpdatesOptions, BindingOperations, ExtendTreeOptions, - PersistErrorOptions, PersistOptions, + PersistOptions, PersistSuccessOptions, TreeRootAccessor, } from '../accessors' @@ -27,7 +26,6 @@ import { DirtinessTracker } from './DirtinessTracker' import { EventManager } from './EventManager' import { createBatchUpdatesOptions } from './factories' import { MarkerMerger } from './MarkerMerger' -import { MarkerTreeGenerator } from './MarkerTreeGenerator' import { MutationGenerator, SubMutationOperation } from './MutationGenerator' import { QueryGenerator } from './QueryGenerator' import { StateIterator } from './state' @@ -38,11 +36,11 @@ import { TreeStore } from './TreeStore' import type { UpdateMetadata } from './UpdateMetadata' import { getCombinedSignal } from './utils' -export class DataBinding { +export class DataBinding { private readonly accessorErrorManager: AccessorErrorManager private readonly batchUpdatesOptions: BatchUpdatesOptions private readonly asyncBatchUpdatesOptions: AsyncBatchUpdatesOptions - private readonly bindingOperations: BindingOperations + private readonly bindingOperations: BindingOperations private readonly config: Config private readonly dirtinessTracker: DirtinessTracker private readonly eventManager: EventManager @@ -61,9 +59,11 @@ export class DataBinding { private readonly tenantApiClient: GraphQlClient, private readonly treeStore: TreeStore, private readonly environment: Environment, - private readonly onUpdate: (newData: TreeRootAccessor, binding: DataBinding) => void, - private readonly onError: (error: RequestError, binding: DataBinding) => void, - private readonly onPersistSuccess: (result: SuccessfulPersistResult, binding: DataBinding) => void, + private readonly createMarkerTree: (node: Node, environment: Environment) => MarkerTreeRoot, + private readonly batchedUpdates: (callback: () => any) => void, + private readonly onUpdate: (newData: TreeRootAccessor, binding: DataBinding) => void, + private readonly onError: (error: RequestError, binding: DataBinding) => void, + private readonly onPersistSuccess: (result: SuccessfulPersistResult, binding: DataBinding) => void, private readonly options: { skipStateUpdateAfterPersist: boolean }, @@ -84,6 +84,7 @@ export class DataBinding { this.dirtinessTracker, this.resolvedOnUpdate, this.treeStore, + this.batchedUpdates, ) this.accessorErrorManager = new AccessorErrorManager(this.eventManager, this.treeStore) this.stateInitializer = new StateInitializer( @@ -95,7 +96,7 @@ export class DataBinding { this.treeAugmenter = new TreeAugmenter(this.eventManager, this.stateInitializer, this.treeStore, options.skipStateUpdateAfterPersist) // TODO move this elsewhere - this.bindingOperations = Object.freeze({ + this.bindingOperations = Object.freeze>({ ...this.asyncBatchUpdatesOptions, getTreeFilters: (): TreeFilter[] => { const generator = new TreeFilterGenerator(this.treeStore) @@ -240,7 +241,7 @@ export class DataBinding { } private resolvedOnUpdate = ({ isMutating }: UpdateMetadata) => { - this.onUpdate(new TreeRootAccessor(this.dirtinessTracker.hasChanges(), isMutating, this.bindingOperations), this) + this.onUpdate(new TreeRootAccessor(this.dirtinessTracker.hasChanges(), isMutating, this.bindingOperations), this) } // This is currently useless but potentially future-compatible @@ -250,18 +251,18 @@ export class DataBinding { private pendingExtensions: Set<{ markerTreeRoot: MarkerTreeRoot - newFragment: ReactNode + newFragment: Node newTreeRootId: TreeRootId | undefined options: ExtendTreeOptions reject: () => void resolve: (newRootId: TreeRootId | undefined) => void }> = new Set() - public async extendTree(newFragment: ReactNode, options: ExtendTreeOptions = {}): Promise { + public async extendTree(newFragment: Node, options: ExtendTreeOptions = {}): Promise { if (options.signal?.aborted) { return Promise.reject(DataBindingExtendAborted) } - const markerTreeRoot = new MarkerTreeGenerator(newFragment, options.environment ?? this.environment).generate() + const markerTreeRoot = this.createMarkerTree(newFragment, options.environment ?? this.environment) if (this.treeStore.effectivelyHasTreeRoot(markerTreeRoot)) { // This isn't perfectly accurate as theoretically, we could already have all the data necessary but this diff --git a/packages/binding/src/core/EventManager.ts b/packages/binding/src/core/EventManager.ts index 110d616971..493b65431c 100644 --- a/packages/binding/src/core/EventManager.ts +++ b/packages/binding/src/core/EventManager.ts @@ -1,4 +1,3 @@ -import * as ReactDOM from 'react-dom' import type { AsyncBatchUpdatesOptions, BatchUpdatesOptions, @@ -52,6 +51,7 @@ export class EventManager { private readonly dirtinessTracker: DirtinessTracker, private readonly onUpdate: (metadata: UpdateMetadata) => void, private readonly treeStore: TreeStore, + private readonly batchedUpdates: (callback: () => any) => void, ) {} public async persistOperation(operation: () => Promise): Promise { @@ -126,7 +126,7 @@ export class EventManager { return } - ReactDOM.unstable_batchedUpdates(() => { + this.batchedUpdates(() => { this.isFrozenWhileUpdating = true this.triggerBeforeFlushEvents() this.onUpdate(newMetadata) diff --git a/packages/binding/src/core/index.ts b/packages/binding/src/core/index.ts index 71e7ed7bb1..275936d24b 100644 --- a/packages/binding/src/core/index.ts +++ b/packages/binding/src/core/index.ts @@ -1,6 +1,11 @@ export * from './schema' +export * from './Config' export * from './DataBinding' +export * from './DirtinessTracker' +export * from './EventManager' export * from './MarkerMerger' -export * from './MarkerTreeGenerator' +export * from './StateInitializer' +export * from './TreeAugmenter' +export * from './TreeStore' export * from './TreeParameterMerger' export * from './VariableInputTransformer' diff --git a/packages/binding/src/core/schema/index.ts b/packages/binding/src/core/schema/index.ts index 8fc97a1848..8c979aa302 100644 --- a/packages/binding/src/core/schema/index.ts +++ b/packages/binding/src/core/schema/index.ts @@ -1,3 +1,4 @@ +export * from './RawSchema' export * from './Schema' export * from './SchemaColumn' export * from './SchemaColumnType' @@ -7,6 +8,7 @@ export * from './SchemaEnums' export * from './SchemaField' export * from './SchemaFields' export * from './SchemaLoader' +export * from './SchemaPreprocessor' export * from './SchemaRelation' export * from './SchemaRelationOrderBy' export * from './SchemaStore' diff --git a/packages/binding/src/dao/Environment.ts b/packages/binding/src/dao/Environment.ts index 3a16cb853c..cb91fc59f5 100644 --- a/packages/binding/src/dao/Environment.ts +++ b/packages/binding/src/dao/Environment.ts @@ -1,4 +1,3 @@ -import type { ReactNode } from 'react' import { BindingError } from '../BindingError' import type { Filter } from '../treeParameters' import equal from 'fast-deep-equal/es6' @@ -243,7 +242,12 @@ class Environment { namespace Environment { export type Name = string - export type Value = ReactNode | GraphQlLiteral | Filter + export type ReactElementLike = { + type: any + props: any + } + + export type Value = string | number | boolean | undefined | GraphQlLiteral | Filter | ReactElementLike export type ResolvedValue = Value diff --git a/packages/binding/src/dao/index.ts b/packages/binding/src/dao/index.ts index f1f0a13f7c..873841a389 100644 --- a/packages/binding/src/dao/index.ts +++ b/packages/binding/src/dao/index.ts @@ -1,2 +1,3 @@ export * from './Environment' +export * from './TreeNodeEnvironmentFactory' export * from './VariableFieldValue' diff --git a/packages/binding/src/index.ts b/packages/binding/src/index.ts index 0546d6ade2..0f1521305c 100644 --- a/packages/binding/src/index.ts +++ b/packages/binding/src/index.ts @@ -1,12 +1,7 @@ -export * from './accessorPropagation' export * from './accessors' -export * from './accessorSorting' export * from './accessorTree' export * from './core' -export * from './coreComponents' export * from './dao' -export * from './entityEvents' -export * from './helperComponents' export * from './markers' export * from './queryLanguage' export * from './treeParameterHelpers' diff --git a/packages/binding/src/queryLanguage/QueryLanguage.ts b/packages/binding/src/queryLanguage/QueryLanguage.ts index 2216f7b330..2363a66c1b 100644 --- a/packages/binding/src/queryLanguage/QueryLanguage.ts +++ b/packages/binding/src/queryLanguage/QueryLanguage.ts @@ -1,4 +1,3 @@ -import { emptyObject } from '@contember/react-utils' import { TreeParameterMerger, VariableInputTransformer } from '../core' import type { Environment } from '../dao' import { @@ -53,6 +52,8 @@ import { Parser } from './Parser' import { GraphQlLiteral } from '@contember/client' import { ParsedHasManyRelation, ParsedHasOneRelation } from './ParserResults' +const emptyObject = Object.freeze({}) + export class QueryLanguage { private static preparePrimitiveEntryPoint(entryPoint: Entry) { diff --git a/packages/binding/src/tsconfig.json b/packages/binding/src/tsconfig.json index 52fb8334d3..fc9d935549 100644 --- a/packages/binding/src/tsconfig.json +++ b/packages/binding/src/tsconfig.json @@ -4,9 +4,6 @@ "outDir": "../dist/types" }, "references": [ - { "path": "../../client/src" }, - { "path": "../../react-client/src" }, - { "path": "../../react-multipass-rendering/src" }, - { "path": "../../react-utils/src" } + { "path": "../../client/src" } ] } diff --git a/packages/react-binding/api-extractor.json b/packages/react-binding/api-extractor.json new file mode 100644 index 0000000000..66c17dd719 --- /dev/null +++ b/packages/react-binding/api-extractor.json @@ -0,0 +1,3 @@ +{ + "extends": "../../build/api-extractor.json" +} diff --git a/packages/react-binding/package.json b/packages/react-binding/package.json new file mode 100644 index 0000000000..38cb08355e --- /dev/null +++ b/packages/react-binding/package.json @@ -0,0 +1,46 @@ +{ + "name": "@contember/react-binding", + "license": "Apache-2.0", + "version": "0.0.0", + "type": "module", + "sideEffects": false, + "main": "./dist/production/index.js", + "exports": { + ".": { + "import": { + "development": "./dist/development/index.js", + "production": "./dist/production/index.js" + } + } + }, + "files": [ + "dist/", + "src/" + ], + "typings": "./dist/types/index.d.ts", + "scripts": { + "build": "pnpm run build:js:dev && pnpm run build:js:prod", + "build:js:dev": "vite build --mode development", + "build:js:prod": "vite build --mode production", + "ae:build": "api-extractor run --local", + "ae:test": "api-extractor run", + "test": "vitest" + }, + "dependencies": { + "@contember/client": "workspace:*", + "@contember/binding": "workspace:*", + "@contember/react-client": "workspace:*", + "@contember/react-multipass-rendering": "workspace:*", + "@contember/react-utils": "workspace:*" + }, + "peerDependencies": { + "react": "^17 || ^18", + "react-dom": "^17 || ^18" + }, + "devDependencies": { + "@types/js-levenshtein": "1.1.0", + "@types/uuid": "8.3.1", + "react": "^18", + "react-dom": "^18" + } +} diff --git a/packages/binding/src/core/MarkerTreeGenerator.ts b/packages/react-binding/src/MarkerTreeGenerator.ts similarity index 93% rename from packages/binding/src/core/MarkerTreeGenerator.ts rename to packages/react-binding/src/MarkerTreeGenerator.ts index a2ef4cc701..5241509c57 100644 --- a/packages/binding/src/core/MarkerTreeGenerator.ts +++ b/packages/react-binding/src/MarkerTreeGenerator.ts @@ -1,7 +1,7 @@ import { BranchNode, ChildrenAnalyzer, Leaf, RawNodeRepresentation } from '@contember/react-multipass-rendering' import type { ReactNode } from 'react' -import { BindingError } from '../BindingError' -import { Environment } from '../dao' +import { BindingError } from '@contember/binding' +import { Environment } from '@contember/binding' import { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker, @@ -11,9 +11,9 @@ import { HasManyRelationMarker, HasOneRelationMarker, MarkerTreeRoot, -} from '../markers' -import type { Alias } from '../treeParameters' -import { IncrementalMarkerBuilder } from './IncrementalMarkerBuilder' +} from '@contember/binding' +import type { Alias } from '@contember/binding' +import { IncrementalMarkerBuilder } from './core/IncrementalMarkerBuilder' type Fragment = EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker type Terminals = FieldMarker | HasOneRelationMarker | Fragment diff --git a/packages/binding/src/accessorPropagation/AccessorProvider.tsx b/packages/react-binding/src/accessorPropagation/AccessorProvider.tsx similarity index 90% rename from packages/binding/src/accessorPropagation/AccessorProvider.tsx rename to packages/react-binding/src/accessorPropagation/AccessorProvider.tsx index 0290b89231..515b7ea00d 100644 --- a/packages/binding/src/accessorPropagation/AccessorProvider.tsx +++ b/packages/react-binding/src/accessorPropagation/AccessorProvider.tsx @@ -1,5 +1,5 @@ import type { ReactNode } from 'react' -import type { EntityAccessor } from '../accessors' +import type { EntityAccessor } from '@contember/binding' import { EntityKeyContext } from './EntityKeyContext' import { EnvironmentContext } from './EnvironmentContext' diff --git a/packages/binding/src/accessorPropagation/BindingOperationsContext.ts b/packages/react-binding/src/accessorPropagation/BindingOperationsContext.ts similarity index 82% rename from packages/binding/src/accessorPropagation/BindingOperationsContext.ts rename to packages/react-binding/src/accessorPropagation/BindingOperationsContext.ts index 1c12827ed3..bc40750a2b 100644 --- a/packages/binding/src/accessorPropagation/BindingOperationsContext.ts +++ b/packages/react-binding/src/accessorPropagation/BindingOperationsContext.ts @@ -1,6 +1,6 @@ -import { createContext } from 'react' -import type { BindingOperations } from '../accessors' -import { BindingError } from '../BindingError' +import { createContext, ReactNode } from 'react' +import type { BindingOperations } from '@contember/binding' +import { BindingError } from '@contember/binding' const getRejecter = (operation: string) => () => { throw new BindingError( @@ -10,7 +10,7 @@ const getRejecter = (operation: string) => () => { ) } -export const defaultBindingOperations = Object.freeze({ +export const defaultBindingOperations = Object.freeze>({ get contentClient() { return getRejecter('retrieve the content api client')() }, @@ -29,4 +29,4 @@ export const defaultBindingOperations = Object.freeze({ persist: getRejecter('persist'), }) -export const BindingOperationsContext = createContext(defaultBindingOperations) +export const BindingOperationsContext = createContext>(defaultBindingOperations) diff --git a/packages/binding/src/accessorPropagation/BindingOperationsProvider.tsx b/packages/react-binding/src/accessorPropagation/BindingOperationsProvider.tsx similarity index 79% rename from packages/binding/src/accessorPropagation/BindingOperationsProvider.tsx rename to packages/react-binding/src/accessorPropagation/BindingOperationsProvider.tsx index 63854bd3d6..260fde56d9 100644 --- a/packages/binding/src/accessorPropagation/BindingOperationsProvider.tsx +++ b/packages/react-binding/src/accessorPropagation/BindingOperationsProvider.tsx @@ -1,9 +1,9 @@ import type { ReactNode } from 'react' -import type { BindingOperations } from '../accessors' +import type { BindingOperations } from '@contember/binding' import { BindingOperationsContext, defaultBindingOperations } from './BindingOperationsContext' export interface BindingOperationsProviderProps { - bindingOperations: BindingOperations | undefined + bindingOperations: BindingOperations | undefined children: ReactNode } diff --git a/packages/binding/src/accessorPropagation/EntityKeyContext.ts b/packages/react-binding/src/accessorPropagation/EntityKeyContext.ts similarity index 100% rename from packages/binding/src/accessorPropagation/EntityKeyContext.ts rename to packages/react-binding/src/accessorPropagation/EntityKeyContext.ts diff --git a/packages/binding/src/accessorPropagation/EntityKeyProvider.tsx b/packages/react-binding/src/accessorPropagation/EntityKeyProvider.tsx similarity index 100% rename from packages/binding/src/accessorPropagation/EntityKeyProvider.tsx rename to packages/react-binding/src/accessorPropagation/EntityKeyProvider.tsx diff --git a/packages/binding/src/accessorPropagation/EnvironmentContext.tsx b/packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx similarity index 96% rename from packages/binding/src/accessorPropagation/EnvironmentContext.tsx rename to packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx index 2358924a78..cfc03b9401 100644 --- a/packages/binding/src/accessorPropagation/EnvironmentContext.tsx +++ b/packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx @@ -1,5 +1,5 @@ import { createContext, ReactElement, ReactNode, useCallback } from 'react' -import { Environment } from '../dao' +import { Environment } from '@contember/binding' import { useEnvironment } from './useEnvironment' import { Component } from '../coreComponents' diff --git a/packages/binding/src/accessorPropagation/TreeRootIdContext.ts b/packages/react-binding/src/accessorPropagation/TreeRootIdContext.ts similarity index 76% rename from packages/binding/src/accessorPropagation/TreeRootIdContext.ts rename to packages/react-binding/src/accessorPropagation/TreeRootIdContext.ts index d869ba656f..eb13e2504e 100644 --- a/packages/binding/src/accessorPropagation/TreeRootIdContext.ts +++ b/packages/react-binding/src/accessorPropagation/TreeRootIdContext.ts @@ -1,5 +1,5 @@ import { createContext } from 'react' -import type { TreeRootId } from '../treeParameters' +import type { TreeRootId } from '@contember/binding' export const TreeRootIdContext = createContext(undefined) TreeRootIdContext.displayName = 'TreeRootIdContext' diff --git a/packages/binding/src/accessorPropagation/TreeRootIdProvider.tsx b/packages/react-binding/src/accessorPropagation/TreeRootIdProvider.tsx similarity index 87% rename from packages/binding/src/accessorPropagation/TreeRootIdProvider.tsx rename to packages/react-binding/src/accessorPropagation/TreeRootIdProvider.tsx index 752a66c318..c2d9b3f27c 100644 --- a/packages/binding/src/accessorPropagation/TreeRootIdProvider.tsx +++ b/packages/react-binding/src/accessorPropagation/TreeRootIdProvider.tsx @@ -1,5 +1,5 @@ import type { ReactNode } from 'react' -import type { TreeRootId } from '../treeParameters' +import type { TreeRootId } from '@contember/binding' import { TreeRootIdContext } from './TreeRootIdContext' export interface TreeRootIdProviderProps { diff --git a/packages/binding/src/accessorPropagation/index.ts b/packages/react-binding/src/accessorPropagation/index.ts similarity index 100% rename from packages/binding/src/accessorPropagation/index.ts rename to packages/react-binding/src/accessorPropagation/index.ts diff --git a/packages/binding/src/accessorPropagation/useAccessorUpdateSubscription.ts b/packages/react-binding/src/accessorPropagation/useAccessorUpdateSubscription.ts similarity index 97% rename from packages/binding/src/accessorPropagation/useAccessorUpdateSubscription.ts rename to packages/react-binding/src/accessorPropagation/useAccessorUpdateSubscription.ts index 8fe3d84a54..5f3cd1bf72 100644 --- a/packages/binding/src/accessorPropagation/useAccessorUpdateSubscription.ts +++ b/packages/react-binding/src/accessorPropagation/useAccessorUpdateSubscription.ts @@ -1,7 +1,7 @@ import { useConstantValueInvariant } from '@contember/react-utils' import { useCallback, useEffect, useState } from 'react' -import type { EntityAccessor, EntityListAccessor, FieldAccessor } from '../accessors' -import type { FieldValue } from '../treeParameters' +import type { EntityAccessor, EntityListAccessor, FieldAccessor } from '@contember/binding' +import type { FieldValue } from '@contember/binding' export type ForceAccessorUpdate = () => void diff --git a/packages/react-binding/src/accessorPropagation/useBindingOperations.ts b/packages/react-binding/src/accessorPropagation/useBindingOperations.ts new file mode 100644 index 0000000000..054e068f32 --- /dev/null +++ b/packages/react-binding/src/accessorPropagation/useBindingOperations.ts @@ -0,0 +1,5 @@ +import { ReactNode, useContext } from 'react' +import type { BindingOperations } from '@contember/binding' +import { BindingOperationsContext } from './BindingOperationsContext' + +export const useBindingOperations = (): BindingOperations => useContext(BindingOperationsContext) diff --git a/packages/binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts b/packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts similarity index 96% rename from packages/binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts rename to packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts index 69ed2e0392..f54a2cdeb0 100644 --- a/packages/binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts +++ b/packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import { QueryLanguage } from '../queryLanguage' -import type { RelativeEntityList, SugaredRelativeEntityList } from '../treeParameters' +import { QueryLanguage } from '@contember/binding' +import type { RelativeEntityList, SugaredRelativeEntityList } from '@contember/binding' import { useEnvironment } from './useEnvironment' /** diff --git a/packages/binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts b/packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts similarity index 95% rename from packages/binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts rename to packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts index 2ca9999fb3..3312426b38 100644 --- a/packages/binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts +++ b/packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import { QueryLanguage } from '../queryLanguage' -import type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '../treeParameters' +import { QueryLanguage } from '@contember/binding' +import type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '@contember/binding' import { useEnvironment } from './useEnvironment' /** diff --git a/packages/binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts b/packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts similarity index 95% rename from packages/binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts rename to packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts index f1a1d211c9..cb946caf78 100644 --- a/packages/binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts +++ b/packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import { QueryLanguage } from '../queryLanguage' -import type { RelativeSingleField, SugaredRelativeSingleField } from '../treeParameters' +import { QueryLanguage } from '@contember/binding' +import type { RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding' import { useEnvironment } from './useEnvironment' /** diff --git a/packages/binding/src/accessorPropagation/useEntity.ts b/packages/react-binding/src/accessorPropagation/useEntity.ts similarity index 92% rename from packages/binding/src/accessorPropagation/useEntity.ts rename to packages/react-binding/src/accessorPropagation/useEntity.ts index 2ee4ca45ae..0c0c42524b 100644 --- a/packages/binding/src/accessorPropagation/useEntity.ts +++ b/packages/react-binding/src/accessorPropagation/useEntity.ts @@ -1,9 +1,9 @@ import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils' import { useCallback } from 'react' -import { useEntityKey, useGetEntityByKey } from '../accessorPropagation' -import type { EntityAccessor } from '../accessors' +import { useEntityKey, useGetEntityByKey } from './index' +import type { EntityAccessor } from '@contember/binding' import { useOnConnectionUpdate } from '../entityEvents' -import type { SugaredRelativeSingleEntity } from '../treeParameters' +import type { SugaredRelativeSingleEntity } from '@contember/binding' import { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription' import { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity' diff --git a/packages/binding/src/accessorPropagation/useEntityKey.ts b/packages/react-binding/src/accessorPropagation/useEntityKey.ts similarity index 89% rename from packages/binding/src/accessorPropagation/useEntityKey.ts rename to packages/react-binding/src/accessorPropagation/useEntityKey.ts index f407b89077..91097b7427 100644 --- a/packages/binding/src/accessorPropagation/useEntityKey.ts +++ b/packages/react-binding/src/accessorPropagation/useEntityKey.ts @@ -1,5 +1,5 @@ import { useContext } from 'react' -import { BindingError } from '../BindingError' +import { BindingError } from '@contember/binding' import { EntityKeyContext } from './EntityKeyContext' export const useEntityKey = (): string => { diff --git a/packages/binding/src/accessorPropagation/useEntityList.ts b/packages/react-binding/src/accessorPropagation/useEntityList.ts similarity index 90% rename from packages/binding/src/accessorPropagation/useEntityList.ts rename to packages/react-binding/src/accessorPropagation/useEntityList.ts index e61fb401d9..3cf34a0c23 100644 --- a/packages/binding/src/accessorPropagation/useEntityList.ts +++ b/packages/react-binding/src/accessorPropagation/useEntityList.ts @@ -1,9 +1,9 @@ import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils' import { useCallback } from 'react' -import { useEntityKey, useGetEntityByKey } from '../accessorPropagation' -import type { EntityListAccessor } from '../accessors' +import { useEntityKey, useGetEntityByKey } from './index' +import type { EntityListAccessor } from '@contember/binding' import { useOnConnectionUpdate } from '../entityEvents' -import type { SugaredRelativeEntityList } from '../treeParameters' +import type { SugaredRelativeEntityList } from '@contember/binding' import { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription' import { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList' diff --git a/packages/binding/src/accessorPropagation/useEntityListSubTree.ts b/packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts similarity index 87% rename from packages/binding/src/accessorPropagation/useEntityListSubTree.ts rename to packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts index 6d15f1b830..f1393acf92 100644 --- a/packages/binding/src/accessorPropagation/useEntityListSubTree.ts +++ b/packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts @@ -1,10 +1,10 @@ import { useCallback } from 'react' -import type { EntityListAccessor } from '../accessors' -import type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '../treeParameters' +import type { EntityListAccessor } from '@contember/binding' +import type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding' import { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription' import { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters' import { useGetEntityListSubTree } from './useGetEntityListSubTree' -import { TreeRootId } from '../treeParameters' +import { TreeRootId } from '@contember/binding' export const useEntityListSubTree = ( qualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList, diff --git a/packages/binding/src/accessorPropagation/useEntityListSubTreeParameters.ts b/packages/react-binding/src/accessorPropagation/useEntityListSubTreeParameters.ts similarity index 98% rename from packages/binding/src/accessorPropagation/useEntityListSubTreeParameters.ts rename to packages/react-binding/src/accessorPropagation/useEntityListSubTreeParameters.ts index b16dcea4da..19ba693d19 100644 --- a/packages/binding/src/accessorPropagation/useEntityListSubTreeParameters.ts +++ b/packages/react-binding/src/accessorPropagation/useEntityListSubTreeParameters.ts @@ -1,6 +1,6 @@ import { useConstantValueInvariant } from '@contember/react-utils' import { useMemo } from 'react' -import type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '../treeParameters' +import type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding' export function useEntityListSubTreeParameters(alias: Alias): Alias export function useEntityListSubTreeParameters( diff --git a/packages/binding/src/accessorPropagation/useEntitySubTree.ts b/packages/react-binding/src/accessorPropagation/useEntitySubTree.ts similarity index 86% rename from packages/binding/src/accessorPropagation/useEntitySubTree.ts rename to packages/react-binding/src/accessorPropagation/useEntitySubTree.ts index 7348eb373c..be44d65357 100644 --- a/packages/binding/src/accessorPropagation/useEntitySubTree.ts +++ b/packages/react-binding/src/accessorPropagation/useEntitySubTree.ts @@ -1,10 +1,10 @@ import { useCallback } from 'react' -import type { EntityAccessor } from '../accessors' -import type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '../treeParameters' +import type { EntityAccessor } from '@contember/binding' +import type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding' import { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription' import { useEntitySubTreeParameters } from './useEntitySubTreeParameters' import { useGetEntitySubTree } from './useGetEntitySubTree' -import { TreeRootId } from '../treeParameters' +import { TreeRootId } from '@contember/binding' export const useEntitySubTree = ( qualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity, diff --git a/packages/binding/src/accessorPropagation/useEntitySubTreeParameters.ts b/packages/react-binding/src/accessorPropagation/useEntitySubTreeParameters.ts similarity index 97% rename from packages/binding/src/accessorPropagation/useEntitySubTreeParameters.ts rename to packages/react-binding/src/accessorPropagation/useEntitySubTreeParameters.ts index f3e2dc1bf2..0f061f70f3 100644 --- a/packages/binding/src/accessorPropagation/useEntitySubTreeParameters.ts +++ b/packages/react-binding/src/accessorPropagation/useEntitySubTreeParameters.ts @@ -1,6 +1,6 @@ import { useConstantValueInvariant } from '@contember/react-utils' import { useMemo } from 'react' -import type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '../treeParameters' +import type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding' export function useEntitySubTreeParameters(alias: Alias): Alias export function useEntitySubTreeParameters( diff --git a/packages/binding/src/accessorPropagation/useEnvironment.ts b/packages/react-binding/src/accessorPropagation/useEnvironment.ts similarity index 77% rename from packages/binding/src/accessorPropagation/useEnvironment.ts rename to packages/react-binding/src/accessorPropagation/useEnvironment.ts index d65857df5b..1aa872aa6d 100644 --- a/packages/binding/src/accessorPropagation/useEnvironment.ts +++ b/packages/react-binding/src/accessorPropagation/useEnvironment.ts @@ -1,5 +1,5 @@ import { useContext } from 'react' -import type { Environment } from '../dao' +import type { Environment } from '@contember/binding' import { EnvironmentContext } from './EnvironmentContext' export const useEnvironment = (): Environment => { diff --git a/packages/binding/src/accessorPropagation/useExtendTree.ts b/packages/react-binding/src/accessorPropagation/useExtendTree.ts similarity index 84% rename from packages/binding/src/accessorPropagation/useExtendTree.ts rename to packages/react-binding/src/accessorPropagation/useExtendTree.ts index 745bd2ed18..ef084cfba9 100644 --- a/packages/binding/src/accessorPropagation/useExtendTree.ts +++ b/packages/react-binding/src/accessorPropagation/useExtendTree.ts @@ -1,9 +1,9 @@ import { ReactNode, useCallback } from 'react' import { useAbortController, useIsMounted } from '@contember/react-utils' import { useBindingOperations } from './useBindingOperations' -import { TreeRootId } from '../treeParameters' -import { ExtendTreeOptions } from '../accessors' -import { DataBindingExtendAborted } from '../core' +import { TreeRootId } from '@contember/binding' +import { ExtendTreeOptions } from '@contember/binding' +import { DataBindingExtendAborted } from '@contember/binding' import { useEnvironment } from './useEnvironment' export const useExtendTree = () => { diff --git a/packages/binding/src/accessorPropagation/useField.ts b/packages/react-binding/src/accessorPropagation/useField.ts similarity index 90% rename from packages/binding/src/accessorPropagation/useField.ts rename to packages/react-binding/src/accessorPropagation/useField.ts index e3f1a1f9e1..c82e893320 100644 --- a/packages/binding/src/accessorPropagation/useField.ts +++ b/packages/react-binding/src/accessorPropagation/useField.ts @@ -1,9 +1,9 @@ import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils' import { useCallback } from 'react' -import { useEntityKey, useGetEntityByKey } from '../accessorPropagation' -import type { FieldAccessor } from '../accessors' +import { useEntityKey, useGetEntityByKey } from './index' +import type { FieldAccessor } from '@contember/binding' import { useOnConnectionUpdate } from '../entityEvents' -import type { FieldValue, SugaredRelativeSingleField } from '../treeParameters' +import type { FieldValue, SugaredRelativeSingleField } from '@contember/binding' import { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription' import { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField' diff --git a/packages/binding/src/accessorPropagation/useGetEntityByKey.ts b/packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts similarity index 73% rename from packages/binding/src/accessorPropagation/useGetEntityByKey.ts rename to packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts index f809741443..b658b02bed 100644 --- a/packages/binding/src/accessorPropagation/useGetEntityByKey.ts +++ b/packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts @@ -1,4 +1,4 @@ -import type { GetEntityByKey } from '../accessors' +import type { GetEntityByKey } from '@contember/binding' import { useBindingOperations } from './useBindingOperations' export const useGetEntityByKey = (): GetEntityByKey => useBindingOperations().getEntityByKey diff --git a/packages/binding/src/accessorPropagation/useGetEntityListSubTree.ts b/packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts similarity index 91% rename from packages/binding/src/accessorPropagation/useGetEntityListSubTree.ts rename to packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts index 6a597a480c..1d02c17979 100644 --- a/packages/binding/src/accessorPropagation/useGetEntityListSubTree.ts +++ b/packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts @@ -1,11 +1,11 @@ import { useCallback } from 'react' -import type { EntityListAccessor } from '../accessors' +import type { EntityListAccessor } from '@contember/binding' import type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId, -} from '../treeParameters' +} from '@contember/binding' import { useBindingOperations } from './useBindingOperations' import { useEnvironment } from './useEnvironment' import { useTreeRootId } from './useTreeRootId' diff --git a/packages/binding/src/accessorPropagation/useGetEntitySubTree.ts b/packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts similarity index 92% rename from packages/binding/src/accessorPropagation/useGetEntitySubTree.ts rename to packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts index f210df8227..c4e942814e 100644 --- a/packages/binding/src/accessorPropagation/useGetEntitySubTree.ts +++ b/packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts @@ -1,11 +1,11 @@ import { useCallback } from 'react' -import type { EntityAccessor } from '../accessors' +import type { EntityAccessor } from '@contember/binding' import type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity, TreeRootId, -} from '../treeParameters' +} from '@contember/binding' import { useBindingOperations } from './useBindingOperations' import { useEnvironment } from './useEnvironment' import { useTreeRootId } from './useTreeRootId' diff --git a/packages/binding/src/accessorPropagation/useGetTreeFilters.ts b/packages/react-binding/src/accessorPropagation/useGetTreeFilters.ts similarity index 100% rename from packages/binding/src/accessorPropagation/useGetTreeFilters.ts rename to packages/react-binding/src/accessorPropagation/useGetTreeFilters.ts diff --git a/packages/binding/src/accessorPropagation/useHasEntity.ts b/packages/react-binding/src/accessorPropagation/useHasEntity.ts similarity index 100% rename from packages/binding/src/accessorPropagation/useHasEntity.ts rename to packages/react-binding/src/accessorPropagation/useHasEntity.ts diff --git a/packages/binding/src/accessorPropagation/usePersist.ts b/packages/react-binding/src/accessorPropagation/usePersist.ts similarity index 72% rename from packages/binding/src/accessorPropagation/usePersist.ts rename to packages/react-binding/src/accessorPropagation/usePersist.ts index ddb7c58e3c..278223b675 100644 --- a/packages/binding/src/accessorPropagation/usePersist.ts +++ b/packages/react-binding/src/accessorPropagation/usePersist.ts @@ -1,4 +1,4 @@ -import type { Persist } from '../accessors' +import type { Persist } from '@contember/binding' import { useBindingOperations } from './useBindingOperations' export const usePersist = (): Persist => useBindingOperations().persist diff --git a/packages/binding/src/accessorPropagation/useTreeRootId.ts b/packages/react-binding/src/accessorPropagation/useTreeRootId.ts similarity index 77% rename from packages/binding/src/accessorPropagation/useTreeRootId.ts rename to packages/react-binding/src/accessorPropagation/useTreeRootId.ts index 074663e296..1095db763d 100644 --- a/packages/binding/src/accessorPropagation/useTreeRootId.ts +++ b/packages/react-binding/src/accessorPropagation/useTreeRootId.ts @@ -1,5 +1,5 @@ import { useContext } from 'react' -import type { TreeRootId } from '../treeParameters' +import type { TreeRootId } from '@contember/binding' import { TreeRootIdContext } from './TreeRootIdContext' export const useTreeRootId = (): TreeRootId | undefined => useContext(TreeRootIdContext) diff --git a/packages/binding/src/accessorSorting/SetOrderFieldOnCreate.tsx b/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx similarity index 97% rename from packages/binding/src/accessorSorting/SetOrderFieldOnCreate.tsx rename to packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx index 940c0e5cd1..e59b7633e9 100644 --- a/packages/binding/src/accessorSorting/SetOrderFieldOnCreate.tsx +++ b/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx @@ -1,14 +1,14 @@ import type { CrudQueryBuilder, Input } from '@contember/client' import { GraphQlLiteral } from '@contember/client' -import { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents' -import { SugaredField } from '../helperComponents' -import { QueryLanguage } from '../queryLanguage' +import { QueryLanguage } from '@contember/binding' import type { SugaredOrderBy, SugaredQualifiedEntityList, SugaredRelativeSingleField, SugaredUnconstrainedQualifiedSingleEntity, -} from '../treeParameters' +} from '@contember/binding' +import { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents' +import { SugaredField } from '../helperComponents' import { addEntityAtIndex } from './addEntityAtIndex' export interface SetOrderFieldOnCreateOwnProps { diff --git a/packages/binding/src/accessorSorting/SortedEntities.ts b/packages/react-binding/src/accessorSorting/SortedEntities.ts similarity index 87% rename from packages/binding/src/accessorSorting/SortedEntities.ts rename to packages/react-binding/src/accessorSorting/SortedEntities.ts index 67a573972f..0a64185085 100644 --- a/packages/binding/src/accessorSorting/SortedEntities.ts +++ b/packages/react-binding/src/accessorSorting/SortedEntities.ts @@ -1,4 +1,4 @@ -import type { EntityAccessor } from '../accessors' +import { EntityAccessor } from '@contember/binding' export interface SortedEntities { entities: EntityAccessor[] diff --git a/packages/binding/src/accessorSorting/addEntityAtIndex.ts b/packages/react-binding/src/accessorSorting/addEntityAtIndex.ts similarity index 85% rename from packages/binding/src/accessorSorting/addEntityAtIndex.ts rename to packages/react-binding/src/accessorSorting/addEntityAtIndex.ts index 80c64ad837..3a4d556f52 100644 --- a/packages/binding/src/accessorSorting/addEntityAtIndex.ts +++ b/packages/react-binding/src/accessorSorting/addEntityAtIndex.ts @@ -1,7 +1,6 @@ -import type { EntityAccessor, EntityListAccessor } from '../accessors' -import type { RelativeSingleField } from '../treeParameters' import { repairEntitiesOrder } from './repairEntitiesOrder' import { sortEntities } from './sortEntities' +import { EntityAccessor, EntityListAccessor, RelativeSingleField } from '@contember/binding' export const addEntityAtIndex = ( entityList: EntityListAccessor, diff --git a/packages/binding/src/accessorSorting/errors.ts b/packages/react-binding/src/accessorSorting/errors.ts similarity index 79% rename from packages/binding/src/accessorSorting/errors.ts rename to packages/react-binding/src/accessorSorting/errors.ts index aabe51df95..b9b4e6669b 100644 --- a/packages/binding/src/accessorSorting/errors.ts +++ b/packages/react-binding/src/accessorSorting/errors.ts @@ -1,6 +1,6 @@ -import { EntityListAccessor } from '../accessors' -import { BindingError } from '../BindingError' -import type { FieldName } from '../treeParameters' +import { EntityListAccessor } from '@contember/binding' +import { BindingError } from '@contember/binding' +import type { FieldName } from '@contember/binding' import type { SortedEntities } from './SortedEntities' export const throwNoopError = (callbackName: keyof SortedEntities) => { diff --git a/packages/binding/src/accessorSorting/index.ts b/packages/react-binding/src/accessorSorting/index.ts similarity index 100% rename from packages/binding/src/accessorSorting/index.ts rename to packages/react-binding/src/accessorSorting/index.ts diff --git a/packages/binding/src/accessorSorting/moveEntity.ts b/packages/react-binding/src/accessorSorting/moveEntity.ts similarity index 93% rename from packages/binding/src/accessorSorting/moveEntity.ts rename to packages/react-binding/src/accessorSorting/moveEntity.ts index b238350705..f151855b4c 100644 --- a/packages/binding/src/accessorSorting/moveEntity.ts +++ b/packages/react-binding/src/accessorSorting/moveEntity.ts @@ -1,6 +1,5 @@ -import type { EntityAccessor, EntityListAccessor } from '../accessors' -import type { RelativeSingleField } from '../treeParameters' import { sortEntities } from './sortEntities' +import { EntityAccessor, EntityListAccessor, RelativeSingleField } from '@contember/binding' export const moveEntity = ( entityList: EntityListAccessor, diff --git a/packages/binding/src/accessorSorting/repairEntitiesOrder.ts b/packages/react-binding/src/accessorSorting/repairEntitiesOrder.ts similarity index 81% rename from packages/binding/src/accessorSorting/repairEntitiesOrder.ts rename to packages/react-binding/src/accessorSorting/repairEntitiesOrder.ts index 78121a3680..4ce3b946d8 100644 --- a/packages/binding/src/accessorSorting/repairEntitiesOrder.ts +++ b/packages/react-binding/src/accessorSorting/repairEntitiesOrder.ts @@ -1,5 +1,4 @@ -import type { EntityAccessor } from '../accessors' -import type { RelativeSingleField } from '../treeParameters' +import { EntityAccessor, RelativeSingleField } from '@contember/binding' export const repairEntitiesOrder = (sortableByField: RelativeSingleField, sortedEntities: EntityAccessor[]) => { for (let i = 0, len = sortedEntities.length; i < len; i++) { diff --git a/packages/binding/src/accessorSorting/sortEntities.ts b/packages/react-binding/src/accessorSorting/sortEntities.ts similarity index 80% rename from packages/binding/src/accessorSorting/sortEntities.ts rename to packages/react-binding/src/accessorSorting/sortEntities.ts index 9891484fee..859a5f5abd 100644 --- a/packages/binding/src/accessorSorting/sortEntities.ts +++ b/packages/react-binding/src/accessorSorting/sortEntities.ts @@ -1,5 +1,4 @@ -import type { EntityAccessor } from '../accessors' -import type { RelativeSingleField } from '../treeParameters' +import { EntityAccessor, RelativeSingleField } from '@contember/binding' export const sortEntities = ( entities: EntityAccessor[], diff --git a/packages/binding/src/accessorSorting/useSortedEntities.ts b/packages/react-binding/src/accessorSorting/useSortedEntities.ts similarity index 94% rename from packages/binding/src/accessorSorting/useSortedEntities.ts rename to packages/react-binding/src/accessorSorting/useSortedEntities.ts index 45779eb77a..ab2c38eebc 100644 --- a/packages/binding/src/accessorSorting/useSortedEntities.ts +++ b/packages/react-binding/src/accessorSorting/useSortedEntities.ts @@ -1,13 +1,13 @@ import { useCallback, useMemo } from 'react' import { useDesugaredRelativeSingleField } from '../accessorPropagation' -import type { EntityAccessor, EntityListAccessor } from '../accessors' +import type { EntityAccessor, EntityListAccessor } from '@contember/binding' import type { SugaredFieldProps } from '../helperComponents' -import type { RelativeSingleField } from '../treeParameters' -import { addEntityAtIndex } from './addEntityAtIndex' +import type { RelativeSingleField } from '@contember/binding' +import { SortedEntities } from './SortedEntities' import { throwNoopError } from './errors' -import { moveEntity } from './moveEntity' -import type { SortedEntities } from './SortedEntities' +import { addEntityAtIndex } from './addEntityAtIndex' import { sortEntities } from './sortEntities' +import { moveEntity } from './moveEntity' const addNewAtIndexImplementation = ( callbackName: keyof SortedEntities, diff --git a/packages/binding/src/accessorTree/AccessorTree.tsx b/packages/react-binding/src/accessorTree/AccessorTree.tsx similarity index 100% rename from packages/binding/src/accessorTree/AccessorTree.tsx rename to packages/react-binding/src/accessorTree/AccessorTree.tsx diff --git a/packages/binding/src/accessorTree/AccessorTreeState.ts b/packages/react-binding/src/accessorTree/AccessorTreeState.ts similarity index 52% rename from packages/binding/src/accessorTree/AccessorTreeState.ts rename to packages/react-binding/src/accessorTree/AccessorTreeState.ts index 3ddfab7397..133b4c3410 100644 --- a/packages/binding/src/accessorTree/AccessorTreeState.ts +++ b/packages/react-binding/src/accessorTree/AccessorTreeState.ts @@ -1,25 +1,26 @@ -import type { TreeRootAccessor } from '../accessors' -import type { RequestError } from './RequestError' -import { DataBinding } from '../core' -import { Environment } from '../dao' +import type { TreeRootAccessor } from '@contember/binding' +import type { RequestError } from '@contember/binding' +import { DataBinding } from '@contember/binding' +import { Environment } from '@contember/binding' +import { ReactNode } from 'react' export interface InitializingAccessorTreeState { name: 'initializing' environment: Environment - binding?: DataBinding + binding?: DataBinding } export interface InitializedAccessorTreeState { name: 'initialized' environment: Environment - binding: DataBinding - data: TreeRootAccessor + binding: DataBinding + data: TreeRootAccessor } export interface ErrorAccessorTreeState { name: 'error' environment: Environment - binding: DataBinding + binding: DataBinding error: RequestError } diff --git a/packages/react-binding/src/accessorTree/AccessorTreeStateAction.ts b/packages/react-binding/src/accessorTree/AccessorTreeStateAction.ts new file mode 100644 index 0000000000..c37f520dc0 --- /dev/null +++ b/packages/react-binding/src/accessorTree/AccessorTreeStateAction.ts @@ -0,0 +1,22 @@ +import type { TreeRootAccessor } from '@contember/binding' +import type { RequestError } from '@contember/binding' +import { DataBinding } from '@contember/binding' +import { Environment } from '@contember/binding' +import { ReactNode } from 'react' + +export type AccessorTreeStateAction = + | { + type: 'setData' + data: TreeRootAccessor + binding: DataBinding + } + | { + type: 'failWithError' + error: RequestError + binding: DataBinding + } + | { + type: 'reset' + binding: DataBinding + environment: Environment + } diff --git a/packages/binding/src/accessorTree/AccessorTreeStateContext.ts b/packages/react-binding/src/accessorTree/AccessorTreeStateContext.ts similarity index 100% rename from packages/binding/src/accessorTree/AccessorTreeStateContext.ts rename to packages/react-binding/src/accessorTree/AccessorTreeStateContext.ts diff --git a/packages/binding/src/accessorTree/AccessorTreeStateMetadata.ts b/packages/react-binding/src/accessorTree/AccessorTreeStateMetadata.ts similarity index 100% rename from packages/binding/src/accessorTree/AccessorTreeStateMetadata.ts rename to packages/react-binding/src/accessorTree/AccessorTreeStateMetadata.ts diff --git a/packages/binding/src/accessorTree/AccessorTreeStateOptions.ts b/packages/react-binding/src/accessorTree/AccessorTreeStateOptions.ts similarity index 100% rename from packages/binding/src/accessorTree/AccessorTreeStateOptions.ts rename to packages/react-binding/src/accessorTree/AccessorTreeStateOptions.ts diff --git a/packages/binding/src/accessorTree/DirtinessContext.ts b/packages/react-binding/src/accessorTree/DirtinessContext.ts similarity index 100% rename from packages/binding/src/accessorTree/DirtinessContext.ts rename to packages/react-binding/src/accessorTree/DirtinessContext.ts diff --git a/packages/binding/src/accessorTree/MutationStateContext.ts b/packages/react-binding/src/accessorTree/MutationStateContext.ts similarity index 100% rename from packages/binding/src/accessorTree/MutationStateContext.ts rename to packages/react-binding/src/accessorTree/MutationStateContext.ts diff --git a/packages/binding/src/accessorTree/accessorTreeStateReducer.ts b/packages/react-binding/src/accessorTree/accessorTreeStateReducer.ts similarity index 100% rename from packages/binding/src/accessorTree/accessorTreeStateReducer.ts rename to packages/react-binding/src/accessorTree/accessorTreeStateReducer.ts diff --git a/packages/react-binding/src/accessorTree/index.ts b/packages/react-binding/src/accessorTree/index.ts new file mode 100644 index 0000000000..8a5c83493c --- /dev/null +++ b/packages/react-binding/src/accessorTree/index.ts @@ -0,0 +1,12 @@ +export * from './AccessorTree' +export * from './AccessorTreeState' +export * from './AccessorTreeStateAction' +export * from './AccessorTreeStateMetadata' +export * from './AccessorTreeStateOptions' +export * from './accessorTreeStateReducer' +export * from './DirtinessContext' +export * from './MutationStateContext' +export * from './useAccessorTreeState' +export * from './useDataBinding' +export * from './useDirtinessState' +export * from './useMutationState' diff --git a/packages/binding/src/accessorTree/useAccessorTreeState.ts b/packages/react-binding/src/accessorTree/useAccessorTreeState.ts similarity index 84% rename from packages/binding/src/accessorTree/useAccessorTreeState.ts rename to packages/react-binding/src/accessorTree/useAccessorTreeState.ts index 594369b90f..66cf74a7da 100644 --- a/packages/binding/src/accessorTree/useAccessorTreeState.ts +++ b/packages/react-binding/src/accessorTree/useAccessorTreeState.ts @@ -1,6 +1,6 @@ import { useContext } from 'react' import { AccessorTreeStateContext } from './AccessorTreeStateContext' -import { BindingError } from '../BindingError' +import { BindingError } from '@contember/binding' export const useAccessorTreeState = () => { const state = useContext(AccessorTreeStateContext) diff --git a/packages/binding/src/accessorTree/useDataBinding.ts b/packages/react-binding/src/accessorTree/useDataBinding.ts similarity index 69% rename from packages/binding/src/accessorTree/useDataBinding.ts rename to packages/react-binding/src/accessorTree/useDataBinding.ts index 53c56fd1fd..bc40bce34a 100644 --- a/packages/binding/src/accessorTree/useDataBinding.ts +++ b/packages/react-binding/src/accessorTree/useDataBinding.ts @@ -4,19 +4,21 @@ import { useCurrentSystemGraphQlClient, useTenantGraphQlClient, } from '@contember/react-client' -import { useCallback, useEffect, useReducer, useRef, useState } from 'react' +import { ReactNode, useCallback, useEffect, useReducer, useRef, useState } from 'react' import { useEnvironment } from '../accessorPropagation' -import type { TreeRootAccessor } from '../accessors' -import { DataBinding } from '../core' +import type { TreeRootAccessor } from '@contember/binding' +import { DataBinding } from '@contember/binding' import type { AccessorTreeState } from './AccessorTreeState' import type { AccessorTreeStateOptions } from './AccessorTreeStateOptions' import { accessorTreeStateReducer } from './accessorTreeStateReducer' -import { metadataToRequestError } from './metadataToRequestError' -import type { RequestError } from './RequestError' -import { Environment } from '../dao' -import { Schema, SchemaLoader } from '../core/schema' -import { TreeStore } from '../core/TreeStore' +import { metadataToRequestError } from '@contember/binding' +import type { RequestError } from '@contember/binding' +import { Environment } from '@contember/binding' +import { Schema, SchemaLoader } from '@contember/binding' +import { TreeStore } from '@contember/binding' import { useIsMounted } from '@contember/react-utils' +import { MarkerTreeGenerator } from '../MarkerTreeGenerator' +import ReactDOM from 'react-dom' export const useDataBinding = ({ children, @@ -32,13 +34,13 @@ export const useDataBinding = ({ const [schema, setSchema] = useState() const resetDataBinding = useCallback((environment: Environment, newStore: boolean) => { - const onUpdate = (data: TreeRootAccessor, binding: DataBinding) => { + const onUpdate = (data: TreeRootAccessor, binding: DataBinding) => { if (isMountedRef.current) { dispatch({ type: 'setData', data, binding }) } } - const onError = (error: RequestError, binding: DataBinding) => { + const onError = (error: RequestError, binding: DataBinding) => { if (isMountedRef.current) { dispatch({ type: 'failWithError', error, binding }) } @@ -54,9 +56,24 @@ export const useDataBinding = ({ currentTreeStore.current = new TreeStore(environment.getSchema()) } - const binding = new DataBinding(contentClient, systemClient, tenantClient, currentTreeStore.current, environment, onUpdate, onError, onPersistSuccess, { - skipStateUpdateAfterPersist: skipStateUpdateAfterPersist ?? false, - }) + const binding = new DataBinding( + contentClient, + systemClient, + tenantClient, + currentTreeStore.current, + environment, + (node, env) => { + const gen = new MarkerTreeGenerator(node, env) + return gen.generate() + }, + ReactDOM.unstable_batchedUpdates, + onUpdate, + onError, + onPersistSuccess, + { + skipStateUpdateAfterPersist: skipStateUpdateAfterPersist ?? false, + }, + ) dispatch({ type: 'reset', binding, environment }) }, [contentClient, systemClient, tenantClient, isMountedRef, refreshOnPersist, skipStateUpdateAfterPersist]) diff --git a/packages/binding/src/accessorTree/useDirtinessState.ts b/packages/react-binding/src/accessorTree/useDirtinessState.ts similarity index 100% rename from packages/binding/src/accessorTree/useDirtinessState.ts rename to packages/react-binding/src/accessorTree/useDirtinessState.ts diff --git a/packages/binding/src/accessorTree/useMutationState.ts b/packages/react-binding/src/accessorTree/useMutationState.ts similarity index 100% rename from packages/binding/src/accessorTree/useMutationState.ts rename to packages/react-binding/src/accessorTree/useMutationState.ts diff --git a/packages/binding/src/core/IncrementalMarkerBuilder.ts b/packages/react-binding/src/core/IncrementalMarkerBuilder.ts similarity index 88% rename from packages/binding/src/core/IncrementalMarkerBuilder.ts rename to packages/react-binding/src/core/IncrementalMarkerBuilder.ts index 4af064156d..a6bdad2ab8 100644 --- a/packages/binding/src/core/IncrementalMarkerBuilder.ts +++ b/packages/react-binding/src/core/IncrementalMarkerBuilder.ts @@ -1,7 +1,11 @@ -import { EntityFieldMarker, EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '../markers' -import { MarkerFactory } from '../queryLanguage' -import { MarkerMerger } from './MarkerMerger' -import { TreeParameterMerger } from './TreeParameterMerger' +import { + EntityFieldMarker, + EntityFieldMarkersContainer, + EntityFieldsWithHoistablesMarker, + MarkerFactory, + MarkerMerger, + TreeParameterMerger, +} from '@contember/binding' export class IncrementalMarkerBuilder { private accumulator: EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer = new EntityFieldMarkersContainer( diff --git a/packages/binding/src/coreComponents/Component.tsx b/packages/react-binding/src/coreComponents/Component.tsx similarity index 94% rename from packages/binding/src/coreComponents/Component.tsx rename to packages/react-binding/src/coreComponents/Component.tsx index c79ed225c5..23ceea9238 100644 --- a/packages/binding/src/coreComponents/Component.tsx +++ b/packages/react-binding/src/coreComponents/Component.tsx @@ -1,8 +1,8 @@ import { memo, NamedExoticComponent, PropsWithChildren, ReactElement } from 'react' -import { useEnvironment } from '../accessorPropagation/useEnvironment' -import type { Environment } from '../dao' -import { assertNever } from '../utils' +import { useEnvironment } from '../accessorPropagation' +import type { Environment } from '@contember/binding' import type { MarkerProvider, StaticRenderProvider, StaticRenderProviderProps } from './MarkerProvider' +import { assertNever } from '../utils/assertNever' interface EnvironmentAwareFunctionComponent

{ (props: PropsWithChildren

, environment: Environment): ReactElement | null; diff --git a/packages/binding/src/coreComponents/DataBindingProvider.tsx b/packages/react-binding/src/coreComponents/DataBindingProvider.tsx similarity index 100% rename from packages/binding/src/coreComponents/DataBindingProvider.tsx rename to packages/react-binding/src/coreComponents/DataBindingProvider.tsx diff --git a/packages/binding/src/coreComponents/Entity.tsx b/packages/react-binding/src/coreComponents/Entity.tsx similarity index 90% rename from packages/binding/src/coreComponents/Entity.tsx rename to packages/react-binding/src/coreComponents/Entity.tsx index 30f9560299..a3b89ca14e 100644 --- a/packages/binding/src/coreComponents/Entity.tsx +++ b/packages/react-binding/src/coreComponents/Entity.tsx @@ -1,6 +1,6 @@ import type { ReactNode } from 'react' import { AccessorProvider } from '../accessorPropagation' -import type { EntityAccessor } from '../accessors' +import type { EntityAccessor } from '@contember/binding' import { Component } from './Component' export interface EntityBaseProps { diff --git a/packages/binding/src/coreComponents/EntityList.tsx b/packages/react-binding/src/coreComponents/EntityList.tsx similarity index 95% rename from packages/binding/src/coreComponents/EntityList.tsx rename to packages/react-binding/src/coreComponents/EntityList.tsx index c0fc9a74b9..0fa2ef7a77 100644 --- a/packages/binding/src/coreComponents/EntityList.tsx +++ b/packages/react-binding/src/coreComponents/EntityList.tsx @@ -1,5 +1,5 @@ import { ComponentType, createElement, ReactElement, ReactNode } from 'react' -import type { EntityListAccessor } from '../accessors' +import type { EntityListAccessor } from '@contember/binding' import { Component } from './Component' import { Entity } from './Entity' diff --git a/packages/binding/src/coreComponents/EntityListSubTree.tsx b/packages/react-binding/src/coreComponents/EntityListSubTree.tsx similarity index 90% rename from packages/binding/src/coreComponents/EntityListSubTree.tsx rename to packages/react-binding/src/coreComponents/EntityListSubTree.tsx index 7a5e5c560d..9af615382e 100644 --- a/packages/binding/src/coreComponents/EntityListSubTree.tsx +++ b/packages/react-binding/src/coreComponents/EntityListSubTree.tsx @@ -5,14 +5,14 @@ import { useEntityListSubTreeParameters, useGetEntityListSubTree, } from '../accessorPropagation' -import { PRIMARY_KEY_NAME } from '../bindingTypes' -import { Environment } from '../dao' -import { MarkerFactory } from '../queryLanguage' -import type { SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '../treeParameters' +import { PRIMARY_KEY_NAME } from '@contember/binding' +import { Environment } from '@contember/binding' +import { MarkerFactory } from '@contember/binding' +import type { SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '@contember/binding' import { Component } from './Component' import { EntityList, EntityListBaseProps } from './EntityList' import { Field } from './Field' -import { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory' +import { TreeNodeEnvironmentFactory } from '@contember/binding' export interface EntityListSubTreeAdditionalProps { variables?: Environment.ValuesMapWithFactory diff --git a/packages/binding/src/coreComponents/EntitySubTree.tsx b/packages/react-binding/src/coreComponents/EntitySubTree.tsx similarity index 91% rename from packages/binding/src/coreComponents/EntitySubTree.tsx rename to packages/react-binding/src/coreComponents/EntitySubTree.tsx index 963d950f0e..dca9a4dacf 100644 --- a/packages/binding/src/coreComponents/EntitySubTree.tsx +++ b/packages/react-binding/src/coreComponents/EntitySubTree.tsx @@ -1,19 +1,19 @@ import { useConstantValueInvariant } from '@contember/react-utils' import { ReactElement, ReactNode, useCallback } from 'react' import { useAccessorUpdateSubscription, useEntitySubTreeParameters, useGetEntitySubTree } from '../accessorPropagation' -import { SetOrderFieldOnCreate, SetOrderFieldOnCreateOwnProps } from '../accessorSorting' -import { PRIMARY_KEY_NAME } from '../bindingTypes' -import { Environment } from '../dao' -import { MarkerFactory } from '../queryLanguage' +import { PRIMARY_KEY_NAME } from '@contember/binding' +import { Environment } from '@contember/binding' +import { MarkerFactory } from '@contember/binding' import type { SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity, TreeRootId, -} from '../treeParameters' +} from '@contember/binding' import { Component } from './Component' import { Entity } from './Entity' import { Field } from './Field' -import { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory' +import { TreeNodeEnvironmentFactory } from '@contember/binding' +import { SetOrderFieldOnCreate, SetOrderFieldOnCreateOwnProps } from '../accessorSorting' export interface EntitySubTreeAdditionalProps { variables?: Environment.ValuesMapWithFactory diff --git a/packages/binding/src/coreComponents/Field.tsx b/packages/react-binding/src/coreComponents/Field.tsx similarity index 86% rename from packages/binding/src/coreComponents/Field.tsx rename to packages/react-binding/src/coreComponents/Field.tsx index fa32b03c5d..3641070f83 100644 --- a/packages/binding/src/coreComponents/Field.tsx +++ b/packages/react-binding/src/coreComponents/Field.tsx @@ -1,10 +1,10 @@ import { GraphQlBuilder } from '@contember/client' import type { ReactElement, ReactNode } from 'react' import { useField } from '../accessorPropagation' -import { MarkerFactory } from '../queryLanguage' -import type { FieldValue, SugaredRelativeSingleField } from '../treeParameters' +import { MarkerFactory } from '@contember/binding' +import type { FieldValue, SugaredRelativeSingleField } from '@contember/binding' import { Component } from './Component' -import { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory' +import { TreeNodeEnvironmentFactory } from '@contember/binding' export interface FieldBasicProps extends SugaredRelativeSingleField {} diff --git a/packages/binding/src/coreComponents/HasMany.tsx b/packages/react-binding/src/coreComponents/HasMany.tsx similarity index 82% rename from packages/binding/src/coreComponents/HasMany.tsx rename to packages/react-binding/src/coreComponents/HasMany.tsx index 9ae1f81fde..df67435c3f 100644 --- a/packages/binding/src/coreComponents/HasMany.tsx +++ b/packages/react-binding/src/coreComponents/HasMany.tsx @@ -1,13 +1,13 @@ import type { ComponentType, ReactElement, ReactNode } from 'react' import { useEntityList } from '../accessorPropagation' -import { PRIMARY_KEY_NAME } from '../bindingTypes' -import { Environment } from '../dao' -import { MarkerFactory } from '../queryLanguage' -import type { SugaredRelativeEntityList } from '../treeParameters' +import { PRIMARY_KEY_NAME } from '@contember/binding' +import { Environment } from '@contember/binding' +import { MarkerFactory } from '@contember/binding' +import type { SugaredRelativeEntityList } from '@contember/binding' import { Component } from './Component' import { EntityList, EntityListBaseProps } from './EntityList' import { Field } from './Field' -import { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory' +import { TreeNodeEnvironmentFactory } from '@contember/binding' export type HasManyProps = SugaredRelativeEntityList & { children?: ReactNode diff --git a/packages/binding/src/coreComponents/HasOne.tsx b/packages/react-binding/src/coreComponents/HasOne.tsx similarity index 79% rename from packages/binding/src/coreComponents/HasOne.tsx rename to packages/react-binding/src/coreComponents/HasOne.tsx index 04394a567a..6338c282b9 100644 --- a/packages/binding/src/coreComponents/HasOne.tsx +++ b/packages/react-binding/src/coreComponents/HasOne.tsx @@ -1,13 +1,13 @@ import type { ReactElement, ReactNode } from 'react' import { useEntity } from '../accessorPropagation' -import { PRIMARY_KEY_NAME } from '../bindingTypes' -import { Environment } from '../dao' -import { MarkerFactory } from '../queryLanguage' -import type { SugaredRelativeSingleEntity } from '../treeParameters' +import { PRIMARY_KEY_NAME } from '@contember/binding' +import { Environment } from '@contember/binding' +import { MarkerFactory } from '@contember/binding' +import type { SugaredRelativeSingleEntity } from '@contember/binding' import { Component } from './Component' import { Entity } from './Entity' import { Field } from './Field' -import { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory' +import { TreeNodeEnvironmentFactory } from '@contember/binding' export type HasOneProps = SugaredRelativeSingleEntity & { children?: ReactNode diff --git a/packages/binding/src/coreComponents/MarkerProvider.ts b/packages/react-binding/src/coreComponents/MarkerProvider.ts similarity index 96% rename from packages/binding/src/coreComponents/MarkerProvider.ts rename to packages/react-binding/src/coreComponents/MarkerProvider.ts index 4d221fdd3d..7ecdd3a761 100644 --- a/packages/binding/src/coreComponents/MarkerProvider.ts +++ b/packages/react-binding/src/coreComponents/MarkerProvider.ts @@ -1,12 +1,12 @@ import type { ReactElement } from 'react' -import type { Environment } from '../dao' +import type { Environment } from '@contember/binding' import type { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker, FieldMarker, HasManyRelationMarker, HasOneRelationMarker, -} from '../markers' +} from '@contember/binding' export interface EnvironmentDeltaProvider { generateEnvironment: (props: Props, oldEnvironment: Environment) => Environment diff --git a/packages/binding/src/coreComponents/ParentEntity.tsx b/packages/react-binding/src/coreComponents/ParentEntity.tsx similarity index 77% rename from packages/binding/src/coreComponents/ParentEntity.tsx rename to packages/react-binding/src/coreComponents/ParentEntity.tsx index 3485f0653d..4686afe68f 100644 --- a/packages/binding/src/coreComponents/ParentEntity.tsx +++ b/packages/react-binding/src/coreComponents/ParentEntity.tsx @@ -1,6 +1,6 @@ import type { ReactNode } from 'react' -import { MarkerFactory } from '../queryLanguage' -import type { SugaredParentEntityParameters } from '../treeParameters' +import { MarkerFactory } from '@contember/binding' +import type { SugaredParentEntityParameters } from '@contember/binding' import { Component } from './Component' export interface ParentEntityProps extends SugaredParentEntityParameters { diff --git a/packages/binding/src/coreComponents/index.ts b/packages/react-binding/src/coreComponents/index.ts similarity index 100% rename from packages/binding/src/coreComponents/index.ts rename to packages/react-binding/src/coreComponents/index.ts diff --git a/packages/binding/src/entityEvents/index.ts b/packages/react-binding/src/entityEvents/index.ts similarity index 100% rename from packages/binding/src/entityEvents/index.ts rename to packages/react-binding/src/entityEvents/index.ts diff --git a/packages/binding/src/entityEvents/useDerivedField.ts b/packages/react-binding/src/entityEvents/useDerivedField.ts similarity index 94% rename from packages/binding/src/entityEvents/useDerivedField.ts rename to packages/react-binding/src/entityEvents/useDerivedField.ts index 113a6be550..bb3f175553 100644 --- a/packages/binding/src/entityEvents/useDerivedField.ts +++ b/packages/react-binding/src/entityEvents/useDerivedField.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect } from 'react' import { useDesugaredRelativeSingleField, useEntityKey, useGetEntityByKey } from '../accessorPropagation' -import type { FieldAccessor } from '../accessors' -import type { FieldValue, SugaredRelativeSingleField } from '../treeParameters' +import type { FieldAccessor } from '@contember/binding' +import type { FieldValue, SugaredRelativeSingleField } from '@contember/binding' const identityFunction = (value: Value) => value diff --git a/packages/binding/src/entityEvents/useEntityBeforePersist.ts b/packages/react-binding/src/entityEvents/useEntityBeforePersist.ts similarity index 78% rename from packages/binding/src/entityEvents/useEntityBeforePersist.ts rename to packages/react-binding/src/entityEvents/useEntityBeforePersist.ts index a1df14ce47..d5c1949e45 100644 --- a/packages/binding/src/entityEvents/useEntityBeforePersist.ts +++ b/packages/react-binding/src/entityEvents/useEntityBeforePersist.ts @@ -1,4 +1,4 @@ -import type { EntityAccessor } from '../accessors' +import type { EntityAccessor } from '@contember/binding' import { useEntityEvent } from './useEntityEvent' export const useEntityBeforePersist = (listener: EntityAccessor.EntityEventListenerMap['beforePersist']) => { diff --git a/packages/binding/src/entityEvents/useEntityBeforeUpdate.ts b/packages/react-binding/src/entityEvents/useEntityBeforeUpdate.ts similarity index 78% rename from packages/binding/src/entityEvents/useEntityBeforeUpdate.ts rename to packages/react-binding/src/entityEvents/useEntityBeforeUpdate.ts index 3c19754580..0f8bcb303a 100644 --- a/packages/binding/src/entityEvents/useEntityBeforeUpdate.ts +++ b/packages/react-binding/src/entityEvents/useEntityBeforeUpdate.ts @@ -1,4 +1,4 @@ -import type { EntityAccessor } from '../accessors' +import type { EntityAccessor } from '@contember/binding' import { useEntityEvent } from './useEntityEvent' export const useEntityBeforeUpdate = (listener: EntityAccessor.EntityEventListenerMap['beforeUpdate']) => { diff --git a/packages/binding/src/entityEvents/useEntityEvent.ts b/packages/react-binding/src/entityEvents/useEntityEvent.ts similarity index 94% rename from packages/binding/src/entityEvents/useEntityEvent.ts rename to packages/react-binding/src/entityEvents/useEntityEvent.ts index 0d48d415d8..429b70ff7c 100644 --- a/packages/binding/src/entityEvents/useEntityEvent.ts +++ b/packages/react-binding/src/entityEvents/useEntityEvent.ts @@ -1,7 +1,7 @@ import { useEffect } from 'react' import { useEntityKey, useGetEntityByKey } from '../accessorPropagation' -import type { EntityAccessor } from '../accessors' -import type { FieldName } from '../treeParameters' +import type { EntityAccessor } from '@contember/binding' +import type { FieldName } from '@contember/binding' export function useEntityEvent( type: 'beforePersist', diff --git a/packages/binding/src/entityEvents/useEntityPersistError.ts b/packages/react-binding/src/entityEvents/useEntityPersistError.ts similarity index 78% rename from packages/binding/src/entityEvents/useEntityPersistError.ts rename to packages/react-binding/src/entityEvents/useEntityPersistError.ts index 560f844e58..fcb5dacbbb 100644 --- a/packages/binding/src/entityEvents/useEntityPersistError.ts +++ b/packages/react-binding/src/entityEvents/useEntityPersistError.ts @@ -1,4 +1,4 @@ -import type { EntityAccessor } from '../accessors' +import type { EntityAccessor } from '@contember/binding' import { useEntityEvent } from './useEntityEvent' export const useEntityPersistError = (listener: EntityAccessor.EntityEventListenerMap['persistError']) => { diff --git a/packages/binding/src/entityEvents/useEntityPersistSuccess.ts b/packages/react-binding/src/entityEvents/useEntityPersistSuccess.ts similarity index 78% rename from packages/binding/src/entityEvents/useEntityPersistSuccess.ts rename to packages/react-binding/src/entityEvents/useEntityPersistSuccess.ts index 0523f9f67a..007f08e9a4 100644 --- a/packages/binding/src/entityEvents/useEntityPersistSuccess.ts +++ b/packages/react-binding/src/entityEvents/useEntityPersistSuccess.ts @@ -1,4 +1,4 @@ -import type { EntityAccessor } from '../accessors' +import type { EntityAccessor } from '@contember/binding' import { useEntityEvent } from './useEntityEvent' export const useEntityPersistSuccess = (listener: EntityAccessor.EntityEventListenerMap['persistSuccess']) => { diff --git a/packages/binding/src/entityEvents/useOnConnectionUpdate.ts b/packages/react-binding/src/entityEvents/useOnConnectionUpdate.ts similarity index 69% rename from packages/binding/src/entityEvents/useOnConnectionUpdate.ts rename to packages/react-binding/src/entityEvents/useOnConnectionUpdate.ts index 523193ea5d..9715eb1290 100644 --- a/packages/binding/src/entityEvents/useOnConnectionUpdate.ts +++ b/packages/react-binding/src/entityEvents/useOnConnectionUpdate.ts @@ -1,5 +1,5 @@ -import type { EntityAccessor } from '../accessors' -import type { FieldName } from '../treeParameters' +import type { EntityAccessor } from '@contember/binding' +import type { FieldName } from '@contember/binding' import { useEntityEvent } from './useEntityEvent' export const useOnConnectionUpdate = ( diff --git a/packages/binding/src/helperComponents/DeferredSubTrees.tsx b/packages/react-binding/src/helperComponents/DeferredSubTrees.tsx similarity index 95% rename from packages/binding/src/helperComponents/DeferredSubTrees.tsx rename to packages/react-binding/src/helperComponents/DeferredSubTrees.tsx index e8b05a143f..a8bce06e88 100644 --- a/packages/binding/src/helperComponents/DeferredSubTrees.tsx +++ b/packages/react-binding/src/helperComponents/DeferredSubTrees.tsx @@ -1,13 +1,13 @@ import { ReactNode, useCallback, useEffect, useState } from 'react' import { TreeRootIdProvider, useBindingOperations, useHasEntity, useEnvironment } from '../accessorPropagation' -import { useMutationState } from '../accessorTree' import { Component } from '../coreComponents' import { useEntityBeforePersist } from '../entityEvents' -import { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '../markers' -import { MarkerFactory } from '../queryLanguage' -import type { TreeRootId } from '../treeParameters' +import { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '@contember/binding' +import { MarkerFactory } from '@contember/binding' +import type { TreeRootId } from '@contember/binding' import { useConstantValueInvariant } from '@contember/react-utils' -import { EntityAccessor } from '../accessors' +import { EntityAccessor } from '@contember/binding' +import { useMutationState } from '../accessorTree' export interface DeferredSubTreesProps { fallback: ReactNode diff --git a/packages/binding/src/helperComponents/EntityView.tsx b/packages/react-binding/src/helperComponents/EntityView.tsx similarity index 77% rename from packages/binding/src/helperComponents/EntityView.tsx rename to packages/react-binding/src/helperComponents/EntityView.tsx index 55ccd6d59a..367a2843f2 100644 --- a/packages/binding/src/helperComponents/EntityView.tsx +++ b/packages/react-binding/src/helperComponents/EntityView.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from 'react' import { useEntity } from '../accessorPropagation' -import type { EntityAccessor } from '../accessors' -import type { SugaredRelativeSingleEntity } from '../treeParameters' +import type { EntityAccessor } from '@contember/binding' +import type { SugaredRelativeSingleEntity } from '@contember/binding' export interface EntityViewProps { render: (entity: EntityAccessor) => ReactNode diff --git a/packages/binding/src/helperComponents/FieldView.tsx b/packages/react-binding/src/helperComponents/FieldView.tsx similarity index 95% rename from packages/binding/src/helperComponents/FieldView.tsx rename to packages/react-binding/src/helperComponents/FieldView.tsx index 063e98e9a9..7239cf7f2e 100644 --- a/packages/binding/src/helperComponents/FieldView.tsx +++ b/packages/react-binding/src/helperComponents/FieldView.tsx @@ -1,11 +1,11 @@ import { useArrayMapMemo, useConstantLengthInvariant } from '@contember/react-utils' import { ReactElement, ReactNode, useCallback, useMemo } from 'react' import { useEntity } from '../accessorPropagation' -import type { FieldAccessor } from '../accessors' -import { throwBindingError } from '../BindingError' +import type { FieldAccessor } from '@contember/binding' +import { throwBindingError } from '@contember/binding' import { Component } from '../coreComponents' -import { QueryLanguage } from '../queryLanguage' -import type { FieldValue, RelativeSingleField, SugaredRelativeSingleField } from '../treeParameters' +import { QueryLanguage } from '@contember/binding' +import type { FieldValue, RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding' import { SugaredField } from './SugaredField' interface FieldViewCommonProps { diff --git a/packages/binding/src/helperComponents/If.tsx b/packages/react-binding/src/helperComponents/If.tsx similarity index 92% rename from packages/binding/src/helperComponents/If.tsx rename to packages/react-binding/src/helperComponents/If.tsx index f826d30e8c..b21b395039 100644 --- a/packages/binding/src/helperComponents/If.tsx +++ b/packages/react-binding/src/helperComponents/If.tsx @@ -1,10 +1,10 @@ import type { ReactNode } from 'react' import { useMemo } from 'react' import { Component, Field } from '../coreComponents' -import { EntityAccessor } from '../accessors' -import { QueryLanguage } from '../queryLanguage' +import { EntityAccessor } from '@contember/binding' +import { QueryLanguage } from '@contember/binding' import { useEntity, useEnvironment } from '../accessorPropagation' -import { Filter } from '../treeParameters' +import { Filter } from '@contember/binding' import { FilterFieldsCollector } from './helpers/FilterFieldsCollector' import { FilterEvaluator } from './helpers/FilterEvaluator' diff --git a/packages/binding/src/helperComponents/StaticRender.tsx b/packages/react-binding/src/helperComponents/StaticRender.tsx similarity index 100% rename from packages/binding/src/helperComponents/StaticRender.tsx rename to packages/react-binding/src/helperComponents/StaticRender.tsx diff --git a/packages/binding/src/helperComponents/SugaredField.tsx b/packages/react-binding/src/helperComponents/SugaredField.tsx similarity index 84% rename from packages/binding/src/helperComponents/SugaredField.tsx rename to packages/react-binding/src/helperComponents/SugaredField.tsx index 5e5c561556..a8a8b9a25c 100644 --- a/packages/binding/src/helperComponents/SugaredField.tsx +++ b/packages/react-binding/src/helperComponents/SugaredField.tsx @@ -1,6 +1,6 @@ import { Component, Field, FieldProps } from '../coreComponents' -import type { SugaredRelativeSingleField } from '../treeParameters' -import { FieldValue } from '../treeParameters' +import type { SugaredRelativeSingleField } from '@contember/binding' +import { FieldValue } from '@contember/binding' import { ReactElement } from 'react' export interface SugaredFieldProps extends Omit, 'field'> { diff --git a/packages/binding/src/helperComponents/helpers/FilterEvaluator.ts b/packages/react-binding/src/helperComponents/helpers/FilterEvaluator.ts similarity index 85% rename from packages/binding/src/helperComponents/helpers/FilterEvaluator.ts rename to packages/react-binding/src/helperComponents/helpers/FilterEvaluator.ts index fb7f686d02..1bc8a2f286 100644 --- a/packages/binding/src/helperComponents/helpers/FilterEvaluator.ts +++ b/packages/react-binding/src/helperComponents/helpers/FilterEvaluator.ts @@ -1,8 +1,8 @@ -import { Schema } from '../../core/schema' +import { Schema } from '@contember/binding' import { Input } from '@contember/client' -import { EntityAccessor } from '../../accessors' -import { Filter } from '../../treeParameters' -import { BindingError } from '../../BindingError' +import { EntityAccessor } from '@contember/binding' +import { Filter } from '@contember/binding' +import { BindingError } from '@contember/binding' import { evaluateCondition } from './evaluateCondition' diff --git a/packages/binding/src/helperComponents/helpers/FilterFieldsCollector.ts b/packages/react-binding/src/helperComponents/helpers/FilterFieldsCollector.ts similarity index 89% rename from packages/binding/src/helperComponents/helpers/FilterFieldsCollector.ts rename to packages/react-binding/src/helperComponents/helpers/FilterFieldsCollector.ts index 5fba5fa839..4ab5e60954 100644 --- a/packages/binding/src/helperComponents/helpers/FilterFieldsCollector.ts +++ b/packages/react-binding/src/helperComponents/helpers/FilterFieldsCollector.ts @@ -1,6 +1,6 @@ -import { Schema, SchemaEntity } from '../../core/schema' -import { Filter } from '../../treeParameters' -import { BindingError } from '../../BindingError' +import { Schema, SchemaEntity } from '@contember/binding' +import { Filter } from '@contember/binding' +import { BindingError } from '@contember/binding' export class FilterFieldsCollector { constructor( diff --git a/packages/binding/src/helperComponents/helpers/evaluateCondition.ts b/packages/react-binding/src/helperComponents/helpers/evaluateCondition.ts similarity index 95% rename from packages/binding/src/helperComponents/helpers/evaluateCondition.ts rename to packages/react-binding/src/helperComponents/helpers/evaluateCondition.ts index 328438f290..bfd1bf5d4c 100644 --- a/packages/binding/src/helperComponents/helpers/evaluateCondition.ts +++ b/packages/react-binding/src/helperComponents/helpers/evaluateCondition.ts @@ -1,6 +1,6 @@ import { GraphQlLiteral, Input } from '@contember/client' -import { FieldValue } from '../../treeParameters' -import { BindingError } from '../../BindingError' +import { FieldValue } from '@contember/binding' +import { BindingError } from '@contember/binding' const unwrapGraphqlLiteral = (value: Input.ColumnValue): any => { if (value instanceof GraphQlLiteral) { diff --git a/packages/binding/src/helperComponents/index.ts b/packages/react-binding/src/helperComponents/index.ts similarity index 100% rename from packages/binding/src/helperComponents/index.ts rename to packages/react-binding/src/helperComponents/index.ts diff --git a/packages/react-binding/src/index.ts b/packages/react-binding/src/index.ts new file mode 100644 index 0000000000..1bac611ac4 --- /dev/null +++ b/packages/react-binding/src/index.ts @@ -0,0 +1,8 @@ +export * from './accessorTree' +export * from './accessorPropagation' +export * from './accessorSorting' +export * from './coreComponents' +export * from './entityEvents' +export * from './helperComponents' +export * from './MarkerTreeGenerator' +export * from '@contember/binding' diff --git a/packages/react-binding/src/tsconfig.json b/packages/react-binding/src/tsconfig.json new file mode 100644 index 0000000000..93c5a566af --- /dev/null +++ b/packages/react-binding/src/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "outDir": "../dist/types" + }, + "references": [ + { "path": "../../binding/src" }, + { "path": "../../client/src" }, + { "path": "../../react-client/src" }, + { "path": "../../react-multipass-rendering/src" }, + { "path": "../../react-utils/src" } + ] +} diff --git a/packages/react-binding/src/utils/assertNever.ts b/packages/react-binding/src/utils/assertNever.ts new file mode 100644 index 0000000000..1adbbceca1 --- /dev/null +++ b/packages/react-binding/src/utils/assertNever.ts @@ -0,0 +1,10 @@ +import { BindingError } from '@contember/binding' + +export function assertNever(_: never): never { + throw new BindingError( + `FATAL ERROR. This should absolutely never have happened. Yet, despite all efforts, here we are. ` + + `Please find solace in having a good laugh about the whole situation. ` + + `You have just witnessed true harshness of software development. ` + + `Please report this bug.`, + ) +} diff --git a/packages/binding/tests/cases/unit/core/bindingFactory.ts b/packages/react-binding/tests/cases/unit/core/bindingFactory.ts similarity index 56% rename from packages/binding/tests/cases/unit/core/bindingFactory.ts rename to packages/react-binding/tests/cases/unit/core/bindingFactory.ts index b9c3003cb2..1ca2f744b7 100644 --- a/packages/binding/tests/cases/unit/core/bindingFactory.ts +++ b/packages/react-binding/tests/cases/unit/core/bindingFactory.ts @@ -1,15 +1,18 @@ -import { TreeStore } from '../../../../src/core/TreeStore' -import { Environment, MarkerTreeGenerator } from '../../../../src' -import { Schema } from '../../../../src/core/schema' -import { SchemaPreprocessor } from '../../../../src/core/schema/SchemaPreprocessor' -import { Config } from '../../../../src/core/Config' -import { EventManager } from '../../../../src/core/EventManager' -import { DirtinessTracker } from '../../../../src/core/DirtinessTracker' -import { StateInitializer } from '../../../../src/core/StateInitializer' -import { TreeAugmenter } from '../../../../src/core/TreeAugmenter' import assert from 'assert' import { ReactNode } from 'react' -import { RawSchema } from '../../../../src/core/schema/RawSchema' +import { + Config, + DirtinessTracker, + Environment, + EventManager, + RawSchema, + Schema, + SchemaPreprocessor, + StateInitializer, + TreeAugmenter, + TreeStore, +} from '@contember/binding' +import { MarkerTreeGenerator } from '../../../../src' export const createBindingWithEntitySubtree = ({ node, schema }: {node: ReactNode, schema: RawSchema}) => { const finalSchema = new Schema(SchemaPreprocessor.processRawSchema(schema)) @@ -17,7 +20,7 @@ export const createBindingWithEntitySubtree = ({ node, schema }: {node: ReactNod const environment = Environment.create().withSchema(finalSchema) const generator = new MarkerTreeGenerator(node, environment) const config = new Config() - const eventManager = new EventManager({} as any, {} as any, config, new DirtinessTracker(), () => null, treeStore) + const eventManager = new EventManager({} as any, {} as any, config, new DirtinessTracker(), () => null, treeStore, it => it()) const stateInitializer = new StateInitializer( {} as any, {} as any, diff --git a/packages/binding/tests/cases/unit/core/entityOperations.test.tsx b/packages/react-binding/tests/cases/unit/core/entityOperations.test.tsx similarity index 100% rename from packages/binding/tests/cases/unit/core/entityOperations.test.tsx rename to packages/react-binding/tests/cases/unit/core/entityOperations.test.tsx diff --git a/packages/binding/tests/cases/unit/core/eventManager.test.tsx b/packages/react-binding/tests/cases/unit/core/eventManager.test.tsx similarity index 100% rename from packages/binding/tests/cases/unit/core/eventManager.test.tsx rename to packages/react-binding/tests/cases/unit/core/eventManager.test.tsx diff --git a/packages/binding/tests/cases/unit/helperComponents/FilterEvaluator.spec.ts b/packages/react-binding/tests/cases/unit/helperComponents/FilterEvaluator.spec.ts similarity index 100% rename from packages/binding/tests/cases/unit/helperComponents/FilterEvaluator.spec.ts rename to packages/react-binding/tests/cases/unit/helperComponents/FilterEvaluator.spec.ts diff --git a/packages/binding/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts b/packages/react-binding/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts similarity index 87% rename from packages/binding/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts rename to packages/react-binding/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts index fe483efec7..28c3b4b31f 100644 --- a/packages/binding/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts +++ b/packages/react-binding/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts @@ -1,7 +1,5 @@ -import { expect, it, describe } from 'vitest' +import { describe, expect, it } from 'vitest' import { FilterFieldsCollector } from '../../../../src/helperComponents/helpers/FilterFieldsCollector' -import { Schema } from '../../../../src/core/schema' -import { SchemaPreprocessor } from '../../../../src/core/schema/SchemaPreprocessor' import { schema } from './schema' describe('Filter fields collector', () => { diff --git a/packages/binding/tests/cases/unit/helperComponents/evaluateCondition.spec.ts b/packages/react-binding/tests/cases/unit/helperComponents/evaluateCondition.spec.ts similarity index 100% rename from packages/binding/tests/cases/unit/helperComponents/evaluateCondition.spec.ts rename to packages/react-binding/tests/cases/unit/helperComponents/evaluateCondition.spec.ts diff --git a/packages/binding/tests/cases/unit/helperComponents/schema.ts b/packages/react-binding/tests/cases/unit/helperComponents/schema.ts similarity index 92% rename from packages/binding/tests/cases/unit/helperComponents/schema.ts rename to packages/react-binding/tests/cases/unit/helperComponents/schema.ts index 8117910969..668ce7b7c8 100644 --- a/packages/binding/tests/cases/unit/helperComponents/schema.ts +++ b/packages/react-binding/tests/cases/unit/helperComponents/schema.ts @@ -1,5 +1,4 @@ -import { Schema } from '../../../../src/core/schema' -import { SchemaPreprocessor } from '../../../../src/core/schema/SchemaPreprocessor' +import { Schema, SchemaPreprocessor } from '@contember/binding' export const schema = new Schema(SchemaPreprocessor.processRawSchema({ entities: [ diff --git a/packages/binding/tests/cases/unit/model/markerTreeGenerator.spec.tsx b/packages/react-binding/tests/cases/unit/model/markerTreeGenerator.spec.tsx similarity index 98% rename from packages/binding/tests/cases/unit/model/markerTreeGenerator.spec.tsx rename to packages/react-binding/tests/cases/unit/model/markerTreeGenerator.spec.tsx index 9972ac84ec..8f9a03817d 100644 --- a/packages/binding/tests/cases/unit/model/markerTreeGenerator.spec.tsx +++ b/packages/react-binding/tests/cases/unit/model/markerTreeGenerator.spec.tsx @@ -20,8 +20,8 @@ import { PRIMARY_KEY_NAME, SubTreeMarkers, } from '../../../../src' -import { Schema, SchemaRelation } from '../../../../src/core/schema' -import { SchemaPreprocessor } from '../../../../src/core/schema/SchemaPreprocessor' +import { Schema, SchemaRelation } from '@contember/binding' +import { SchemaPreprocessor } from '@contember/binding' describe('Marker tree generator', () => { it('should accept empty trees', () => { diff --git a/packages/react-binding/tests/tsconfig.json b/packages/react-binding/tests/tsconfig.json new file mode 100644 index 0000000000..833dd61fbe --- /dev/null +++ b/packages/react-binding/tests/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "noEmit": true, + "emitDeclarationOnly": false + }, + "references": [ + { "path": "../src" } + ] +} diff --git a/packages/react-binding/tsconfig.json b/packages/react-binding/tsconfig.json new file mode 100644 index 0000000000..e3a586f5ef --- /dev/null +++ b/packages/react-binding/tsconfig.json @@ -0,0 +1,8 @@ +{ + "files": [], + "include": [], + "references": [ + { "path": "./src" }, + { "path": "./tests" } + ] +} diff --git a/packages/react-binding/vite.config.js b/packages/react-binding/vite.config.js new file mode 100644 index 0000000000..04627f7ea3 --- /dev/null +++ b/packages/react-binding/vite.config.js @@ -0,0 +1,3 @@ +import { createViteConfig } from './../../build/createViteConfig.js' + +export default createViteConfig('react-binding') diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bfb1966269..2a6ce8cede 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -90,8 +90,8 @@ importers: packages/admin: specifiers: '@babel/core': 7.17.10 - '@contember/binding': workspace:* '@contember/client': workspace:* + '@contember/react-binding': workspace:* '@contember/react-client': workspace:* '@contember/react-multipass-rendering': workspace:* '@contember/react-utils': workspace:* @@ -142,8 +142,8 @@ importers: stacktracey: 2.1.7 dependencies: '@babel/core': 7.17.10 - '@contember/binding': link:../binding '@contember/client': link:../client + '@contember/react-binding': link:../react-binding '@contember/react-client': link:../react-client '@contember/react-multipass-rendering': link:../react-multipass-rendering '@contember/react-utils': link:../react-utils @@ -252,6 +252,37 @@ importers: dependencies: '@contember/schema': 0.11.5 + packages/react-binding: + specifiers: + '@contember/binding': workspace:* + '@contember/client': workspace:* + '@contember/react-client': workspace:* + '@contember/react-multipass-rendering': workspace:* + '@contember/react-utils': workspace:* + '@types/js-levenshtein': 1.1.0 + '@types/uuid': 8.3.1 + chevrotain: 6.5.0 + fast-deep-equal: ^3.1.3 + js-levenshtein: 1.1.6 + react: ^18 + react-dom: ^18 + uuid: 8.3.2 + dependencies: + '@contember/binding': link:../binding + '@contember/client': link:../client + '@contember/react-client': link:../react-client + '@contember/react-multipass-rendering': link:../react-multipass-rendering + '@contember/react-utils': link:../react-utils + chevrotain: 6.5.0 + fast-deep-equal: 3.1.3 + js-levenshtein: 1.1.6 + uuid: 8.3.2 + devDependencies: + '@types/js-levenshtein': 1.1.0 + '@types/uuid': 8.3.1 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + packages/react-client: specifiers: '@contember/client': workspace:* diff --git a/tsconfig.json b/tsconfig.json index 4fe9744043..c27be79b37 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ { "path": "./packages/admin-sandbox"}, { "path": "./packages/binding" }, { "path": "./packages/client"}, + { "path": "./packages/react-binding"}, { "path": "./packages/react-client"}, { "path": "./packages/react-multipass-rendering"}, { "path": "./packages/react-utils"},