@contember/react-binding 2.1.0-beta.2 → 2.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/development/src/accessorPropagation/BindingOperationsProvider.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/BindingOperationsProvider.js.map +1 -1
- package/dist/development/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/development/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/development/src/accessorPropagation/TreeRootIdProvider.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/TreeRootIdProvider.js.map +1 -1
- package/dist/development/src/accessorPropagation/useBindingOperations.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useBindingOperations.js.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntity.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntity.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityKey.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityKey.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityList.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEnvironment.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEnvironment.js.map +1 -1
- package/dist/development/src/accessorPropagation/useExtendTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useExtendTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useField.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useField.js.map +1 -1
- package/dist/development/src/accessorPropagation/useGetEntityByKey.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useGetEntityByKey.js.map +1 -1
- package/dist/development/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useHasEntity.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useHasEntity.js.map +1 -1
- package/dist/development/src/accessorPropagation/usePersist.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/usePersist.js.map +1 -1
- package/dist/development/src/accessorPropagation/useTreeRootId.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useTreeRootId.js.map +1 -1
- package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
- package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/development/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
- package/dist/development/src/accessorSorting/addEntityAtIndex.js.map +1 -1
- package/dist/development/src/accessorTree/AccessorTree.cjs.map +1 -1
- package/dist/development/src/accessorTree/AccessorTree.js.map +1 -1
- package/dist/development/src/accessorTree/AccessorTreeStateContext.cjs.map +1 -1
- package/dist/development/src/accessorTree/AccessorTreeStateContext.js.map +1 -1
- package/dist/development/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
- package/dist/development/src/accessorTree/useAccessorTreeState.js.map +1 -1
- package/dist/development/src/accessorTree/useDataBinding.cjs.map +1 -1
- package/dist/development/src/accessorTree/useDataBinding.js.map +1 -1
- package/dist/development/src/accessorTree/useDirtinessState.cjs.map +1 -1
- package/dist/development/src/accessorTree/useDirtinessState.js.map +1 -1
- package/dist/development/src/accessorTree/useMutationState.cjs.map +1 -1
- package/dist/development/src/accessorTree/useMutationState.js.map +1 -1
- package/dist/development/src/coreComponents/Component.cjs.map +1 -1
- package/dist/development/src/coreComponents/Component.js.map +1 -1
- package/dist/development/src/coreComponents/DataBindingProvider.cjs.map +1 -1
- package/dist/development/src/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/development/src/coreComponents/Entity.cjs.map +1 -1
- package/dist/development/src/coreComponents/Entity.js.map +1 -1
- package/dist/development/src/coreComponents/EntityList.cjs.map +1 -1
- package/dist/development/src/coreComponents/EntityList.js.map +1 -1
- package/dist/development/src/coreComponents/EntityListSubTree.cjs.map +1 -1
- package/dist/development/src/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/development/src/coreComponents/EntitySubTree.cjs.map +1 -1
- package/dist/development/src/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/development/src/coreComponents/Field.cjs.map +1 -1
- package/dist/development/src/coreComponents/Field.js.map +1 -1
- package/dist/development/src/coreComponents/HasMany.cjs.map +1 -1
- package/dist/development/src/coreComponents/HasMany.js.map +1 -1
- package/dist/development/src/coreComponents/HasOne.cjs.map +1 -1
- package/dist/development/src/coreComponents/HasOne.js.map +1 -1
- package/dist/development/src/coreComponents/ParentEntity.cjs.map +1 -1
- package/dist/development/src/coreComponents/ParentEntity.js.map +1 -1
- package/dist/development/src/entityEvents/useDataBindingEvent.cjs.map +1 -1
- package/dist/development/src/entityEvents/useDataBindingEvent.js.map +1 -1
- package/dist/development/src/entityEvents/useDerivedField.cjs.map +1 -1
- package/dist/development/src/entityEvents/useDerivedField.js.map +1 -1
- package/dist/development/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
- package/dist/development/src/entityEvents/useEntityBeforePersist.js.map +1 -1
- package/dist/development/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
- package/dist/development/src/entityEvents/useEntityBeforeUpdate.js.map +1 -1
- package/dist/development/src/entityEvents/useEntityEvent.cjs.map +1 -1
- package/dist/development/src/entityEvents/useEntityEvent.js.map +1 -1
- package/dist/development/src/entityEvents/useEntityPersistError.cjs.map +1 -1
- package/dist/development/src/entityEvents/useEntityPersistError.js.map +1 -1
- package/dist/development/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
- package/dist/development/src/entityEvents/useEntityPersistSuccess.js.map +1 -1
- package/dist/development/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
- package/dist/development/src/entityEvents/useOnConnectionUpdate.js.map +1 -1
- package/dist/development/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
- package/dist/development/src/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/development/src/helperComponents/DeleteEntityTrigger.cjs.map +1 -1
- package/dist/development/src/helperComponents/DeleteEntityTrigger.js.map +1 -1
- package/dist/development/src/helperComponents/DimensionRenderer.cjs.map +1 -1
- package/dist/development/src/helperComponents/DimensionRenderer.js.map +1 -1
- package/dist/development/src/helperComponents/EntityView.cjs.map +1 -1
- package/dist/development/src/helperComponents/EntityView.js.map +1 -1
- package/dist/development/src/helperComponents/FieldView.cjs.map +1 -1
- package/dist/development/src/helperComponents/FieldView.js.map +1 -1
- package/dist/development/src/helperComponents/If.cjs.map +1 -1
- package/dist/development/src/helperComponents/If.js.map +1 -1
- package/dist/development/src/helperComponents/LabelMiddleware.cjs.map +1 -1
- package/dist/development/src/helperComponents/LabelMiddleware.js.map +1 -1
- package/dist/development/src/helperComponents/RecursionTerminator.cjs.map +1 -1
- package/dist/development/src/helperComponents/RecursionTerminator.js.map +1 -1
- package/dist/development/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -1
- package/dist/development/src/helperComponents/RecursionTerminatorPortal.js.map +1 -1
- package/dist/development/src/helperComponents/StaticRender.cjs.map +1 -1
- package/dist/development/src/helperComponents/StaticRender.js.map +1 -1
- package/dist/development/src/helperComponents/SugaredField.cjs.map +1 -1
- package/dist/development/src/helperComponents/SugaredField.js.map +1 -1
- package/dist/development/src/helperComponents/Variable.cjs.map +1 -1
- package/dist/development/src/helperComponents/Variable.js.map +1 -1
- package/dist/development/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
- package/dist/development/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
- package/dist/development/src/helperComponents/helpers/evaluateCondition.cjs +33 -0
- package/dist/development/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
- package/dist/development/src/helperComponents/helpers/evaluateCondition.js +33 -0
- package/dist/development/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
- package/dist/development/src/helperComponents/persist/PersistOnFieldChange.cjs.map +1 -1
- package/dist/development/src/helperComponents/persist/PersistOnFieldChange.js.map +1 -1
- package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.cjs.map +1 -1
- package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.js.map +1 -1
- package/dist/development/src/helperComponents/persist/PersistOnKey.cjs.map +1 -1
- package/dist/development/src/helperComponents/persist/PersistOnKey.js.map +1 -1
- package/dist/development/src/helperComponents/persist/PersistTrigger.cjs +1 -1
- package/dist/development/src/helperComponents/persist/PersistTrigger.cjs.map +1 -1
- package/dist/development/src/helperComponents/persist/PersistTrigger.js +1 -1
- package/dist/development/src/helperComponents/persist/PersistTrigger.js.map +1 -1
- package/dist/development/src/helperComponents/persist/useDecoratedPersist.cjs.map +1 -1
- package/dist/development/src/helperComponents/persist/useDecoratedPersist.js.map +1 -1
- package/dist/development/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
- package/dist/development/src/markers/MarkerStaticAnalyzer.js.map +1 -1
- package/dist/development/src/markers/MarkerTreeGenerator.cjs.map +1 -1
- package/dist/development/src/markers/MarkerTreeGenerator.js.map +1 -1
- package/dist/production/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/production/src/accessorPropagation/BindingOperationsProvider.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/BindingOperationsProvider.js.map +1 -1
- package/dist/production/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/production/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/production/src/accessorPropagation/TreeRootIdProvider.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/TreeRootIdProvider.js.map +1 -1
- package/dist/production/src/accessorPropagation/useBindingOperations.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useBindingOperations.js.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntity.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntity.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityKey.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityKey.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityList.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEnvironment.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEnvironment.js.map +1 -1
- package/dist/production/src/accessorPropagation/useExtendTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useExtendTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useField.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useField.js.map +1 -1
- package/dist/production/src/accessorPropagation/useGetEntityByKey.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useGetEntityByKey.js.map +1 -1
- package/dist/production/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useHasEntity.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useHasEntity.js.map +1 -1
- package/dist/production/src/accessorPropagation/usePersist.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/usePersist.js.map +1 -1
- package/dist/production/src/accessorPropagation/useTreeRootId.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useTreeRootId.js.map +1 -1
- package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
- package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/production/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
- package/dist/production/src/accessorSorting/addEntityAtIndex.js.map +1 -1
- package/dist/production/src/accessorTree/AccessorTree.cjs.map +1 -1
- package/dist/production/src/accessorTree/AccessorTree.js.map +1 -1
- package/dist/production/src/accessorTree/AccessorTreeStateContext.cjs.map +1 -1
- package/dist/production/src/accessorTree/AccessorTreeStateContext.js.map +1 -1
- package/dist/production/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
- package/dist/production/src/accessorTree/useAccessorTreeState.js.map +1 -1
- package/dist/production/src/accessorTree/useDataBinding.cjs.map +1 -1
- package/dist/production/src/accessorTree/useDataBinding.js.map +1 -1
- package/dist/production/src/accessorTree/useDirtinessState.cjs.map +1 -1
- package/dist/production/src/accessorTree/useDirtinessState.js.map +1 -1
- package/dist/production/src/accessorTree/useMutationState.cjs.map +1 -1
- package/dist/production/src/accessorTree/useMutationState.js.map +1 -1
- package/dist/production/src/coreComponents/Component.cjs.map +1 -1
- package/dist/production/src/coreComponents/Component.js.map +1 -1
- package/dist/production/src/coreComponents/DataBindingProvider.cjs.map +1 -1
- package/dist/production/src/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/production/src/coreComponents/Entity.cjs.map +1 -1
- package/dist/production/src/coreComponents/Entity.js.map +1 -1
- package/dist/production/src/coreComponents/EntityList.cjs.map +1 -1
- package/dist/production/src/coreComponents/EntityList.js.map +1 -1
- package/dist/production/src/coreComponents/EntityListSubTree.cjs.map +1 -1
- package/dist/production/src/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/production/src/coreComponents/EntitySubTree.cjs.map +1 -1
- package/dist/production/src/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/production/src/coreComponents/Field.cjs.map +1 -1
- package/dist/production/src/coreComponents/Field.js.map +1 -1
- package/dist/production/src/coreComponents/HasMany.cjs.map +1 -1
- package/dist/production/src/coreComponents/HasMany.js.map +1 -1
- package/dist/production/src/coreComponents/HasOne.cjs.map +1 -1
- package/dist/production/src/coreComponents/HasOne.js.map +1 -1
- package/dist/production/src/coreComponents/ParentEntity.cjs.map +1 -1
- package/dist/production/src/coreComponents/ParentEntity.js.map +1 -1
- package/dist/production/src/entityEvents/useDataBindingEvent.cjs.map +1 -1
- package/dist/production/src/entityEvents/useDataBindingEvent.js.map +1 -1
- package/dist/production/src/entityEvents/useDerivedField.cjs.map +1 -1
- package/dist/production/src/entityEvents/useDerivedField.js.map +1 -1
- package/dist/production/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
- package/dist/production/src/entityEvents/useEntityBeforePersist.js.map +1 -1
- package/dist/production/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
- package/dist/production/src/entityEvents/useEntityBeforeUpdate.js.map +1 -1
- package/dist/production/src/entityEvents/useEntityEvent.cjs.map +1 -1
- package/dist/production/src/entityEvents/useEntityEvent.js.map +1 -1
- package/dist/production/src/entityEvents/useEntityPersistError.cjs.map +1 -1
- package/dist/production/src/entityEvents/useEntityPersistError.js.map +1 -1
- package/dist/production/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
- package/dist/production/src/entityEvents/useEntityPersistSuccess.js.map +1 -1
- package/dist/production/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
- package/dist/production/src/entityEvents/useOnConnectionUpdate.js.map +1 -1
- package/dist/production/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
- package/dist/production/src/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/production/src/helperComponents/DeleteEntityTrigger.cjs.map +1 -1
- package/dist/production/src/helperComponents/DeleteEntityTrigger.js.map +1 -1
- package/dist/production/src/helperComponents/DimensionRenderer.cjs.map +1 -1
- package/dist/production/src/helperComponents/DimensionRenderer.js.map +1 -1
- package/dist/production/src/helperComponents/EntityView.cjs.map +1 -1
- package/dist/production/src/helperComponents/EntityView.js.map +1 -1
- package/dist/production/src/helperComponents/FieldView.cjs.map +1 -1
- package/dist/production/src/helperComponents/FieldView.js.map +1 -1
- package/dist/production/src/helperComponents/If.cjs.map +1 -1
- package/dist/production/src/helperComponents/If.js.map +1 -1
- package/dist/production/src/helperComponents/LabelMiddleware.cjs.map +1 -1
- package/dist/production/src/helperComponents/LabelMiddleware.js.map +1 -1
- package/dist/production/src/helperComponents/RecursionTerminator.cjs.map +1 -1
- package/dist/production/src/helperComponents/RecursionTerminator.js.map +1 -1
- package/dist/production/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -1
- package/dist/production/src/helperComponents/RecursionTerminatorPortal.js.map +1 -1
- package/dist/production/src/helperComponents/StaticRender.cjs.map +1 -1
- package/dist/production/src/helperComponents/StaticRender.js.map +1 -1
- package/dist/production/src/helperComponents/SugaredField.cjs.map +1 -1
- package/dist/production/src/helperComponents/SugaredField.js.map +1 -1
- package/dist/production/src/helperComponents/Variable.cjs.map +1 -1
- package/dist/production/src/helperComponents/Variable.js.map +1 -1
- package/dist/production/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
- package/dist/production/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
- package/dist/production/src/helperComponents/helpers/evaluateCondition.cjs +33 -0
- package/dist/production/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
- package/dist/production/src/helperComponents/helpers/evaluateCondition.js +33 -0
- package/dist/production/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
- package/dist/production/src/helperComponents/persist/PersistOnFieldChange.cjs.map +1 -1
- package/dist/production/src/helperComponents/persist/PersistOnFieldChange.js.map +1 -1
- package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.cjs.map +1 -1
- package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.js.map +1 -1
- package/dist/production/src/helperComponents/persist/PersistOnKey.cjs.map +1 -1
- package/dist/production/src/helperComponents/persist/PersistOnKey.js.map +1 -1
- package/dist/production/src/helperComponents/persist/PersistTrigger.cjs.map +1 -1
- package/dist/production/src/helperComponents/persist/PersistTrigger.js.map +1 -1
- package/dist/production/src/helperComponents/persist/useDecoratedPersist.cjs.map +1 -1
- package/dist/production/src/helperComponents/persist/useDecoratedPersist.js.map +1 -1
- package/dist/production/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
- package/dist/production/src/markers/MarkerStaticAnalyzer.js.map +1 -1
- package/dist/production/src/markers/MarkerTreeGenerator.cjs.map +1 -1
- package/dist/production/src/markers/MarkerTreeGenerator.js.map +1 -1
- package/dist/types/accessorPropagation/index.d.ts +28 -28
- package/dist/types/accessorPropagation/index.d.ts.map +1 -1
- package/dist/types/accessorSorting/index.d.ts +5 -5
- package/dist/types/accessorSorting/index.d.ts.map +1 -1
- package/dist/types/accessorTree/AccessorTree.d.ts +1 -1
- package/dist/types/accessorTree/AccessorTree.d.ts.map +1 -1
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +1 -1
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +1 -1
- package/dist/types/accessorTree/index.d.ts +11 -11
- package/dist/types/accessorTree/index.d.ts.map +1 -1
- package/dist/types/accessorTree/useAccessorTreeState.d.ts +1 -1
- package/dist/types/accessorTree/useAccessorTreeState.d.ts.map +1 -1
- package/dist/types/accessorTree/useDataBinding.d.ts +1 -1
- package/dist/types/accessorTree/useDataBinding.d.ts.map +1 -1
- package/dist/types/coreComponents/Component.d.ts +1 -1
- package/dist/types/coreComponents/Component.d.ts.map +1 -1
- package/dist/types/coreComponents/DataBindingProvider.d.ts +1 -1
- package/dist/types/coreComponents/DataBindingProvider.d.ts.map +1 -1
- package/dist/types/coreComponents/EntityListSubTree.d.ts +1 -1
- package/dist/types/coreComponents/EntityListSubTree.d.ts.map +1 -1
- package/dist/types/coreComponents/EntitySubTree.d.ts +1 -1
- package/dist/types/coreComponents/EntitySubTree.d.ts.map +1 -1
- package/dist/types/coreComponents/HasMany.d.ts +1 -1
- package/dist/types/coreComponents/HasMany.d.ts.map +1 -1
- package/dist/types/coreComponents/index.d.ts +10 -10
- package/dist/types/coreComponents/index.d.ts.map +1 -1
- package/dist/types/entityEvents/index.d.ts +8 -8
- package/dist/types/entityEvents/index.d.ts.map +1 -1
- package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts +1 -1
- package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts.map +1 -1
- package/dist/types/helperComponents/SugaredField.d.ts +1 -1
- package/dist/types/helperComponents/SugaredField.d.ts.map +1 -1
- package/dist/types/helperComponents/helpers/evaluateCondition.d.ts.map +1 -1
- package/dist/types/helperComponents/index.d.ts +13 -13
- package/dist/types/helperComponents/index.d.ts.map +1 -1
- package/dist/types/helperComponents/persist/PersistTrigger.d.ts +3 -0
- package/dist/types/helperComponents/persist/PersistTrigger.d.ts.map +1 -1
- package/dist/types/helperComponents/persist/index.d.ts +4 -4
- package/dist/types/helperComponents/persist/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/markers/index.d.ts +2 -2
- package/dist/types/markers/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -8
- package/src/accessorPropagation/AccessorProvider.tsx +2 -2
- package/src/accessorPropagation/BindingOperationsProvider.tsx +1 -1
- package/src/accessorPropagation/EntityKeyProvider.tsx +1 -1
- package/src/accessorPropagation/EnvironmentContext.tsx +2 -2
- package/src/accessorPropagation/TreeRootIdProvider.tsx +1 -1
- package/src/accessorPropagation/index.ts +31 -31
- package/src/accessorPropagation/useBindingOperations.ts +1 -1
- package/src/accessorPropagation/useDesugaredRelativeEntityList.ts +1 -1
- package/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts +1 -1
- package/src/accessorPropagation/useDesugaredRelativeSingleField.ts +1 -1
- package/src/accessorPropagation/useEntity.ts +4 -4
- package/src/accessorPropagation/useEntityKey.ts +1 -1
- package/src/accessorPropagation/useEntityList.ts +4 -4
- package/src/accessorPropagation/useEntityListSubTree.ts +3 -3
- package/src/accessorPropagation/useEntityListSubTreeLoader.ts +3 -3
- package/src/accessorPropagation/useEntitySubTree.ts +3 -3
- package/src/accessorPropagation/useEntitySubTreeLoader.ts +2 -2
- package/src/accessorPropagation/useEnvironment.ts +1 -1
- package/src/accessorPropagation/useExtendTree.ts +2 -2
- package/src/accessorPropagation/useField.ts +4 -4
- package/src/accessorPropagation/useGetEntityByKey.ts +1 -1
- package/src/accessorPropagation/useGetEntityListSubTree.ts +3 -3
- package/src/accessorPropagation/useGetEntitySubTree.ts +3 -3
- package/src/accessorPropagation/useHasEntity.ts +1 -1
- package/src/accessorPropagation/usePersist.ts +1 -1
- package/src/accessorPropagation/useTreeRootId.ts +1 -1
- package/src/accessorSorting/SetOrderFieldOnCreate.tsx +3 -3
- package/src/accessorSorting/addEntityAtIndex.ts +2 -2
- package/src/accessorSorting/index.ts +5 -5
- package/src/accessorTree/AccessorTree.tsx +6 -6
- package/src/accessorTree/AccessorTreeStateContext.ts +1 -1
- package/src/accessorTree/index.ts +11 -11
- package/src/accessorTree/useAccessorTreeState.ts +1 -1
- package/src/accessorTree/useDataBinding.ts +4 -4
- package/src/accessorTree/useDirtinessState.ts +1 -1
- package/src/accessorTree/useMutationState.ts +1 -1
- package/src/coreComponents/Component.tsx +2 -2
- package/src/coreComponents/DataBindingProvider.tsx +1 -1
- package/src/coreComponents/Entity.tsx +2 -2
- package/src/coreComponents/EntityList.tsx +2 -2
- package/src/coreComponents/EntityListSubTree.tsx +4 -4
- package/src/coreComponents/EntitySubTree.tsx +5 -5
- package/src/coreComponents/Field.tsx +2 -2
- package/src/coreComponents/HasMany.tsx +4 -4
- package/src/coreComponents/HasOne.tsx +4 -4
- package/src/coreComponents/ParentEntity.tsx +1 -1
- package/src/coreComponents/index.ts +10 -10
- package/src/entityEvents/index.ts +8 -8
- package/src/entityEvents/useDataBindingEvent.ts +1 -1
- package/src/entityEvents/useDerivedField.ts +1 -1
- package/src/entityEvents/useEntityBeforePersist.ts +1 -1
- package/src/entityEvents/useEntityBeforeUpdate.ts +1 -1
- package/src/entityEvents/useEntityEvent.ts +1 -1
- package/src/entityEvents/useEntityPersistError.ts +1 -1
- package/src/entityEvents/useEntityPersistSuccess.ts +1 -1
- package/src/entityEvents/useOnConnectionUpdate.ts +1 -1
- package/src/helperComponents/DeferredSubTrees.tsx +4 -4
- package/src/helperComponents/DeleteEntityTrigger.tsx +3 -3
- package/src/helperComponents/DimensionRenderer.tsx +2 -2
- package/src/helperComponents/EntityView.tsx +1 -1
- package/src/helperComponents/FieldView.tsx +3 -3
- package/src/helperComponents/If.tsx +4 -4
- package/src/helperComponents/LabelMiddleware.tsx +1 -1
- package/src/helperComponents/RecursionTerminator.tsx +1 -1
- package/src/helperComponents/RecursionTerminatorPortal.tsx +3 -3
- package/src/helperComponents/StaticRender.tsx +1 -1
- package/src/helperComponents/SugaredField.tsx +1 -1
- package/src/helperComponents/Variable.tsx +1 -1
- package/src/helperComponents/helpers/FilterEvaluator.ts +1 -1
- package/src/helperComponents/helpers/evaluateCondition.ts +33 -0
- package/src/helperComponents/index.ts +13 -13
- package/src/helperComponents/persist/PersistOnFieldChange.tsx +3 -3
- package/src/helperComponents/persist/PersistOnHasOneChange.tsx +3 -3
- package/src/helperComponents/persist/PersistOnKey.tsx +1 -1
- package/src/helperComponents/persist/PersistTrigger.tsx +5 -2
- package/src/helperComponents/persist/index.tsx +4 -4
- package/src/helperComponents/persist/useDecoratedPersist.ts +1 -1
- package/src/index.ts +7 -7
- package/src/markers/MarkerStaticAnalyzer.ts +2 -2
- package/src/markers/MarkerTreeGenerator.ts +1 -1
- package/src/markers/index.ts +2 -2
- package/tests/cases/unit/core/entityOperations.test.tsx +3 -3
- package/tests/cases/unit/core/eventManager.test.tsx +3 -3
- package/tests/cases/unit/helperComponents/FilterEvaluator.spec.ts +3 -3
- package/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts +2 -2
- package/tests/cases/unit/helperComponents/evaluateCondition.spec.ts +1 -1
- package/tests/cases/unit/model/markerTreeGenerator.spec.tsx +1 -1
- package/tests/lib/bindingFactory.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersistTrigger.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistTrigger.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { dataAttribute } from '@contember/utilities'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { ErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useDirtinessState, useMutationState } from '../../accessorTree'\nimport { composeEventHandlers } from '@radix-ui/primitive'\n\nexport interface PersistTriggerAttributes {\n\t['data-dirty']?: ''\n\t['data-loading']?: ''\n}\n\nconst SlotType = Slot as React.ForwardRefExoticComponent<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement> & PersistTriggerAttributes\n>\n\nexport interface PersistTriggerProps {\n\t/**\n\t * The button element.\n\t */\n\tchildren: ReactElement\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * A button that triggers persist when clicked.\n *\n * ## Props {@link PersistTriggerProps}\n * - children, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistTrigger>\n * <button>Save</button>\n * </PersistTrigger>\n * ```\n */\nexport const PersistTrigger = ({ onPersistError, onPersistSuccess, ...props }: PersistTriggerProps) => {\n\tconst isMutating = useMutationState()\n\tconst isDirty = useDirtinessState()\n\tconst triggerPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\n\tconst isDisabled = isMutating || !isDirty\n\n\tconst { onClick, ...otherProps } = props as React.ButtonHTMLAttributes<HTMLButtonElement>\n\n\treturn (\n\t\t<SlotType\n\t\t\tdisabled={isDisabled}\n\t\t\tdata-dirty={dataAttribute(isDirty)}\n\t\t\tdata-loading={dataAttribute(isMutating)}\n\t\t\tonClick={composeEventHandlers(triggerPersist, onClick)}\n\t\t\t{...otherProps}\n\t\t/>\n\t)\n}\n"],"names":["this"],"mappings":";;;;;;;AAaA,MAAM,WAAW;
|
|
1
|
+
{"version":3,"file":"PersistTrigger.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistTrigger.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { dataAttribute } from '@contember/utilities'\nimport { useDecoratedPersist } from './useDecoratedPersist.js'\nimport { ErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useDirtinessState, useMutationState } from '../../accessorTree/index.js'\nimport { composeEventHandlers } from '@radix-ui/primitive'\n\nexport interface PersistTriggerAttributes {\n\t['data-dirty']?: ''\n\t['data-loading']?: ''\n}\n\nconst SlotType = Slot as React.ForwardRefExoticComponent<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement> & PersistTriggerAttributes\n>\n\nexport interface PersistTriggerProps {\n\t/**\n\t * The button element.\n\t */\n\tchildren: ReactElement\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * A button that triggers persist when clicked.\n *\n * ## Props {@link PersistTriggerProps}\n * - children, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistTrigger>\n * <button>Save</button>\n * </PersistTrigger>\n * ```\n */\nexport const PersistTrigger = ({ onPersistError, onPersistSuccess, ...props }: PersistTriggerProps) => {\n\tconst isMutating = useMutationState()\n\tconst isDirty = useDirtinessState()\n\tconst triggerPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\n\tconst isDisabled = isMutating || !isDirty\n\n\tconst { onClick, ...otherProps } = props as React.ButtonHTMLAttributes<HTMLButtonElement>\n\n\treturn (\n\t\t<SlotType\n\t\t\tdisabled={isDisabled}\n\t\t\tdata-dirty={dataAttribute(isDirty)}\n\t\t\tdata-loading={dataAttribute(isMutating)}\n\t\t\tonClick={composeEventHandlers(triggerPersist, onClick)}\n\t\t\t{...otherProps}\n\t\t/>\n\t)\n}\n"],"names":["this"],"mappings":";;;;;;;AAaA,MAAM,WAAW;AAgCV,MAAM,iBAAiB,CAAC,EAAE,gBAAgB,kBAAkB,GAAG,YAAiC;AACtG,QAAM,aAAa,iBAAA;AACnB,QAAM,UAAU,kBAAA;AAChB,QAAM,iBAAiB,oBAAoB,EAAE,gBAAgB,kBAAkB;AAE/E,QAAM,aAAa,cAAc,CAAC;AAElC,QAAM,EAAE,SAAS,GAAG,WAAA,IAAe;AAEnC,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,UAAU;AAAA,MACV,cAAY,cAAc,OAAO;AAAA,MACjC,gBAAc,cAAc,UAAU;AAAA,MACtC,SAAS,qBAAqB,gBAAgB,OAAO;AAAA,MACpD,GAAG;AAAA,IAAA;AAAA,IALL;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAQF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDecoratedPersist.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/useDecoratedPersist.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport { usePersist } from '../../accessorPropagation'\nimport { ErrorPersistResult, isErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nexport interface UseDecoratedPersistOptions {\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\nexport const useDecoratedPersist = ({ onPersistSuccess, onPersistError }: UseDecoratedPersistOptions = {}) => {\n\tconst triggerPersist = usePersist()\n\n\treturn useReferentiallyStableCallback(async () => {\n\t\ttry {\n\t\t\tconst result = await triggerPersist()\n\t\t\tonPersistSuccess?.(result)\n\t\t} catch (e) {\n\t\t\tif (isErrorPersistResult(e)) {\n\t\t\t\tonPersistError?.(e)\n\t\t\t} else {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":["usePersist","useReferentiallyStableCallback","isErrorPersistResult"],"mappings":";;;;;AAUO,MAAM,sBAAsB,CAAC,EAAE,kBAAkB,eAAA,IAA+C,CAAA,MAAO;AAC7G,QAAM,iBAAiBA,WAAAA,WAAA;AAEvB,SAAOC,WAAAA,+BAA+B,YAAY;AACjD,QAAI;AACH,YAAM,SAAS,MAAM,eAAA;AACrB,yBAAmB,MAAM;AAAA,IAC1B,SAAS,GAAG;AACX,UAAIC,QAAAA,qBAAqB,CAAC,GAAG;AAC5B,yBAAiB,CAAC;AAAA,MACnB,OAAO;AACN,cAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD,CAAC;AACF;;"}
|
|
1
|
+
{"version":3,"file":"useDecoratedPersist.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/useDecoratedPersist.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport { usePersist } from '../../accessorPropagation/index.js'\nimport { ErrorPersistResult, isErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nexport interface UseDecoratedPersistOptions {\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\nexport const useDecoratedPersist = ({ onPersistSuccess, onPersistError }: UseDecoratedPersistOptions = {}) => {\n\tconst triggerPersist = usePersist()\n\n\treturn useReferentiallyStableCallback(async () => {\n\t\ttry {\n\t\t\tconst result = await triggerPersist()\n\t\t\tonPersistSuccess?.(result)\n\t\t} catch (e) {\n\t\t\tif (isErrorPersistResult(e)) {\n\t\t\t\tonPersistError?.(e)\n\t\t\t} else {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":["usePersist","useReferentiallyStableCallback","isErrorPersistResult"],"mappings":";;;;;AAUO,MAAM,sBAAsB,CAAC,EAAE,kBAAkB,eAAA,IAA+C,CAAA,MAAO;AAC7G,QAAM,iBAAiBA,WAAAA,WAAA;AAEvB,SAAOC,WAAAA,+BAA+B,YAAY;AACjD,QAAI;AACH,YAAM,SAAS,MAAM,eAAA;AACrB,yBAAmB,MAAM;AAAA,IAC1B,SAAS,GAAG;AACX,UAAIC,QAAAA,qBAAqB,CAAC,GAAG;AAC5B,yBAAiB,CAAC;AAAA,MACnB,OAAO;AACN,cAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD,CAAC;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDecoratedPersist.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/useDecoratedPersist.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport { usePersist } from '../../accessorPropagation'\nimport { ErrorPersistResult, isErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nexport interface UseDecoratedPersistOptions {\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\nexport const useDecoratedPersist = ({ onPersistSuccess, onPersistError }: UseDecoratedPersistOptions = {}) => {\n\tconst triggerPersist = usePersist()\n\n\treturn useReferentiallyStableCallback(async () => {\n\t\ttry {\n\t\t\tconst result = await triggerPersist()\n\t\t\tonPersistSuccess?.(result)\n\t\t} catch (e) {\n\t\t\tif (isErrorPersistResult(e)) {\n\t\t\t\tonPersistError?.(e)\n\t\t\t} else {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":[],"mappings":";;;AAUO,MAAM,sBAAsB,CAAC,EAAE,kBAAkB,eAAA,IAA+C,CAAA,MAAO;AAC7G,QAAM,iBAAiB,WAAA;AAEvB,SAAO,+BAA+B,YAAY;AACjD,QAAI;AACH,YAAM,SAAS,MAAM,eAAA;AACrB,yBAAmB,MAAM;AAAA,IAC1B,SAAS,GAAG;AACX,UAAI,qBAAqB,CAAC,GAAG;AAC5B,yBAAiB,CAAC;AAAA,MACnB,OAAO;AACN,cAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD,CAAC;AACF;"}
|
|
1
|
+
{"version":3,"file":"useDecoratedPersist.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/useDecoratedPersist.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport { usePersist } from '../../accessorPropagation/index.js'\nimport { ErrorPersistResult, isErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nexport interface UseDecoratedPersistOptions {\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\nexport const useDecoratedPersist = ({ onPersistSuccess, onPersistError }: UseDecoratedPersistOptions = {}) => {\n\tconst triggerPersist = usePersist()\n\n\treturn useReferentiallyStableCallback(async () => {\n\t\ttry {\n\t\t\tconst result = await triggerPersist()\n\t\t\tonPersistSuccess?.(result)\n\t\t} catch (e) {\n\t\t\tif (isErrorPersistResult(e)) {\n\t\t\t\tonPersistError?.(e)\n\t\t\t} else {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":[],"mappings":";;;AAUO,MAAM,sBAAsB,CAAC,EAAE,kBAAkB,eAAA,IAA+C,CAAA,MAAO;AAC7G,QAAM,iBAAiB,WAAA;AAEvB,SAAO,+BAA+B,YAAY;AACjD,QAAI;AACH,YAAM,SAAS,MAAM,eAAA;AACrB,yBAAmB,MAAM;AAAA,IAC1B,SAAS,GAAG;AACX,UAAI,qBAAqB,CAAC,GAAG;AAC5B,yBAAiB,CAAC;AAAA,MACnB,OAAO;AACN,cAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD,CAAC;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerStaticAnalyzer.cjs","sources":["../../../../../packages/react-binding/src/markers/MarkerStaticAnalyzer.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react'\nimport { BranchMarkerProvider, EnvironmentDeltaProvider, LeafMarkerProvider, StaticRenderProvider } from './MarkerProvider'\nimport {\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n} from '@contember/binding'\nimport { IncrementalMarkerBuilder } from './IncrementalMarkerBuilder'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerStaticAnalyzer {\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tenv: Environment,\n\t): EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer | undefined {\n\t\tconst markers = this.processNode(children, env, [])\n\t\tif (markers.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn IncrementalMarkerBuilder.build(markers)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tenv: Environment,\n\t\tcomponentPath: ReactElement[],\n\t): Markers[] {\n\t\tif (node === false || node === undefined || node === null || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\treturn []\n\t\t}\n\t\tif (typeof node === 'function') {\n\t\t\tthrow new ChildrenAnalyzerError(\n\t\t\t\t`Render props (functions as React component children) are not supported within the schema. `\n\t\t\t\t\t+ `You have likely used a bare custom component as opposed to wrapping in with \\`Component\\` `\n\t\t\t\t\t+ `from the \\`@contember/admin\\` package. Please refer to the documentation.`,\n\t\t\t)\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\treturn node.flatMap(subNode => this.processNode(subNode, env, componentPath))\n\t\t}\n\n\t\tif (typeof node !== 'object' || !('type' in node)) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst props = node.props as Record<string, any>\n\n\t\tif (typeof node.type === 'symbol' || typeof node.type === 'string') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(props.children, env, componentPath)\n\t\t}\n\n\t\tconst nodeDisplayName = 'displayName' in node.type ? (node.type.displayName as string) : '???'\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (componentPath.length > 1000) {\n\t\t\twrapError(new ChildrenAnalyzerError('Component path too long, likely a circular reference'), nodeDisplayName, '[NONE]', componentPath)\n\t\t}\n\n\t\ttry {\n\t\t\tif ('generateEnvironment' in node.type) {\n\t\t\t\tenv = (node.type as EnvironmentDeltaProvider).generateEnvironment(props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static context factory', componentPath)\n\t\t}\n\t\tif ('generateLeafMarker' in node.type) {\n\t\t\treturn [(node.type as LeafMarkerProvider).generateLeafMarker(props, env)]\n\t\t}\n\t\tlet children: ReactNode = props.children\n\t\ttry {\n\t\t\tif ('staticRender' in node.type) {\n\t\t\t\tchildren = (node.type as StaticRenderProvider).staticRender(props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static render', componentPath)\n\t\t}\n\t\tconst processedChildren = this.processNode(children, env, componentPath)\n\t\tif ('generateBranchMarker' in node.type) {\n\t\t\tconst marker = IncrementalMarkerBuilder.build(processedChildren)\n\t\t\treturn [(node.type as BranchMarkerProvider).generateBranchMarker(props, marker, env)]\n\t\t}\n\t\treturn processedChildren\n\t}\n}\n\nexport class ChildrenAnalyzerError extends Error {\n\tpublic details?: string\n\n\tconstructor(message: string, options?: { cause: Error; details?: string }) {\n\t\tsuper(message, options)\n\t\tthis.details = options?.details\n\t}\n}\n\nconst wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props as Record<string, any>\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn value\n\t\t\t\t\t})\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["IncrementalMarkerBuilder","props","key","value"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"MarkerStaticAnalyzer.cjs","sources":["../../../../../packages/react-binding/src/markers/MarkerStaticAnalyzer.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react'\nimport { BranchMarkerProvider, EnvironmentDeltaProvider, LeafMarkerProvider, StaticRenderProvider } from './MarkerProvider.js'\nimport {\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n} from '@contember/binding'\nimport { IncrementalMarkerBuilder } from './IncrementalMarkerBuilder.js'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerStaticAnalyzer {\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tenv: Environment,\n\t): EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer | undefined {\n\t\tconst markers = this.processNode(children, env, [])\n\t\tif (markers.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn IncrementalMarkerBuilder.build(markers)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tenv: Environment,\n\t\tcomponentPath: ReactElement[],\n\t): Markers[] {\n\t\tif (node === false || node === undefined || node === null || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\treturn []\n\t\t}\n\t\tif (typeof node === 'function') {\n\t\t\tthrow new ChildrenAnalyzerError(\n\t\t\t\t`Render props (functions as React component children) are not supported within the schema. `\n\t\t\t\t\t+ `You have likely used a bare custom component as opposed to wrapping in with \\`Component\\` `\n\t\t\t\t\t+ `from the \\`@contember/admin\\` package. Please refer to the documentation.`,\n\t\t\t)\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\treturn node.flatMap(subNode => this.processNode(subNode, env, componentPath))\n\t\t}\n\n\t\tif (typeof node !== 'object' || !('type' in node)) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst props = node.props as Record<string, any>\n\n\t\tif (typeof node.type === 'symbol' || typeof node.type === 'string') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(props.children, env, componentPath)\n\t\t}\n\n\t\tconst nodeDisplayName = 'displayName' in node.type ? (node.type.displayName as string) : '???'\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (componentPath.length > 1000) {\n\t\t\twrapError(new ChildrenAnalyzerError('Component path too long, likely a circular reference'), nodeDisplayName, '[NONE]', componentPath)\n\t\t}\n\n\t\ttry {\n\t\t\tif ('generateEnvironment' in node.type) {\n\t\t\t\tenv = (node.type as EnvironmentDeltaProvider).generateEnvironment(props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static context factory', componentPath)\n\t\t}\n\t\tif ('generateLeafMarker' in node.type) {\n\t\t\treturn [(node.type as LeafMarkerProvider).generateLeafMarker(props, env)]\n\t\t}\n\t\tlet children: ReactNode = props.children\n\t\ttry {\n\t\t\tif ('staticRender' in node.type) {\n\t\t\t\tchildren = (node.type as StaticRenderProvider).staticRender(props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static render', componentPath)\n\t\t}\n\t\tconst processedChildren = this.processNode(children, env, componentPath)\n\t\tif ('generateBranchMarker' in node.type) {\n\t\t\tconst marker = IncrementalMarkerBuilder.build(processedChildren)\n\t\t\treturn [(node.type as BranchMarkerProvider).generateBranchMarker(props, marker, env)]\n\t\t}\n\t\treturn processedChildren\n\t}\n}\n\nexport class ChildrenAnalyzerError extends Error {\n\tpublic details?: string\n\n\tconstructor(message: string, options?: { cause: Error; details?: string }) {\n\t\tsuper(message, options)\n\t\tthis.details = options?.details\n\t}\n}\n\nconst wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props as Record<string, any>\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn value\n\t\t\t\t\t})\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["IncrementalMarkerBuilder","props","key","value"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerStaticAnalyzer.js","sources":["../../../../../packages/react-binding/src/markers/MarkerStaticAnalyzer.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react'\nimport { BranchMarkerProvider, EnvironmentDeltaProvider, LeafMarkerProvider, StaticRenderProvider } from './MarkerProvider'\nimport {\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n} from '@contember/binding'\nimport { IncrementalMarkerBuilder } from './IncrementalMarkerBuilder'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerStaticAnalyzer {\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tenv: Environment,\n\t): EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer | undefined {\n\t\tconst markers = this.processNode(children, env, [])\n\t\tif (markers.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn IncrementalMarkerBuilder.build(markers)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tenv: Environment,\n\t\tcomponentPath: ReactElement[],\n\t): Markers[] {\n\t\tif (node === false || node === undefined || node === null || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\treturn []\n\t\t}\n\t\tif (typeof node === 'function') {\n\t\t\tthrow new ChildrenAnalyzerError(\n\t\t\t\t`Render props (functions as React component children) are not supported within the schema. `\n\t\t\t\t\t+ `You have likely used a bare custom component as opposed to wrapping in with \\`Component\\` `\n\t\t\t\t\t+ `from the \\`@contember/admin\\` package. Please refer to the documentation.`,\n\t\t\t)\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\treturn node.flatMap(subNode => this.processNode(subNode, env, componentPath))\n\t\t}\n\n\t\tif (typeof node !== 'object' || !('type' in node)) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst props = node.props as Record<string, any>\n\n\t\tif (typeof node.type === 'symbol' || typeof node.type === 'string') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(props.children, env, componentPath)\n\t\t}\n\n\t\tconst nodeDisplayName = 'displayName' in node.type ? (node.type.displayName as string) : '???'\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (componentPath.length > 1000) {\n\t\t\twrapError(new ChildrenAnalyzerError('Component path too long, likely a circular reference'), nodeDisplayName, '[NONE]', componentPath)\n\t\t}\n\n\t\ttry {\n\t\t\tif ('generateEnvironment' in node.type) {\n\t\t\t\tenv = (node.type as EnvironmentDeltaProvider).generateEnvironment(props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static context factory', componentPath)\n\t\t}\n\t\tif ('generateLeafMarker' in node.type) {\n\t\t\treturn [(node.type as LeafMarkerProvider).generateLeafMarker(props, env)]\n\t\t}\n\t\tlet children: ReactNode = props.children\n\t\ttry {\n\t\t\tif ('staticRender' in node.type) {\n\t\t\t\tchildren = (node.type as StaticRenderProvider).staticRender(props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static render', componentPath)\n\t\t}\n\t\tconst processedChildren = this.processNode(children, env, componentPath)\n\t\tif ('generateBranchMarker' in node.type) {\n\t\t\tconst marker = IncrementalMarkerBuilder.build(processedChildren)\n\t\t\treturn [(node.type as BranchMarkerProvider).generateBranchMarker(props, marker, env)]\n\t\t}\n\t\treturn processedChildren\n\t}\n}\n\nexport class ChildrenAnalyzerError extends Error {\n\tpublic details?: string\n\n\tconstructor(message: string, options?: { cause: Error; details?: string }) {\n\t\tsuper(message, options)\n\t\tthis.details = options?.details\n\t}\n}\n\nconst wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props as Record<string, any>\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn value\n\t\t\t\t\t})\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value","React"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"MarkerStaticAnalyzer.js","sources":["../../../../../packages/react-binding/src/markers/MarkerStaticAnalyzer.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react'\nimport { BranchMarkerProvider, EnvironmentDeltaProvider, LeafMarkerProvider, StaticRenderProvider } from './MarkerProvider.js'\nimport {\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n} from '@contember/binding'\nimport { IncrementalMarkerBuilder } from './IncrementalMarkerBuilder.js'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerStaticAnalyzer {\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tenv: Environment,\n\t): EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer | undefined {\n\t\tconst markers = this.processNode(children, env, [])\n\t\tif (markers.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn IncrementalMarkerBuilder.build(markers)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tenv: Environment,\n\t\tcomponentPath: ReactElement[],\n\t): Markers[] {\n\t\tif (node === false || node === undefined || node === null || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\treturn []\n\t\t}\n\t\tif (typeof node === 'function') {\n\t\t\tthrow new ChildrenAnalyzerError(\n\t\t\t\t`Render props (functions as React component children) are not supported within the schema. `\n\t\t\t\t\t+ `You have likely used a bare custom component as opposed to wrapping in with \\`Component\\` `\n\t\t\t\t\t+ `from the \\`@contember/admin\\` package. Please refer to the documentation.`,\n\t\t\t)\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\treturn node.flatMap(subNode => this.processNode(subNode, env, componentPath))\n\t\t}\n\n\t\tif (typeof node !== 'object' || !('type' in node)) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst props = node.props as Record<string, any>\n\n\t\tif (typeof node.type === 'symbol' || typeof node.type === 'string') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(props.children, env, componentPath)\n\t\t}\n\n\t\tconst nodeDisplayName = 'displayName' in node.type ? (node.type.displayName as string) : '???'\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (componentPath.length > 1000) {\n\t\t\twrapError(new ChildrenAnalyzerError('Component path too long, likely a circular reference'), nodeDisplayName, '[NONE]', componentPath)\n\t\t}\n\n\t\ttry {\n\t\t\tif ('generateEnvironment' in node.type) {\n\t\t\t\tenv = (node.type as EnvironmentDeltaProvider).generateEnvironment(props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static context factory', componentPath)\n\t\t}\n\t\tif ('generateLeafMarker' in node.type) {\n\t\t\treturn [(node.type as LeafMarkerProvider).generateLeafMarker(props, env)]\n\t\t}\n\t\tlet children: ReactNode = props.children\n\t\ttry {\n\t\t\tif ('staticRender' in node.type) {\n\t\t\t\tchildren = (node.type as StaticRenderProvider).staticRender(props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static render', componentPath)\n\t\t}\n\t\tconst processedChildren = this.processNode(children, env, componentPath)\n\t\tif ('generateBranchMarker' in node.type) {\n\t\t\tconst marker = IncrementalMarkerBuilder.build(processedChildren)\n\t\t\treturn [(node.type as BranchMarkerProvider).generateBranchMarker(props, marker, env)]\n\t\t}\n\t\treturn processedChildren\n\t}\n}\n\nexport class ChildrenAnalyzerError extends Error {\n\tpublic details?: string\n\n\tconstructor(message: string, options?: { cause: Error; details?: string }) {\n\t\tsuper(message, options)\n\t\tthis.details = options?.details\n\t}\n}\n\nconst wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props as Record<string, any>\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn value\n\t\t\t\t\t})\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value","React"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerTreeGenerator.cjs","sources":["../../../../../packages/react-binding/src/markers/MarkerTreeGenerator.ts"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Alias } from '@contember/binding'\nimport {\n\tBindingError,\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEntityListSubTreeMarker,\n\tEntitySubTreeMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n\tMarkerTreeRoot,\n} from '@contember/binding'\nimport { MarkerStaticAnalyzer } from './MarkerStaticAnalyzer'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerTreeGenerator {\n\tpublic constructor(private sourceTree: ReactNode, private environment: Environment = Environment.create()) {}\n\n\tpublic generate(): MarkerTreeRoot {\n\t\tconst analyzer = new MarkerStaticAnalyzer()\n\t\tconst collectedMarkers = analyzer.processChildren(this.sourceTree, this.environment)\n\t\tif (collectedMarkers === undefined) {\n\t\t\treturn new MarkerTreeRoot(new Map(), new Map())\n\t\t}\n\n\t\tif (collectedMarkers instanceof EntityFieldMarkersContainer) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.fields.markers.size) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.parentReference !== undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.subTrees === undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\n\t\tconst subTrees = collectedMarkers.subTrees\n\n\t\treturn new MarkerTreeRoot(subTrees, this.generatePlaceholdersByAliases(subTrees))\n\t}\n\n\tprivate generatePlaceholdersByAliases(\n\t\thoistedSubTrees: ReadonlyMap<string, EntitySubTreeMarker | EntityListSubTreeMarker>,\n\t): Map<Alias, string> {\n\t\tconst placeholders = new Map<Alias, string>()\n\n\t\tfor (const [placeholderName, subTree] of hoistedSubTrees) {\n\t\t\tconst aliases = subTree.parameters.alias\n\t\t\tif (aliases === undefined || aliases.size === 0) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor (const alias of aliases) {\n\t\t\t\tconst existingPlaceholder = placeholders.get(alias)\n\t\t\t\tif (existingPlaceholder !== undefined) {\n\t\t\t\t\tif (existingPlaceholder === placeholderName) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`Detected the same sub-tree alias '${alias}' referring to sub-trees with different parameters!`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tplaceholders.set(alias, placeholderName)\n\t\t\t}\n\t\t}\n\n\t\treturn placeholders\n\t}\n}\n"],"names":["Environment","MarkerStaticAnalyzer","MarkerTreeRoot","EntityFieldMarkersContainer","BindingError"],"mappings":";;;;AAkBO,MAAM,oBAAoB;AAAA,EACzB,YAAoB,YAA+B,cAA2BA,QAAAA,YAAY,UAAU;AAAhF,SAAA,aAAA;AAA+B,SAAA,cAAA;AAAA,EAAkD;AAAA,EAErG,WAA2B;AACjC,UAAM,WAAW,IAAIC,0CAAA;AACrB,UAAM,mBAAmB,SAAS,gBAAgB,KAAK,YAAY,KAAK,WAAW;AACnF,QAAI,qBAAqB,QAAW;AACnC,aAAO,IAAIC,QAAAA,eAAe,oBAAI,OAAO,oBAAI,KAAK;AAAA,IAC/C;AAEA,QAAI,4BAA4BC,QAAAA,6BAA6B;AAC5D,YAAM,IAAIC,QAAAA,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,OAAO,QAAQ,MAAM;AACzC,YAAM,IAAIA,QAAAA,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,oBAAoB,QAAW;AACnD,YAAM,IAAIA,QAAAA,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,aAAa,QAAW;AAC5C,YAAM,IAAIA,QAAAA,aAAA;AAAA,IACX;AAEA,UAAM,WAAW,iBAAiB;AAElC,WAAO,IAAIF,QAAAA,eAAe,UAAU,KAAK,8BAA8B,QAAQ,CAAC;AAAA,EACjF;AAAA,EAEQ,8BACP,iBACqB;AACrB,UAAM,mCAAmB,IAAA;AAEzB,eAAW,CAAC,iBAAiB,OAAO,KAAK,iBAAiB;AACzD,YAAM,UAAU,QAAQ,WAAW;AACnC,UAAI,YAAY,UAAa,QAAQ,SAAS,GAAG;AAChD;AAAA,MACD;AACA,iBAAW,SAAS,SAAS;AAC5B,cAAM,sBAAsB,aAAa,IAAI,KAAK;AAClD,YAAI,wBAAwB,QAAW;AACtC,cAAI,wBAAwB,iBAAiB;AAC5C;AAAA,UACD;AACA,gBAAM,IAAIE,QAAAA;AAAAA,YACT,qCAAqC,KAAK;AAAA,UAAA;AAAA,QAE5C;AACA,qBAAa,IAAI,OAAO,eAAe;AAAA,MACxC;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;;"}
|
|
1
|
+
{"version":3,"file":"MarkerTreeGenerator.cjs","sources":["../../../../../packages/react-binding/src/markers/MarkerTreeGenerator.ts"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Alias } from '@contember/binding'\nimport {\n\tBindingError,\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEntityListSubTreeMarker,\n\tEntitySubTreeMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n\tMarkerTreeRoot,\n} from '@contember/binding'\nimport { MarkerStaticAnalyzer } from './MarkerStaticAnalyzer.js'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerTreeGenerator {\n\tpublic constructor(private sourceTree: ReactNode, private environment: Environment = Environment.create()) {}\n\n\tpublic generate(): MarkerTreeRoot {\n\t\tconst analyzer = new MarkerStaticAnalyzer()\n\t\tconst collectedMarkers = analyzer.processChildren(this.sourceTree, this.environment)\n\t\tif (collectedMarkers === undefined) {\n\t\t\treturn new MarkerTreeRoot(new Map(), new Map())\n\t\t}\n\n\t\tif (collectedMarkers instanceof EntityFieldMarkersContainer) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.fields.markers.size) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.parentReference !== undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.subTrees === undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\n\t\tconst subTrees = collectedMarkers.subTrees\n\n\t\treturn new MarkerTreeRoot(subTrees, this.generatePlaceholdersByAliases(subTrees))\n\t}\n\n\tprivate generatePlaceholdersByAliases(\n\t\thoistedSubTrees: ReadonlyMap<string, EntitySubTreeMarker | EntityListSubTreeMarker>,\n\t): Map<Alias, string> {\n\t\tconst placeholders = new Map<Alias, string>()\n\n\t\tfor (const [placeholderName, subTree] of hoistedSubTrees) {\n\t\t\tconst aliases = subTree.parameters.alias\n\t\t\tif (aliases === undefined || aliases.size === 0) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor (const alias of aliases) {\n\t\t\t\tconst existingPlaceholder = placeholders.get(alias)\n\t\t\t\tif (existingPlaceholder !== undefined) {\n\t\t\t\t\tif (existingPlaceholder === placeholderName) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`Detected the same sub-tree alias '${alias}' referring to sub-trees with different parameters!`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tplaceholders.set(alias, placeholderName)\n\t\t\t}\n\t\t}\n\n\t\treturn placeholders\n\t}\n}\n"],"names":["Environment","MarkerStaticAnalyzer","MarkerTreeRoot","EntityFieldMarkersContainer","BindingError"],"mappings":";;;;AAkBO,MAAM,oBAAoB;AAAA,EACzB,YAAoB,YAA+B,cAA2BA,QAAAA,YAAY,UAAU;AAAhF,SAAA,aAAA;AAA+B,SAAA,cAAA;AAAA,EAAkD;AAAA,EAErG,WAA2B;AACjC,UAAM,WAAW,IAAIC,0CAAA;AACrB,UAAM,mBAAmB,SAAS,gBAAgB,KAAK,YAAY,KAAK,WAAW;AACnF,QAAI,qBAAqB,QAAW;AACnC,aAAO,IAAIC,QAAAA,eAAe,oBAAI,OAAO,oBAAI,KAAK;AAAA,IAC/C;AAEA,QAAI,4BAA4BC,QAAAA,6BAA6B;AAC5D,YAAM,IAAIC,QAAAA,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,OAAO,QAAQ,MAAM;AACzC,YAAM,IAAIA,QAAAA,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,oBAAoB,QAAW;AACnD,YAAM,IAAIA,QAAAA,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,aAAa,QAAW;AAC5C,YAAM,IAAIA,QAAAA,aAAA;AAAA,IACX;AAEA,UAAM,WAAW,iBAAiB;AAElC,WAAO,IAAIF,QAAAA,eAAe,UAAU,KAAK,8BAA8B,QAAQ,CAAC;AAAA,EACjF;AAAA,EAEQ,8BACP,iBACqB;AACrB,UAAM,mCAAmB,IAAA;AAEzB,eAAW,CAAC,iBAAiB,OAAO,KAAK,iBAAiB;AACzD,YAAM,UAAU,QAAQ,WAAW;AACnC,UAAI,YAAY,UAAa,QAAQ,SAAS,GAAG;AAChD;AAAA,MACD;AACA,iBAAW,SAAS,SAAS;AAC5B,cAAM,sBAAsB,aAAa,IAAI,KAAK;AAClD,YAAI,wBAAwB,QAAW;AACtC,cAAI,wBAAwB,iBAAiB;AAC5C;AAAA,UACD;AACA,gBAAM,IAAIE,QAAAA;AAAAA,YACT,qCAAqC,KAAK;AAAA,UAAA;AAAA,QAE5C;AACA,qBAAa,IAAI,OAAO,eAAe;AAAA,MACxC;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerTreeGenerator.js","sources":["../../../../../packages/react-binding/src/markers/MarkerTreeGenerator.ts"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Alias } from '@contember/binding'\nimport {\n\tBindingError,\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEntityListSubTreeMarker,\n\tEntitySubTreeMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n\tMarkerTreeRoot,\n} from '@contember/binding'\nimport { MarkerStaticAnalyzer } from './MarkerStaticAnalyzer'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerTreeGenerator {\n\tpublic constructor(private sourceTree: ReactNode, private environment: Environment = Environment.create()) {}\n\n\tpublic generate(): MarkerTreeRoot {\n\t\tconst analyzer = new MarkerStaticAnalyzer()\n\t\tconst collectedMarkers = analyzer.processChildren(this.sourceTree, this.environment)\n\t\tif (collectedMarkers === undefined) {\n\t\t\treturn new MarkerTreeRoot(new Map(), new Map())\n\t\t}\n\n\t\tif (collectedMarkers instanceof EntityFieldMarkersContainer) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.fields.markers.size) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.parentReference !== undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.subTrees === undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\n\t\tconst subTrees = collectedMarkers.subTrees\n\n\t\treturn new MarkerTreeRoot(subTrees, this.generatePlaceholdersByAliases(subTrees))\n\t}\n\n\tprivate generatePlaceholdersByAliases(\n\t\thoistedSubTrees: ReadonlyMap<string, EntitySubTreeMarker | EntityListSubTreeMarker>,\n\t): Map<Alias, string> {\n\t\tconst placeholders = new Map<Alias, string>()\n\n\t\tfor (const [placeholderName, subTree] of hoistedSubTrees) {\n\t\t\tconst aliases = subTree.parameters.alias\n\t\t\tif (aliases === undefined || aliases.size === 0) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor (const alias of aliases) {\n\t\t\t\tconst existingPlaceholder = placeholders.get(alias)\n\t\t\t\tif (existingPlaceholder !== undefined) {\n\t\t\t\t\tif (existingPlaceholder === placeholderName) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`Detected the same sub-tree alias '${alias}' referring to sub-trees with different parameters!`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tplaceholders.set(alias, placeholderName)\n\t\t\t}\n\t\t}\n\n\t\treturn placeholders\n\t}\n}\n"],"names":[],"mappings":";;AAkBO,MAAM,oBAAoB;AAAA,EACzB,YAAoB,YAA+B,cAA2B,YAAY,UAAU;AAAhF,SAAA,aAAA;AAA+B,SAAA,cAAA;AAAA,EAAkD;AAAA,EAErG,WAA2B;AACjC,UAAM,WAAW,IAAI,qBAAA;AACrB,UAAM,mBAAmB,SAAS,gBAAgB,KAAK,YAAY,KAAK,WAAW;AACnF,QAAI,qBAAqB,QAAW;AACnC,aAAO,IAAI,eAAe,oBAAI,OAAO,oBAAI,KAAK;AAAA,IAC/C;AAEA,QAAI,4BAA4B,6BAA6B;AAC5D,YAAM,IAAI,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,OAAO,QAAQ,MAAM;AACzC,YAAM,IAAI,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,oBAAoB,QAAW;AACnD,YAAM,IAAI,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,aAAa,QAAW;AAC5C,YAAM,IAAI,aAAA;AAAA,IACX;AAEA,UAAM,WAAW,iBAAiB;AAElC,WAAO,IAAI,eAAe,UAAU,KAAK,8BAA8B,QAAQ,CAAC;AAAA,EACjF;AAAA,EAEQ,8BACP,iBACqB;AACrB,UAAM,mCAAmB,IAAA;AAEzB,eAAW,CAAC,iBAAiB,OAAO,KAAK,iBAAiB;AACzD,YAAM,UAAU,QAAQ,WAAW;AACnC,UAAI,YAAY,UAAa,QAAQ,SAAS,GAAG;AAChD;AAAA,MACD;AACA,iBAAW,SAAS,SAAS;AAC5B,cAAM,sBAAsB,aAAa,IAAI,KAAK;AAClD,YAAI,wBAAwB,QAAW;AACtC,cAAI,wBAAwB,iBAAiB;AAC5C;AAAA,UACD;AACA,gBAAM,IAAI;AAAA,YACT,qCAAqC,KAAK;AAAA,UAAA;AAAA,QAE5C;AACA,qBAAa,IAAI,OAAO,eAAe;AAAA,MACxC;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;"}
|
|
1
|
+
{"version":3,"file":"MarkerTreeGenerator.js","sources":["../../../../../packages/react-binding/src/markers/MarkerTreeGenerator.ts"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Alias } from '@contember/binding'\nimport {\n\tBindingError,\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEntityListSubTreeMarker,\n\tEntitySubTreeMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n\tMarkerTreeRoot,\n} from '@contember/binding'\nimport { MarkerStaticAnalyzer } from './MarkerStaticAnalyzer.js'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerTreeGenerator {\n\tpublic constructor(private sourceTree: ReactNode, private environment: Environment = Environment.create()) {}\n\n\tpublic generate(): MarkerTreeRoot {\n\t\tconst analyzer = new MarkerStaticAnalyzer()\n\t\tconst collectedMarkers = analyzer.processChildren(this.sourceTree, this.environment)\n\t\tif (collectedMarkers === undefined) {\n\t\t\treturn new MarkerTreeRoot(new Map(), new Map())\n\t\t}\n\n\t\tif (collectedMarkers instanceof EntityFieldMarkersContainer) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.fields.markers.size) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.parentReference !== undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tif (collectedMarkers.subTrees === undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\n\t\tconst subTrees = collectedMarkers.subTrees\n\n\t\treturn new MarkerTreeRoot(subTrees, this.generatePlaceholdersByAliases(subTrees))\n\t}\n\n\tprivate generatePlaceholdersByAliases(\n\t\thoistedSubTrees: ReadonlyMap<string, EntitySubTreeMarker | EntityListSubTreeMarker>,\n\t): Map<Alias, string> {\n\t\tconst placeholders = new Map<Alias, string>()\n\n\t\tfor (const [placeholderName, subTree] of hoistedSubTrees) {\n\t\t\tconst aliases = subTree.parameters.alias\n\t\t\tif (aliases === undefined || aliases.size === 0) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor (const alias of aliases) {\n\t\t\t\tconst existingPlaceholder = placeholders.get(alias)\n\t\t\t\tif (existingPlaceholder !== undefined) {\n\t\t\t\t\tif (existingPlaceholder === placeholderName) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`Detected the same sub-tree alias '${alias}' referring to sub-trees with different parameters!`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tplaceholders.set(alias, placeholderName)\n\t\t\t}\n\t\t}\n\n\t\treturn placeholders\n\t}\n}\n"],"names":[],"mappings":";;AAkBO,MAAM,oBAAoB;AAAA,EACzB,YAAoB,YAA+B,cAA2B,YAAY,UAAU;AAAhF,SAAA,aAAA;AAA+B,SAAA,cAAA;AAAA,EAAkD;AAAA,EAErG,WAA2B;AACjC,UAAM,WAAW,IAAI,qBAAA;AACrB,UAAM,mBAAmB,SAAS,gBAAgB,KAAK,YAAY,KAAK,WAAW;AACnF,QAAI,qBAAqB,QAAW;AACnC,aAAO,IAAI,eAAe,oBAAI,OAAO,oBAAI,KAAK;AAAA,IAC/C;AAEA,QAAI,4BAA4B,6BAA6B;AAC5D,YAAM,IAAI,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,OAAO,QAAQ,MAAM;AACzC,YAAM,IAAI,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,oBAAoB,QAAW;AACnD,YAAM,IAAI,aAAA;AAAA,IACX;AACA,QAAI,iBAAiB,aAAa,QAAW;AAC5C,YAAM,IAAI,aAAA;AAAA,IACX;AAEA,UAAM,WAAW,iBAAiB;AAElC,WAAO,IAAI,eAAe,UAAU,KAAK,8BAA8B,QAAQ,CAAC;AAAA,EACjF;AAAA,EAEQ,8BACP,iBACqB;AACrB,UAAM,mCAAmB,IAAA;AAEzB,eAAW,CAAC,iBAAiB,OAAO,KAAK,iBAAiB;AACzD,YAAM,UAAU,QAAQ,WAAW;AACnC,UAAI,YAAY,UAAa,QAAQ,SAAS,GAAG;AAChD;AAAA,MACD;AACA,iBAAW,SAAS,SAAS;AAC5B,cAAM,sBAAsB,aAAa,IAAI,KAAK;AAClD,YAAI,wBAAwB,QAAW;AACtC,cAAI,wBAAwB,iBAAiB;AAC5C;AAAA,UACD;AACA,gBAAM,IAAI;AAAA,YACT,qCAAqC,KAAK;AAAA,UAAA;AAAA,QAE5C;AACA,qBAAa,IAAI,OAAO,eAAe;AAAA,MACxC;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorProvider.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/AccessorProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext'\nimport { EnvironmentContext } from './EnvironmentContext'\n\nexport interface EntityProviderProps {\n\taccessor: EntityAccessor\n\tchildren: ReactNode\n}\n\nexport function AccessorProvider(props: EntityProviderProps) {\n\treturn (\n\t\t<EntityKeyContext.Provider value={props.accessor.key ?? props.accessor.getAccessor}>\n\t\t\t<EnvironmentContext.Provider value={props.accessor.environment}>{props.children}</EnvironmentContext.Provider>\n\t\t</EntityKeyContext.Provider>\n\t)\n}\n"],"names":["jsx","EntityKeyContext","EnvironmentContext"],"mappings":";;;;;AAUO,SAAS,iBAAiB,OAA4B;AAC5D,SACCA,+BAACC,iBAAAA,iBAAiB,UAAjB,EAA0B,OAAO,MAAM,SAAS,OAAO,MAAM,SAAS,aACtE,UAAAD,2BAAAA,IAACE,sCAAmB,UAAnB,EAA4B,OAAO,MAAM,SAAS,aAAc,UAAA,MAAM,SAAA,CAAS,EAAA,CACjF;AAEF;;"}
|
|
1
|
+
{"version":3,"file":"AccessorProvider.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/AccessorProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext.js'\nimport { EnvironmentContext } from './EnvironmentContext.js'\n\nexport interface EntityProviderProps {\n\taccessor: EntityAccessor\n\tchildren: ReactNode\n}\n\nexport function AccessorProvider(props: EntityProviderProps) {\n\treturn (\n\t\t<EntityKeyContext.Provider value={props.accessor.key ?? props.accessor.getAccessor}>\n\t\t\t<EnvironmentContext.Provider value={props.accessor.environment}>{props.children}</EnvironmentContext.Provider>\n\t\t</EntityKeyContext.Provider>\n\t)\n}\n"],"names":["jsx","EntityKeyContext","EnvironmentContext"],"mappings":";;;;;AAUO,SAAS,iBAAiB,OAA4B;AAC5D,SACCA,+BAACC,iBAAAA,iBAAiB,UAAjB,EAA0B,OAAO,MAAM,SAAS,OAAO,MAAM,SAAS,aACtE,UAAAD,2BAAAA,IAACE,sCAAmB,UAAnB,EAA4B,OAAO,MAAM,SAAS,aAAc,UAAA,MAAM,SAAA,CAAS,EAAA,CACjF;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorProvider.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/AccessorProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext'\nimport { EnvironmentContext } from './EnvironmentContext'\n\nexport interface EntityProviderProps {\n\taccessor: EntityAccessor\n\tchildren: ReactNode\n}\n\nexport function AccessorProvider(props: EntityProviderProps) {\n\treturn (\n\t\t<EntityKeyContext.Provider value={props.accessor.key ?? props.accessor.getAccessor}>\n\t\t\t<EnvironmentContext.Provider value={props.accessor.environment}>{props.children}</EnvironmentContext.Provider>\n\t\t</EntityKeyContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;;AAUO,SAAS,iBAAiB,OAA4B;AAC5D,SACC,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,MAAM,SAAS,OAAO,MAAM,SAAS,aACtE,UAAA,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,SAAS,aAAc,UAAA,MAAM,SAAA,CAAS,EAAA,CACjF;AAEF;"}
|
|
1
|
+
{"version":3,"file":"AccessorProvider.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/AccessorProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext.js'\nimport { EnvironmentContext } from './EnvironmentContext.js'\n\nexport interface EntityProviderProps {\n\taccessor: EntityAccessor\n\tchildren: ReactNode\n}\n\nexport function AccessorProvider(props: EntityProviderProps) {\n\treturn (\n\t\t<EntityKeyContext.Provider value={props.accessor.key ?? props.accessor.getAccessor}>\n\t\t\t<EnvironmentContext.Provider value={props.accessor.environment}>{props.children}</EnvironmentContext.Provider>\n\t\t</EntityKeyContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;;AAUO,SAAS,iBAAiB,OAA4B;AAC5D,SACC,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,MAAM,SAAS,OAAO,MAAM,SAAS,aACtE,UAAA,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,SAAS,aAAc,UAAA,MAAM,SAAA,CAAS,EAAA,CACjF;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindingOperationsProvider.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/BindingOperationsProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingOperationsContext, defaultBindingOperations } from './BindingOperationsContext'\n\nexport interface BindingOperationsProviderProps {\n\tbindingOperations: BindingOperations<ReactNode> | undefined\n\tchildren: ReactNode\n}\n\nexport function BindingOperationsProvider(props: BindingOperationsProviderProps) {\n\treturn (\n\t\t<BindingOperationsContext.Provider value={props.bindingOperations || defaultBindingOperations}>\n\t\t\t{props.children}\n\t\t</BindingOperationsContext.Provider>\n\t)\n}\n"],"names":["jsx","BindingOperationsContext","defaultBindingOperations"],"mappings":";;;;AASO,SAAS,0BAA0B,OAAuC;AAChF,SACCA,+BAACC,yBAAAA,yBAAyB,UAAzB,EAAkC,OAAO,MAAM,qBAAqBC,mDACnE,UAAA,MAAM,SAAA,CACR;AAEF;;"}
|
|
1
|
+
{"version":3,"file":"BindingOperationsProvider.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/BindingOperationsProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingOperationsContext, defaultBindingOperations } from './BindingOperationsContext.js'\n\nexport interface BindingOperationsProviderProps {\n\tbindingOperations: BindingOperations<ReactNode> | undefined\n\tchildren: ReactNode\n}\n\nexport function BindingOperationsProvider(props: BindingOperationsProviderProps) {\n\treturn (\n\t\t<BindingOperationsContext.Provider value={props.bindingOperations || defaultBindingOperations}>\n\t\t\t{props.children}\n\t\t</BindingOperationsContext.Provider>\n\t)\n}\n"],"names":["jsx","BindingOperationsContext","defaultBindingOperations"],"mappings":";;;;AASO,SAAS,0BAA0B,OAAuC;AAChF,SACCA,+BAACC,yBAAAA,yBAAyB,UAAzB,EAAkC,OAAO,MAAM,qBAAqBC,mDACnE,UAAA,MAAM,SAAA,CACR;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindingOperationsProvider.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/BindingOperationsProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingOperationsContext, defaultBindingOperations } from './BindingOperationsContext'\n\nexport interface BindingOperationsProviderProps {\n\tbindingOperations: BindingOperations<ReactNode> | undefined\n\tchildren: ReactNode\n}\n\nexport function BindingOperationsProvider(props: BindingOperationsProviderProps) {\n\treturn (\n\t\t<BindingOperationsContext.Provider value={props.bindingOperations || defaultBindingOperations}>\n\t\t\t{props.children}\n\t\t</BindingOperationsContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;AASO,SAAS,0BAA0B,OAAuC;AAChF,SACC,oBAAC,yBAAyB,UAAzB,EAAkC,OAAO,MAAM,qBAAqB,0BACnE,UAAA,MAAM,SAAA,CACR;AAEF;"}
|
|
1
|
+
{"version":3,"file":"BindingOperationsProvider.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/BindingOperationsProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingOperationsContext, defaultBindingOperations } from './BindingOperationsContext.js'\n\nexport interface BindingOperationsProviderProps {\n\tbindingOperations: BindingOperations<ReactNode> | undefined\n\tchildren: ReactNode\n}\n\nexport function BindingOperationsProvider(props: BindingOperationsProviderProps) {\n\treturn (\n\t\t<BindingOperationsContext.Provider value={props.bindingOperations || defaultBindingOperations}>\n\t\t\t{props.children}\n\t\t</BindingOperationsContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;AASO,SAAS,0BAA0B,OAAuC;AAChF,SACC,oBAAC,yBAAyB,UAAzB,EAAkC,OAAO,MAAM,qBAAqB,0BACnE,UAAA,MAAM,SAAA,CACR;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityKeyProvider.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/EntityKeyProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\nimport { EntityAccessor } from '@contember/binding'\n\nexport interface EntityKeyProviderProps {\n\tentityKey: string | (() => EntityAccessor)\n\tchildren: ReactNode\n}\n\nexport function EntityKeyProvider(props: EntityKeyProviderProps) {\n\treturn <EntityKeyContext.Provider value={props.entityKey}>{props.children}</EntityKeyContext.Provider>\n}\n"],"names":["jsx","EntityKeyContext"],"mappings":";;;;AASO,SAAS,kBAAkB,OAA+B;AAChE,SAAOA,+BAACC,iBAAAA,iBAAiB,UAAjB,EAA0B,OAAO,MAAM,WAAY,gBAAM,UAAS;AAC3E;;"}
|
|
1
|
+
{"version":3,"file":"EntityKeyProvider.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/EntityKeyProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext.js'\nimport { EntityAccessor } from '@contember/binding'\n\nexport interface EntityKeyProviderProps {\n\tentityKey: string | (() => EntityAccessor)\n\tchildren: ReactNode\n}\n\nexport function EntityKeyProvider(props: EntityKeyProviderProps) {\n\treturn <EntityKeyContext.Provider value={props.entityKey}>{props.children}</EntityKeyContext.Provider>\n}\n"],"names":["jsx","EntityKeyContext"],"mappings":";;;;AASO,SAAS,kBAAkB,OAA+B;AAChE,SAAOA,+BAACC,iBAAAA,iBAAiB,UAAjB,EAA0B,OAAO,MAAM,WAAY,gBAAM,UAAS;AAC3E;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityKeyProvider.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/EntityKeyProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\nimport { EntityAccessor } from '@contember/binding'\n\nexport interface EntityKeyProviderProps {\n\tentityKey: string | (() => EntityAccessor)\n\tchildren: ReactNode\n}\n\nexport function EntityKeyProvider(props: EntityKeyProviderProps) {\n\treturn <EntityKeyContext.Provider value={props.entityKey}>{props.children}</EntityKeyContext.Provider>\n}\n"],"names":[],"mappings":";;AASO,SAAS,kBAAkB,OAA+B;AAChE,SAAO,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,MAAM,WAAY,gBAAM,UAAS;AAC3E;"}
|
|
1
|
+
{"version":3,"file":"EntityKeyProvider.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/EntityKeyProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext.js'\nimport { EntityAccessor } from '@contember/binding'\n\nexport interface EntityKeyProviderProps {\n\tentityKey: string | (() => EntityAccessor)\n\tchildren: ReactNode\n}\n\nexport function EntityKeyProvider(props: EntityKeyProviderProps) {\n\treturn <EntityKeyContext.Provider value={props.entityKey}>{props.children}</EntityKeyContext.Provider>\n}\n"],"names":[],"mappings":";;AASO,SAAS,kBAAkB,OAA+B;AAChE,SAAO,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,MAAM,WAAY,gBAAM,UAAS;AAC3E;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentContext.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useCallback, useMemo } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\nimport { Component } from '../coreComponents'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n\nexport interface EnvironmentMiddlewareProps<T extends unknown[]> {\n\tchildren: ReactNode\n\tcreate: (env: Environment, args: T) => Environment\n\targs?: T\n}\n\nexport const EnvironmentMiddleware = Component<EnvironmentMiddlewareProps<unknown[]>>(\n\t({ children, create, args }) => {\n\t\tconst env = useEnvironment()\n\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\t\tconst envWithExtension = useMemo(\n\t\t\t() => create(env, args ?? []),\n\t\t\t[env, create, ...(args ?? [])],\n\t\t)\n\n\t\treturn <EnvironmentContext.Provider value={envWithExtension}>{children}</EnvironmentContext.Provider>\n\t},\n\t{\n\t\tstaticRender: ({ children }) => {\n\t\t\treturn <>{children}</>\n\t\t},\n\t\tgenerateEnvironment: ({ create, args }, env) => {\n\t\t\treturn create(env, args ?? [])\n\t\t},\n\t},\n) as <T extends unknown[]>(props: EnvironmentMiddlewareProps<T>) => ReactNode\n\nexport interface EnvironmentWithExtensionProps<S, R> {\n\tchildren: ReactNode\n\textension: Environment.Extension<S, R>\n\tstate: S\n}\n\nexport const EnvironmentExtensionProvider: <S, R>(props: EnvironmentWithExtensionProps<S, R>) => ReactNode = Component(\n\t({ children, extension, state }) => {\n\t\tconst create = useCallback((env: Environment) => env.withExtension(extension, state), [extension, state])\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n\t({ children, extension, state }) => {\n\t\tconst create = (env: Environment) => env.withExtension(extension, state)\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n)\n"],"names":["createContext","Environment","Component","useEnvironment","useMemo","useCallback","jsx"],"mappings":";;;;;;;AAKO,MAAM,qBAAqBA,MAAAA,cAA2BC,QAAAA,YAAY,OAAA,CAAQ;AACjF,mBAAmB,cAAc;AAQ1B,MAAM,wBAAwBC,UAAAA;AAAAA,EACpC,CAAC,EAAE,UAAU,QAAQ,WAAW;AAC/B,UAAM,MAAMC,eAAAA,eAAA;AAEZ,UAAM,mBAAmBC,MAAAA;AAAAA,MACxB,MAAM,OAAO,KAAK,QAAQ,EAAE;AAAA,MAC5B,CAAC,KAAK,QAAQ,GAAI,QAAQ,CAAA,CAAG;AAAA,IAAA;AAG9B,0CAAQ,mBAAmB,UAAnB,EAA4B,OAAO,kBAAmB,UAAS;AAAA,EACxE;AAAA,EACA;AAAA,IACC,cAAc,CAAC,EAAE,eAAe;AAC/B,mEAAU,UAAS;AAAA,IACpB;AAAA,IACA,qBAAqB,CAAC,EAAE,QAAQ,KAAA,GAAQ,QAAQ;AAC/C,aAAO,OAAO,KAAK,QAAQ,EAAE;AAAA,IAC9B;AAAA,EAAA;AAEF;AAQO,MAAM,+BAAgGF,UAAAA;AAAAA,EAC5G,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAASG,MAAAA,YAAY,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK,GAAG,CAAC,WAAW,KAAK,CAAC;AACxG,WAAOC,2BAAAA,IAAC,uBAAA,EAAsB,QAAiB,SAAA,CAAS;AAAA,EACzD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK;AACvE,WAAOA,2BAAAA,IAAC,uBAAA,EAAsB,QAAiB,SAAA,CAAS;AAAA,EACzD;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"EnvironmentContext.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useCallback, useMemo } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment.js'\nimport { Component } from '../coreComponents/index.js'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n\nexport interface EnvironmentMiddlewareProps<T extends unknown[]> {\n\tchildren: ReactNode\n\tcreate: (env: Environment, args: T) => Environment\n\targs?: T\n}\n\nexport const EnvironmentMiddleware = Component<EnvironmentMiddlewareProps<unknown[]>>(\n\t({ children, create, args }) => {\n\t\tconst env = useEnvironment()\n\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\t\tconst envWithExtension = useMemo(\n\t\t\t() => create(env, args ?? []),\n\t\t\t[env, create, ...(args ?? [])],\n\t\t)\n\n\t\treturn <EnvironmentContext.Provider value={envWithExtension}>{children}</EnvironmentContext.Provider>\n\t},\n\t{\n\t\tstaticRender: ({ children }) => {\n\t\t\treturn <>{children}</>\n\t\t},\n\t\tgenerateEnvironment: ({ create, args }, env) => {\n\t\t\treturn create(env, args ?? [])\n\t\t},\n\t},\n) as <T extends unknown[]>(props: EnvironmentMiddlewareProps<T>) => ReactNode\n\nexport interface EnvironmentWithExtensionProps<S, R> {\n\tchildren: ReactNode\n\textension: Environment.Extension<S, R>\n\tstate: S\n}\n\nexport const EnvironmentExtensionProvider: <S, R>(props: EnvironmentWithExtensionProps<S, R>) => ReactNode = Component(\n\t({ children, extension, state }) => {\n\t\tconst create = useCallback((env: Environment) => env.withExtension(extension, state), [extension, state])\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n\t({ children, extension, state }) => {\n\t\tconst create = (env: Environment) => env.withExtension(extension, state)\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n)\n"],"names":["createContext","Environment","Component","useEnvironment","useMemo","useCallback","jsx"],"mappings":";;;;;;;AAKO,MAAM,qBAAqBA,MAAAA,cAA2BC,QAAAA,YAAY,OAAA,CAAQ;AACjF,mBAAmB,cAAc;AAQ1B,MAAM,wBAAwBC,UAAAA;AAAAA,EACpC,CAAC,EAAE,UAAU,QAAQ,WAAW;AAC/B,UAAM,MAAMC,eAAAA,eAAA;AAEZ,UAAM,mBAAmBC,MAAAA;AAAAA,MACxB,MAAM,OAAO,KAAK,QAAQ,EAAE;AAAA,MAC5B,CAAC,KAAK,QAAQ,GAAI,QAAQ,CAAA,CAAG;AAAA,IAAA;AAG9B,0CAAQ,mBAAmB,UAAnB,EAA4B,OAAO,kBAAmB,UAAS;AAAA,EACxE;AAAA,EACA;AAAA,IACC,cAAc,CAAC,EAAE,eAAe;AAC/B,mEAAU,UAAS;AAAA,IACpB;AAAA,IACA,qBAAqB,CAAC,EAAE,QAAQ,KAAA,GAAQ,QAAQ;AAC/C,aAAO,OAAO,KAAK,QAAQ,EAAE;AAAA,IAC9B;AAAA,EAAA;AAEF;AAQO,MAAM,+BAAgGF,UAAAA;AAAAA,EAC5G,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAASG,MAAAA,YAAY,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK,GAAG,CAAC,WAAW,KAAK,CAAC;AACxG,WAAOC,2BAAAA,IAAC,uBAAA,EAAsB,QAAiB,SAAA,CAAS;AAAA,EACzD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK;AACvE,WAAOA,2BAAAA,IAAC,uBAAA,EAAsB,QAAiB,SAAA,CAAS;AAAA,EACzD;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentContext.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useCallback, useMemo } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\nimport { Component } from '../coreComponents'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n\nexport interface EnvironmentMiddlewareProps<T extends unknown[]> {\n\tchildren: ReactNode\n\tcreate: (env: Environment, args: T) => Environment\n\targs?: T\n}\n\nexport const EnvironmentMiddleware = Component<EnvironmentMiddlewareProps<unknown[]>>(\n\t({ children, create, args }) => {\n\t\tconst env = useEnvironment()\n\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\t\tconst envWithExtension = useMemo(\n\t\t\t() => create(env, args ?? []),\n\t\t\t[env, create, ...(args ?? [])],\n\t\t)\n\n\t\treturn <EnvironmentContext.Provider value={envWithExtension}>{children}</EnvironmentContext.Provider>\n\t},\n\t{\n\t\tstaticRender: ({ children }) => {\n\t\t\treturn <>{children}</>\n\t\t},\n\t\tgenerateEnvironment: ({ create, args }, env) => {\n\t\t\treturn create(env, args ?? [])\n\t\t},\n\t},\n) as <T extends unknown[]>(props: EnvironmentMiddlewareProps<T>) => ReactNode\n\nexport interface EnvironmentWithExtensionProps<S, R> {\n\tchildren: ReactNode\n\textension: Environment.Extension<S, R>\n\tstate: S\n}\n\nexport const EnvironmentExtensionProvider: <S, R>(props: EnvironmentWithExtensionProps<S, R>) => ReactNode = Component(\n\t({ children, extension, state }) => {\n\t\tconst create = useCallback((env: Environment) => env.withExtension(extension, state), [extension, state])\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n\t({ children, extension, state }) => {\n\t\tconst create = (env: Environment) => env.withExtension(extension, state)\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n)\n"],"names":[],"mappings":";;;;;AAKO,MAAM,qBAAqB,cAA2B,YAAY,OAAA,CAAQ;AACjF,mBAAmB,cAAc;AAQ1B,MAAM,wBAAwB;AAAA,EACpC,CAAC,EAAE,UAAU,QAAQ,WAAW;AAC/B,UAAM,MAAM,eAAA;AAEZ,UAAM,mBAAmB;AAAA,MACxB,MAAM,OAAO,KAAK,QAAQ,EAAE;AAAA,MAC5B,CAAC,KAAK,QAAQ,GAAI,QAAQ,CAAA,CAAG;AAAA,IAAA;AAG9B,+BAAQ,mBAAmB,UAAnB,EAA4B,OAAO,kBAAmB,UAAS;AAAA,EACxE;AAAA,EACA;AAAA,IACC,cAAc,CAAC,EAAE,eAAe;AAC/B,6CAAU,UAAS;AAAA,IACpB;AAAA,IACA,qBAAqB,CAAC,EAAE,QAAQ,KAAA,GAAQ,QAAQ;AAC/C,aAAO,OAAO,KAAK,QAAQ,EAAE;AAAA,IAC9B;AAAA,EAAA;AAEF;AAQO,MAAM,+BAAgG;AAAA,EAC5G,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,YAAY,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK,GAAG,CAAC,WAAW,KAAK,CAAC;AACxG,WAAO,oBAAC,uBAAA,EAAsB,QAAiB,SAAA,CAAS;AAAA,EACzD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK;AACvE,WAAO,oBAAC,uBAAA,EAAsB,QAAiB,SAAA,CAAS;AAAA,EACzD;AACD;"}
|
|
1
|
+
{"version":3,"file":"EnvironmentContext.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useCallback, useMemo } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment.js'\nimport { Component } from '../coreComponents/index.js'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n\nexport interface EnvironmentMiddlewareProps<T extends unknown[]> {\n\tchildren: ReactNode\n\tcreate: (env: Environment, args: T) => Environment\n\targs?: T\n}\n\nexport const EnvironmentMiddleware = Component<EnvironmentMiddlewareProps<unknown[]>>(\n\t({ children, create, args }) => {\n\t\tconst env = useEnvironment()\n\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\t\tconst envWithExtension = useMemo(\n\t\t\t() => create(env, args ?? []),\n\t\t\t[env, create, ...(args ?? [])],\n\t\t)\n\n\t\treturn <EnvironmentContext.Provider value={envWithExtension}>{children}</EnvironmentContext.Provider>\n\t},\n\t{\n\t\tstaticRender: ({ children }) => {\n\t\t\treturn <>{children}</>\n\t\t},\n\t\tgenerateEnvironment: ({ create, args }, env) => {\n\t\t\treturn create(env, args ?? [])\n\t\t},\n\t},\n) as <T extends unknown[]>(props: EnvironmentMiddlewareProps<T>) => ReactNode\n\nexport interface EnvironmentWithExtensionProps<S, R> {\n\tchildren: ReactNode\n\textension: Environment.Extension<S, R>\n\tstate: S\n}\n\nexport const EnvironmentExtensionProvider: <S, R>(props: EnvironmentWithExtensionProps<S, R>) => ReactNode = Component(\n\t({ children, extension, state }) => {\n\t\tconst create = useCallback((env: Environment) => env.withExtension(extension, state), [extension, state])\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n\t({ children, extension, state }) => {\n\t\tconst create = (env: Environment) => env.withExtension(extension, state)\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n)\n"],"names":[],"mappings":";;;;;AAKO,MAAM,qBAAqB,cAA2B,YAAY,OAAA,CAAQ;AACjF,mBAAmB,cAAc;AAQ1B,MAAM,wBAAwB;AAAA,EACpC,CAAC,EAAE,UAAU,QAAQ,WAAW;AAC/B,UAAM,MAAM,eAAA;AAEZ,UAAM,mBAAmB;AAAA,MACxB,MAAM,OAAO,KAAK,QAAQ,EAAE;AAAA,MAC5B,CAAC,KAAK,QAAQ,GAAI,QAAQ,CAAA,CAAG;AAAA,IAAA;AAG9B,+BAAQ,mBAAmB,UAAnB,EAA4B,OAAO,kBAAmB,UAAS;AAAA,EACxE;AAAA,EACA;AAAA,IACC,cAAc,CAAC,EAAE,eAAe;AAC/B,6CAAU,UAAS;AAAA,IACpB;AAAA,IACA,qBAAqB,CAAC,EAAE,QAAQ,KAAA,GAAQ,QAAQ;AAC/C,aAAO,OAAO,KAAK,QAAQ,EAAE;AAAA,IAC9B;AAAA,EAAA;AAEF;AAQO,MAAM,+BAAgG;AAAA,EAC5G,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,YAAY,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK,GAAG,CAAC,WAAW,KAAK,CAAC;AACxG,WAAO,oBAAC,uBAAA,EAAsB,QAAiB,SAAA,CAAS;AAAA,EACzD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK;AACvE,WAAO,oBAAC,uBAAA,EAAsB,QAAiB,SAAA,CAAS;AAAA,EACzD;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRootIdProvider.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/TreeRootIdProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport interface TreeRootIdProviderProps {\n\ttreeRootId: TreeRootId | undefined\n\tchildren: ReactNode\n}\n\nexport function TreeRootIdProvider(props: TreeRootIdProviderProps) {\n\treturn <TreeRootIdContext.Provider value={props.treeRootId}>{props.children}</TreeRootIdContext.Provider>\n}\n"],"names":["jsx","TreeRootIdContext"],"mappings":";;;;AASO,SAAS,mBAAmB,OAAgC;AAClE,SAAOA,+BAACC,kBAAAA,kBAAkB,UAAlB,EAA2B,OAAO,MAAM,YAAa,gBAAM,UAAS;AAC7E;;"}
|
|
1
|
+
{"version":3,"file":"TreeRootIdProvider.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/TreeRootIdProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext.js'\n\nexport interface TreeRootIdProviderProps {\n\ttreeRootId: TreeRootId | undefined\n\tchildren: ReactNode\n}\n\nexport function TreeRootIdProvider(props: TreeRootIdProviderProps) {\n\treturn <TreeRootIdContext.Provider value={props.treeRootId}>{props.children}</TreeRootIdContext.Provider>\n}\n"],"names":["jsx","TreeRootIdContext"],"mappings":";;;;AASO,SAAS,mBAAmB,OAAgC;AAClE,SAAOA,+BAACC,kBAAAA,kBAAkB,UAAlB,EAA2B,OAAO,MAAM,YAAa,gBAAM,UAAS;AAC7E;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRootIdProvider.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/TreeRootIdProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport interface TreeRootIdProviderProps {\n\ttreeRootId: TreeRootId | undefined\n\tchildren: ReactNode\n}\n\nexport function TreeRootIdProvider(props: TreeRootIdProviderProps) {\n\treturn <TreeRootIdContext.Provider value={props.treeRootId}>{props.children}</TreeRootIdContext.Provider>\n}\n"],"names":[],"mappings":";;AASO,SAAS,mBAAmB,OAAgC;AAClE,SAAO,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,MAAM,YAAa,gBAAM,UAAS;AAC7E;"}
|
|
1
|
+
{"version":3,"file":"TreeRootIdProvider.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/TreeRootIdProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext.js'\n\nexport interface TreeRootIdProviderProps {\n\ttreeRootId: TreeRootId | undefined\n\tchildren: ReactNode\n}\n\nexport function TreeRootIdProvider(props: TreeRootIdProviderProps) {\n\treturn <TreeRootIdContext.Provider value={props.treeRootId}>{props.children}</TreeRootIdContext.Provider>\n}\n"],"names":[],"mappings":";;AASO,SAAS,mBAAmB,OAAgC;AAClE,SAAO,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,MAAM,YAAa,gBAAM,UAAS;AAC7E;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBindingOperations.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useBindingOperations.ts"],"sourcesContent":["import { ReactNode, useContext } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingOperationsContext } from './BindingOperationsContext'\n\nexport const useBindingOperations = (): BindingOperations<ReactNode> => useContext(BindingOperationsContext)\n"],"names":["useContext","BindingOperationsContext"],"mappings":";;;;AAIO,MAAM,uBAAuB,MAAoCA,MAAAA,WAAWC,yBAAAA,wBAAwB;;"}
|
|
1
|
+
{"version":3,"file":"useBindingOperations.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useBindingOperations.ts"],"sourcesContent":["import { ReactNode, useContext } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingOperationsContext } from './BindingOperationsContext.js'\n\nexport const useBindingOperations = (): BindingOperations<ReactNode> => useContext(BindingOperationsContext)\n"],"names":["useContext","BindingOperationsContext"],"mappings":";;;;AAIO,MAAM,uBAAuB,MAAoCA,MAAAA,WAAWC,yBAAAA,wBAAwB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBindingOperations.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useBindingOperations.ts"],"sourcesContent":["import { ReactNode, useContext } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingOperationsContext } from './BindingOperationsContext'\n\nexport const useBindingOperations = (): BindingOperations<ReactNode> => useContext(BindingOperationsContext)\n"],"names":[],"mappings":";;AAIO,MAAM,uBAAuB,MAAoC,WAAW,wBAAwB;"}
|
|
1
|
+
{"version":3,"file":"useBindingOperations.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useBindingOperations.ts"],"sourcesContent":["import { ReactNode, useContext } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingOperationsContext } from './BindingOperationsContext.js'\n\nexport const useBindingOperations = (): BindingOperations<ReactNode> => useContext(BindingOperationsContext)\n"],"names":[],"mappings":";;AAIO,MAAM,uBAAuB,MAAoC,WAAW,wBAAwB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeEntityList.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList,\n): RelativeEntityList\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeEntityList | undefined\n\tlet hasList: boolean\n\n\tif (sugaredRelativeEntityList === undefined) {\n\t\thasList = false\n\t} else if (typeof sugaredRelativeEntityList === 'string') {\n\t\thasList = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeEntityList,\n\t\t}\n\t} else {\n\t\thasList = true\n\t\tnormalizedSugared = sugaredRelativeEntityList\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasList\n\t\t\t\t? QueryLanguage.desugarRelativeEntityList(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[\n\t\t\tnormalizedSugared?.field,\n\t\t\tnormalizedSugared?.setOnCreate,\n\t\t\tnormalizedSugared?.isNonbearing,\n\t\t\tnormalizedSugared?.offset,\n\t\t\tnormalizedSugared?.limit,\n\t\t\tnormalizedSugared?.orderBy,\n\t\t\thasList,\n\t\t\tenvironment,\n\t\t],\n\t)\n}\n\nexport { useDesugaredRelativeEntityList }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,+BACR,2BACiC;AACjC,QAAM,cAAcA,eAAAA,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,8BAA8B,QAAW;AAC5C,cAAU;AAAA,EACX,WAAW,OAAO,8BAA8B,UAAU;AACzD,cAAU;AACV,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,cAAU;AACV,wBAAoB;AAAA,EACrB;AAEA,SAAOC,MAAAA;AAAAA,IACN,MACC,UACGC,QAAAA,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,aAAa,mBAAmB;AAAA,QAChC,cAAc,mBAAmB;AAAA,QACjC,QAAQ,mBAAmB;AAAA,QAC3B,OAAO,mBAAmB;AAAA,QAC1B,SAAS,mBAAmB;AAAA,MAAA;AAAA,MAE7B;AAAA,IAAA,IAEC;AAAA,IACJ;AAAA,MACC,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,IAAA;AAAA,EACD;AAEF;;"}
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeEntityList.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment.js'\n\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList,\n): RelativeEntityList\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeEntityList | undefined\n\tlet hasList: boolean\n\n\tif (sugaredRelativeEntityList === undefined) {\n\t\thasList = false\n\t} else if (typeof sugaredRelativeEntityList === 'string') {\n\t\thasList = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeEntityList,\n\t\t}\n\t} else {\n\t\thasList = true\n\t\tnormalizedSugared = sugaredRelativeEntityList\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasList\n\t\t\t\t? QueryLanguage.desugarRelativeEntityList(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[\n\t\t\tnormalizedSugared?.field,\n\t\t\tnormalizedSugared?.setOnCreate,\n\t\t\tnormalizedSugared?.isNonbearing,\n\t\t\tnormalizedSugared?.offset,\n\t\t\tnormalizedSugared?.limit,\n\t\t\tnormalizedSugared?.orderBy,\n\t\t\thasList,\n\t\t\tenvironment,\n\t\t],\n\t)\n}\n\nexport { useDesugaredRelativeEntityList }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,+BACR,2BACiC;AACjC,QAAM,cAAcA,eAAAA,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,8BAA8B,QAAW;AAC5C,cAAU;AAAA,EACX,WAAW,OAAO,8BAA8B,UAAU;AACzD,cAAU;AACV,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,cAAU;AACV,wBAAoB;AAAA,EACrB;AAEA,SAAOC,MAAAA;AAAAA,IACN,MACC,UACGC,QAAAA,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,aAAa,mBAAmB;AAAA,QAChC,cAAc,mBAAmB;AAAA,QACjC,QAAQ,mBAAmB;AAAA,QAC3B,OAAO,mBAAmB;AAAA,QAC1B,SAAS,mBAAmB;AAAA,MAAA;AAAA,MAE7B;AAAA,IAAA,IAEC;AAAA,IACJ;AAAA,MACC,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,IAAA;AAAA,EACD;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList,\n): RelativeEntityList\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeEntityList | undefined\n\tlet hasList: boolean\n\n\tif (sugaredRelativeEntityList === undefined) {\n\t\thasList = false\n\t} else if (typeof sugaredRelativeEntityList === 'string') {\n\t\thasList = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeEntityList,\n\t\t}\n\t} else {\n\t\thasList = true\n\t\tnormalizedSugared = sugaredRelativeEntityList\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasList\n\t\t\t\t? QueryLanguage.desugarRelativeEntityList(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[\n\t\t\tnormalizedSugared?.field,\n\t\t\tnormalizedSugared?.setOnCreate,\n\t\t\tnormalizedSugared?.isNonbearing,\n\t\t\tnormalizedSugared?.offset,\n\t\t\tnormalizedSugared?.limit,\n\t\t\tnormalizedSugared?.orderBy,\n\t\t\thasList,\n\t\t\tenvironment,\n\t\t],\n\t)\n}\n\nexport { useDesugaredRelativeEntityList }\n"],"names":[],"mappings":";;;AAoBA,SAAS,+BACR,2BACiC;AACjC,QAAM,cAAc,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,8BAA8B,QAAW;AAC5C,cAAU;AAAA,EACX,WAAW,OAAO,8BAA8B,UAAU;AACzD,cAAU;AACV,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,cAAU;AACV,wBAAoB;AAAA,EACrB;AAEA,SAAO;AAAA,IACN,MACC,UACG,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,aAAa,mBAAmB;AAAA,QAChC,cAAc,mBAAmB;AAAA,QACjC,QAAQ,mBAAmB;AAAA,QAC3B,OAAO,mBAAmB;AAAA,QAC1B,SAAS,mBAAmB;AAAA,MAAA;AAAA,MAE7B;AAAA,IAAA,IAEC;AAAA,IACJ;AAAA,MACC,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,IAAA;AAAA,EACD;AAEF;"}
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment.js'\n\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList,\n): RelativeEntityList\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeEntityList | undefined\n\tlet hasList: boolean\n\n\tif (sugaredRelativeEntityList === undefined) {\n\t\thasList = false\n\t} else if (typeof sugaredRelativeEntityList === 'string') {\n\t\thasList = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeEntityList,\n\t\t}\n\t} else {\n\t\thasList = true\n\t\tnormalizedSugared = sugaredRelativeEntityList\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasList\n\t\t\t\t? QueryLanguage.desugarRelativeEntityList(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[\n\t\t\tnormalizedSugared?.field,\n\t\t\tnormalizedSugared?.setOnCreate,\n\t\t\tnormalizedSugared?.isNonbearing,\n\t\t\tnormalizedSugared?.offset,\n\t\t\tnormalizedSugared?.limit,\n\t\t\tnormalizedSugared?.orderBy,\n\t\t\thasList,\n\t\t\tenvironment,\n\t\t],\n\t)\n}\n\nexport { useDesugaredRelativeEntityList }\n"],"names":[],"mappings":";;;AAoBA,SAAS,+BACR,2BACiC;AACjC,QAAM,cAAc,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,8BAA8B,QAAW;AAC5C,cAAU;AAAA,EACX,WAAW,OAAO,8BAA8B,UAAU;AACzD,cAAU;AACV,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,cAAU;AACV,wBAAoB;AAAA,EACrB;AAEA,SAAO;AAAA,IACN,MACC,UACG,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,aAAa,mBAAmB;AAAA,QAChC,cAAc,mBAAmB;AAAA,QACjC,QAAQ,mBAAmB;AAAA,QAC3B,OAAO,mBAAmB;AAAA,QAC1B,SAAS,mBAAmB;AAAA,MAAA;AAAA,MAE7B;AAAA,IAAA,IAEC;AAAA,IACJ;AAAA,MACC,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,IAAA;AAAA,EACD;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity,\n): RelativeSingleEntity\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleEntity | undefined\n\tlet hasEntity: boolean\n\n\tif (sugaredRelativeSingleEntity === undefined) {\n\t\thasEntity = false\n\t} else if (typeof sugaredRelativeSingleEntity === 'string') {\n\t\thasEntity = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleEntity,\n\t\t}\n\t} else {\n\t\thasEntity = true\n\t\tnormalizedSugared = sugaredRelativeSingleEntity\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasEntity\n\t\t\t\t? QueryLanguage.desugarRelativeSingleEntity(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity],\n\t)\n}\n\nexport { useDesugaredRelativeSingleEntity }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,iCACR,6BACmC;AACnC,QAAM,cAAcA,eAAAA,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,gCAAgC,QAAW;AAC9C,gBAAY;AAAA,EACb,WAAW,OAAO,gCAAgC,UAAU;AAC3D,gBAAY;AACZ,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,gBAAY;AACZ,wBAAoB;AAAA,EACrB;AAEA,SAAOC,MAAAA;AAAAA,IACN,MACC,YACGC,QAAAA,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,aAAa,mBAAmB;AAAA,MAAA;AAAA,MAEjC;AAAA,IAAA,IAEC;AAAA,IACJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,aAAa,aAAa,SAAS;AAAA,EAAA;AAEpH;;"}
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment.js'\n\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity,\n): RelativeSingleEntity\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleEntity | undefined\n\tlet hasEntity: boolean\n\n\tif (sugaredRelativeSingleEntity === undefined) {\n\t\thasEntity = false\n\t} else if (typeof sugaredRelativeSingleEntity === 'string') {\n\t\thasEntity = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleEntity,\n\t\t}\n\t} else {\n\t\thasEntity = true\n\t\tnormalizedSugared = sugaredRelativeSingleEntity\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasEntity\n\t\t\t\t? QueryLanguage.desugarRelativeSingleEntity(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity],\n\t)\n}\n\nexport { useDesugaredRelativeSingleEntity }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,iCACR,6BACmC;AACnC,QAAM,cAAcA,eAAAA,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,gCAAgC,QAAW;AAC9C,gBAAY;AAAA,EACb,WAAW,OAAO,gCAAgC,UAAU;AAC3D,gBAAY;AACZ,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,gBAAY;AACZ,wBAAoB;AAAA,EACrB;AAEA,SAAOC,MAAAA;AAAAA,IACN,MACC,YACGC,QAAAA,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,aAAa,mBAAmB;AAAA,MAAA;AAAA,MAEjC;AAAA,IAAA,IAEC;AAAA,IACJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,aAAa,aAAa,SAAS;AAAA,EAAA;AAEpH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity,\n): RelativeSingleEntity\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleEntity | undefined\n\tlet hasEntity: boolean\n\n\tif (sugaredRelativeSingleEntity === undefined) {\n\t\thasEntity = false\n\t} else if (typeof sugaredRelativeSingleEntity === 'string') {\n\t\thasEntity = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleEntity,\n\t\t}\n\t} else {\n\t\thasEntity = true\n\t\tnormalizedSugared = sugaredRelativeSingleEntity\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasEntity\n\t\t\t\t? QueryLanguage.desugarRelativeSingleEntity(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity],\n\t)\n}\n\nexport { useDesugaredRelativeSingleEntity }\n"],"names":[],"mappings":";;;AAoBA,SAAS,iCACR,6BACmC;AACnC,QAAM,cAAc,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,gCAAgC,QAAW;AAC9C,gBAAY;AAAA,EACb,WAAW,OAAO,gCAAgC,UAAU;AAC3D,gBAAY;AACZ,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,gBAAY;AACZ,wBAAoB;AAAA,EACrB;AAEA,SAAO;AAAA,IACN,MACC,YACG,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,aAAa,mBAAmB;AAAA,MAAA;AAAA,MAEjC;AAAA,IAAA,IAEC;AAAA,IACJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,aAAa,aAAa,SAAS;AAAA,EAAA;AAEpH;"}
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment.js'\n\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity,\n): RelativeSingleEntity\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleEntity | undefined\n\tlet hasEntity: boolean\n\n\tif (sugaredRelativeSingleEntity === undefined) {\n\t\thasEntity = false\n\t} else if (typeof sugaredRelativeSingleEntity === 'string') {\n\t\thasEntity = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleEntity,\n\t\t}\n\t} else {\n\t\thasEntity = true\n\t\tnormalizedSugared = sugaredRelativeSingleEntity\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasEntity\n\t\t\t\t? QueryLanguage.desugarRelativeSingleEntity(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity],\n\t)\n}\n\nexport { useDesugaredRelativeSingleEntity }\n"],"names":[],"mappings":";;;AAoBA,SAAS,iCACR,6BACmC;AACnC,QAAM,cAAc,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,gCAAgC,QAAW;AAC9C,gBAAY;AAAA,EACb,WAAW,OAAO,gCAAgC,UAAU;AAC3D,gBAAY;AACZ,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,gBAAY;AACZ,wBAAoB;AAAA,EACrB;AAEA,SAAO;AAAA,IACN,MACC,YACG,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,aAAa,mBAAmB;AAAA,MAAA;AAAA,MAEjC;AAAA,IAAA,IAEC;AAAA,IACJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,aAAa,aAAa,SAAS;AAAA,EAAA;AAEpH;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleField.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): RelativeSingleField\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleField | undefined\n\tlet hasField: boolean\n\n\tif (sugaredRelativeSingleField === undefined) {\n\t\thasField = false\n\t} else if (typeof sugaredRelativeSingleField === 'string') {\n\t\thasField = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleField,\n\t\t}\n\t} else {\n\t\thasField = true\n\t\tnormalizedSugared = sugaredRelativeSingleField\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasField\n\t\t\t\t? QueryLanguage.desugarRelativeSingleField(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField],\n\t)\n}\n\nexport { useDesugaredRelativeSingleField }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,gCACR,4BACkC;AAClC,QAAM,cAAcA,eAAAA,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,+BAA+B,QAAW;AAC7C,eAAW;AAAA,EACZ,WAAW,OAAO,+BAA+B,UAAU;AAC1D,eAAW;AACX,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,eAAW;AACX,wBAAoB;AAAA,EACrB;AAEA,SAAOC,MAAAA;AAAAA,IACN,MACC,WACGC,QAAAA,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,cAAc,mBAAmB;AAAA,MAAA;AAAA,MAElC;AAAA,IAAA,IAEC;AAAA,IACJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,cAAc,aAAa,QAAQ;AAAA,EAAA;AAEpH;;"}
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleField.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment.js'\n\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): RelativeSingleField\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleField | undefined\n\tlet hasField: boolean\n\n\tif (sugaredRelativeSingleField === undefined) {\n\t\thasField = false\n\t} else if (typeof sugaredRelativeSingleField === 'string') {\n\t\thasField = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleField,\n\t\t}\n\t} else {\n\t\thasField = true\n\t\tnormalizedSugared = sugaredRelativeSingleField\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasField\n\t\t\t\t? QueryLanguage.desugarRelativeSingleField(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField],\n\t)\n}\n\nexport { useDesugaredRelativeSingleField }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,gCACR,4BACkC;AAClC,QAAM,cAAcA,eAAAA,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,+BAA+B,QAAW;AAC7C,eAAW;AAAA,EACZ,WAAW,OAAO,+BAA+B,UAAU;AAC1D,eAAW;AACX,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,eAAW;AACX,wBAAoB;AAAA,EACrB;AAEA,SAAOC,MAAAA;AAAAA,IACN,MACC,WACGC,QAAAA,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,cAAc,mBAAmB;AAAA,MAAA;AAAA,MAElC;AAAA,IAAA,IAEC;AAAA,IACJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,cAAc,aAAa,QAAQ;AAAA,EAAA;AAEpH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleField.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): RelativeSingleField\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleField | undefined\n\tlet hasField: boolean\n\n\tif (sugaredRelativeSingleField === undefined) {\n\t\thasField = false\n\t} else if (typeof sugaredRelativeSingleField === 'string') {\n\t\thasField = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleField,\n\t\t}\n\t} else {\n\t\thasField = true\n\t\tnormalizedSugared = sugaredRelativeSingleField\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasField\n\t\t\t\t? QueryLanguage.desugarRelativeSingleField(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField],\n\t)\n}\n\nexport { useDesugaredRelativeSingleField }\n"],"names":[],"mappings":";;;AAoBA,SAAS,gCACR,4BACkC;AAClC,QAAM,cAAc,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,+BAA+B,QAAW;AAC7C,eAAW;AAAA,EACZ,WAAW,OAAO,+BAA+B,UAAU;AAC1D,eAAW;AACX,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,eAAW;AACX,wBAAoB;AAAA,EACrB;AAEA,SAAO;AAAA,IACN,MACC,WACG,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,cAAc,mBAAmB;AAAA,MAAA;AAAA,MAElC;AAAA,IAAA,IAEC;AAAA,IACJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,cAAc,aAAa,QAAQ;AAAA,EAAA;AAEpH;"}
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleField.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment.js'\n\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): RelativeSingleField\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleField | undefined\n\tlet hasField: boolean\n\n\tif (sugaredRelativeSingleField === undefined) {\n\t\thasField = false\n\t} else if (typeof sugaredRelativeSingleField === 'string') {\n\t\thasField = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleField,\n\t\t}\n\t} else {\n\t\thasField = true\n\t\tnormalizedSugared = sugaredRelativeSingleField\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasField\n\t\t\t\t? QueryLanguage.desugarRelativeSingleField(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t)\n\t\t\t\t: undefined,\n\t\t[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField],\n\t)\n}\n\nexport { useDesugaredRelativeSingleField }\n"],"names":[],"mappings":";;;AAoBA,SAAS,gCACR,4BACkC;AAClC,QAAM,cAAc,eAAA;AAEpB,MAAI;AACJ,MAAI;AAEJ,MAAI,+BAA+B,QAAW;AAC7C,eAAW;AAAA,EACZ,WAAW,OAAO,+BAA+B,UAAU;AAC1D,eAAW;AACX,wBAAoB;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EAET,OAAO;AACN,eAAW;AACX,wBAAoB;AAAA,EACrB;AAEA,SAAO;AAAA,IACN,MACC,WACG,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,cAAc,mBAAmB;AAAA,MAAA;AAAA,MAElC;AAAA,IAAA,IAEC;AAAA,IACJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,cAAc,aAAa,QAAQ;AAAA,EAAA;AAEpH;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity'\n\nfunction useEntity(): EntityAccessor\nfunction useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor\nfunction useEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): EntityAccessor | undefined\nfunction useEntity(...entity: [] | [string | SugaredRelativeSingleEntity | undefined]): EntityAccessor | undefined {\n\tuseConstantValueInvariant(entity.length, 'useEntity: cannot alternate between providing and omitting the argument.')\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\n\tif (entity.length === 0) {\n\t\tconst getEntityAccessor = useCallback(() => getEntityByKey(entityKey), [entityKey, getEntityByKey])\n\t\treturn useAccessorUpdateSubscription(getEntityAccessor)[0]\n\t}\n\tconst sugaredRelativeSingleEntity = entity[0]\n\n\tconst relativeSingleEntity = useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity)\n\tconst getEntity = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntity(relativeSingleEntity!)\n\t}, [entityKey, getEntityByKey, relativeSingleEntity])\n\n\tif (relativeSingleEntity) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleEntity.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [entity, { update }] = useAccessorUpdateSubscription(getEntity)\n\n\t\tif (relativeSingleEntity.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeSingleEntity.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entity\n\t}\n\treturn undefined\n}\n\nexport { useEntity }\n"],"names":["useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useAccessorUpdateSubscription","useDesugaredRelativeSingleEntity","useConstantLengthInvariant","entity","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAcA,SAAS,aAAa,QAA6F;AAClHA,uCAA0B,OAAO,QAAQ,0EAA0E;AAEnH,QAAM,YAAYC,aAAAA,aAAA;AAClB,QAAM,iBAAiBC,kBAAAA,kBAAA;AAEvB,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,oBAAoBC,MAAAA,YAAY,MAAM,eAAe,SAAS,GAAG,CAAC,WAAW,cAAc,CAAC;AAClG,WAAOC,8BAAAA,8BAA8B,iBAAiB,EAAE,CAAC;AAAA,EAC1D;AACA,QAAM,8BAA8B,OAAO,CAAC;AAE5C,QAAM,uBAAuBC,iCAAAA,iCAAiC,2BAA2B;AACzF,QAAM,YAAYF,MAAAA,YAAY,MAAM;AACnC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,UAAU,oBAAqB;AAAA,EAC9C,GAAG,CAAC,WAAW,gBAAgB,oBAAoB,CAAC;AAEpD,MAAI,sBAAsB;AACzBG,eAAAA;AAAAA,MACC,qBAAqB;AAAA,MACrB;AAAA,IAAA;AAED,UAAM,CAACC,SAAQ,EAAE,QAAQ,IAAIH,8BAAAA,8BAA8B,SAAS;AAEpE,QAAI,qBAAqB,mBAAmB,QAAQ;AACnDI,4BAAAA,sBAAsB,qBAAqB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC/E;AAEA,WAAOD;AAAAA,EACR;AACA,SAAO;AACR;;"}
|
|
1
|
+
{"version":3,"file":"useEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index.js'\nimport type { EntityAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents/index.js'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription.js'\nimport { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity.js'\n\nfunction useEntity(): EntityAccessor\nfunction useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor\nfunction useEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): EntityAccessor | undefined\nfunction useEntity(...entity: [] | [string | SugaredRelativeSingleEntity | undefined]): EntityAccessor | undefined {\n\tuseConstantValueInvariant(entity.length, 'useEntity: cannot alternate between providing and omitting the argument.')\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\n\tif (entity.length === 0) {\n\t\tconst getEntityAccessor = useCallback(() => getEntityByKey(entityKey), [entityKey, getEntityByKey])\n\t\treturn useAccessorUpdateSubscription(getEntityAccessor)[0]\n\t}\n\tconst sugaredRelativeSingleEntity = entity[0]\n\n\tconst relativeSingleEntity = useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity)\n\tconst getEntity = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntity(relativeSingleEntity!)\n\t}, [entityKey, getEntityByKey, relativeSingleEntity])\n\n\tif (relativeSingleEntity) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleEntity.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [entity, { update }] = useAccessorUpdateSubscription(getEntity)\n\n\t\tif (relativeSingleEntity.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeSingleEntity.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entity\n\t}\n\treturn undefined\n}\n\nexport { useEntity }\n"],"names":["useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useAccessorUpdateSubscription","useDesugaredRelativeSingleEntity","useConstantLengthInvariant","entity","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAcA,SAAS,aAAa,QAA6F;AAClHA,uCAA0B,OAAO,QAAQ,0EAA0E;AAEnH,QAAM,YAAYC,aAAAA,aAAA;AAClB,QAAM,iBAAiBC,kBAAAA,kBAAA;AAEvB,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,oBAAoBC,MAAAA,YAAY,MAAM,eAAe,SAAS,GAAG,CAAC,WAAW,cAAc,CAAC;AAClG,WAAOC,8BAAAA,8BAA8B,iBAAiB,EAAE,CAAC;AAAA,EAC1D;AACA,QAAM,8BAA8B,OAAO,CAAC;AAE5C,QAAM,uBAAuBC,iCAAAA,iCAAiC,2BAA2B;AACzF,QAAM,YAAYF,MAAAA,YAAY,MAAM;AACnC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,UAAU,oBAAqB;AAAA,EAC9C,GAAG,CAAC,WAAW,gBAAgB,oBAAoB,CAAC;AAEpD,MAAI,sBAAsB;AACzBG,eAAAA;AAAAA,MACC,qBAAqB;AAAA,MACrB;AAAA,IAAA;AAED,UAAM,CAACC,SAAQ,EAAE,QAAQ,IAAIH,8BAAAA,8BAA8B,SAAS;AAEpE,QAAI,qBAAqB,mBAAmB,QAAQ;AACnDI,4BAAAA,sBAAsB,qBAAqB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC/E;AAEA,WAAOD;AAAAA,EACR;AACA,SAAO;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity'\n\nfunction useEntity(): EntityAccessor\nfunction useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor\nfunction useEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): EntityAccessor | undefined\nfunction useEntity(...entity: [] | [string | SugaredRelativeSingleEntity | undefined]): EntityAccessor | undefined {\n\tuseConstantValueInvariant(entity.length, 'useEntity: cannot alternate between providing and omitting the argument.')\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\n\tif (entity.length === 0) {\n\t\tconst getEntityAccessor = useCallback(() => getEntityByKey(entityKey), [entityKey, getEntityByKey])\n\t\treturn useAccessorUpdateSubscription(getEntityAccessor)[0]\n\t}\n\tconst sugaredRelativeSingleEntity = entity[0]\n\n\tconst relativeSingleEntity = useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity)\n\tconst getEntity = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntity(relativeSingleEntity!)\n\t}, [entityKey, getEntityByKey, relativeSingleEntity])\n\n\tif (relativeSingleEntity) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleEntity.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [entity, { update }] = useAccessorUpdateSubscription(getEntity)\n\n\t\tif (relativeSingleEntity.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeSingleEntity.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entity\n\t}\n\treturn undefined\n}\n\nexport { useEntity }\n"],"names":["entity"],"mappings":";;;;;;;AAcA,SAAS,aAAa,QAA6F;AAClH,4BAA0B,OAAO,QAAQ,0EAA0E;AAEnH,QAAM,YAAY,aAAA;AAClB,QAAM,iBAAiB,kBAAA;AAEvB,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,oBAAoB,YAAY,MAAM,eAAe,SAAS,GAAG,CAAC,WAAW,cAAc,CAAC;AAClG,WAAO,8BAA8B,iBAAiB,EAAE,CAAC;AAAA,EAC1D;AACA,QAAM,8BAA8B,OAAO,CAAC;AAE5C,QAAM,uBAAuB,iCAAiC,2BAA2B;AACzF,QAAM,YAAY,YAAY,MAAM;AACnC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,UAAU,oBAAqB;AAAA,EAC9C,GAAG,CAAC,WAAW,gBAAgB,oBAAoB,CAAC;AAEpD,MAAI,sBAAsB;AACzB;AAAA,MACC,qBAAqB;AAAA,MACrB;AAAA,IAAA;AAED,UAAM,CAACA,SAAQ,EAAE,QAAQ,IAAI,8BAA8B,SAAS;AAEpE,QAAI,qBAAqB,mBAAmB,QAAQ;AACnD,4BAAsB,qBAAqB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC/E;AAEA,WAAOA;AAAAA,EACR;AACA,SAAO;AACR;"}
|
|
1
|
+
{"version":3,"file":"useEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index.js'\nimport type { EntityAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents/index.js'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription.js'\nimport { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity.js'\n\nfunction useEntity(): EntityAccessor\nfunction useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor\nfunction useEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): EntityAccessor | undefined\nfunction useEntity(...entity: [] | [string | SugaredRelativeSingleEntity | undefined]): EntityAccessor | undefined {\n\tuseConstantValueInvariant(entity.length, 'useEntity: cannot alternate between providing and omitting the argument.')\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\n\tif (entity.length === 0) {\n\t\tconst getEntityAccessor = useCallback(() => getEntityByKey(entityKey), [entityKey, getEntityByKey])\n\t\treturn useAccessorUpdateSubscription(getEntityAccessor)[0]\n\t}\n\tconst sugaredRelativeSingleEntity = entity[0]\n\n\tconst relativeSingleEntity = useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity)\n\tconst getEntity = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntity(relativeSingleEntity!)\n\t}, [entityKey, getEntityByKey, relativeSingleEntity])\n\n\tif (relativeSingleEntity) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleEntity.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [entity, { update }] = useAccessorUpdateSubscription(getEntity)\n\n\t\tif (relativeSingleEntity.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeSingleEntity.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entity\n\t}\n\treturn undefined\n}\n\nexport { useEntity }\n"],"names":["entity"],"mappings":";;;;;;;AAcA,SAAS,aAAa,QAA6F;AAClH,4BAA0B,OAAO,QAAQ,0EAA0E;AAEnH,QAAM,YAAY,aAAA;AAClB,QAAM,iBAAiB,kBAAA;AAEvB,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,oBAAoB,YAAY,MAAM,eAAe,SAAS,GAAG,CAAC,WAAW,cAAc,CAAC;AAClG,WAAO,8BAA8B,iBAAiB,EAAE,CAAC;AAAA,EAC1D;AACA,QAAM,8BAA8B,OAAO,CAAC;AAE5C,QAAM,uBAAuB,iCAAiC,2BAA2B;AACzF,QAAM,YAAY,YAAY,MAAM;AACnC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,UAAU,oBAAqB;AAAA,EAC9C,GAAG,CAAC,WAAW,gBAAgB,oBAAoB,CAAC;AAEpD,MAAI,sBAAsB;AACzB;AAAA,MACC,qBAAqB;AAAA,MACrB;AAAA,IAAA;AAED,UAAM,CAACA,SAAQ,EAAE,QAAQ,IAAI,8BAA8B,SAAS;AAEpE,QAAI,qBAAqB,mBAAmB,QAAQ;AACnD,4BAAsB,qBAAqB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC/E;AAEA,WAAOA;AAAAA,EACR;AACA,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityKey.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityKey.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { BindingError, EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useEntityKey = (): string | (() => EntityAccessor) => {\n\tconst entityKey = useContext(EntityKeyContext)\n\n\tif (entityKey === undefined) {\n\t\tthrow new BindingError(\n\t\t\t`Trying to use a data bound component outside a correct parent. You likely forgot to use <DataBindingProvider /> `\n\t\t\t\t+ `or a SubTree.`,\n\t\t)\n\t}\n\treturn entityKey\n}\n"],"names":["useContext","EntityKeyContext","BindingError"],"mappings":";;;;;AAIO,MAAM,eAAe,MAAuC;AAClE,QAAM,YAAYA,MAAAA,WAAWC,iCAAgB;AAE7C,MAAI,cAAc,QAAW;AAC5B,UAAM,IAAIC,QAAAA;AAAAA,MACT;AAAA,IAAA;AAAA,EAGF;AACA,SAAO;AACR;;"}
|
|
1
|
+
{"version":3,"file":"useEntityKey.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityKey.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { BindingError, EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext.js'\n\nexport const useEntityKey = (): string | (() => EntityAccessor) => {\n\tconst entityKey = useContext(EntityKeyContext)\n\n\tif (entityKey === undefined) {\n\t\tthrow new BindingError(\n\t\t\t`Trying to use a data bound component outside a correct parent. You likely forgot to use <DataBindingProvider /> `\n\t\t\t\t+ `or a SubTree.`,\n\t\t)\n\t}\n\treturn entityKey\n}\n"],"names":["useContext","EntityKeyContext","BindingError"],"mappings":";;;;;AAIO,MAAM,eAAe,MAAuC;AAClE,QAAM,YAAYA,MAAAA,WAAWC,iCAAgB;AAE7C,MAAI,cAAc,QAAW;AAC5B,UAAM,IAAIC,QAAAA;AAAAA,MACT;AAAA,IAAA;AAAA,EAGF;AACA,SAAO;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityKey.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityKey.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { BindingError, EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useEntityKey = (): string | (() => EntityAccessor) => {\n\tconst entityKey = useContext(EntityKeyContext)\n\n\tif (entityKey === undefined) {\n\t\tthrow new BindingError(\n\t\t\t`Trying to use a data bound component outside a correct parent. You likely forgot to use <DataBindingProvider /> `\n\t\t\t\t+ `or a SubTree.`,\n\t\t)\n\t}\n\treturn entityKey\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,eAAe,MAAuC;AAClE,QAAM,YAAY,WAAW,gBAAgB;AAE7C,MAAI,cAAc,QAAW;AAC5B,UAAM,IAAI;AAAA,MACT;AAAA,IAAA;AAAA,EAGF;AACA,SAAO;AACR;"}
|
|
1
|
+
{"version":3,"file":"useEntityKey.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityKey.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { BindingError, EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext.js'\n\nexport const useEntityKey = (): string | (() => EntityAccessor) => {\n\tconst entityKey = useContext(EntityKeyContext)\n\n\tif (entityKey === undefined) {\n\t\tthrow new BindingError(\n\t\t\t`Trying to use a data bound component outside a correct parent. You likely forgot to use <DataBindingProvider /> `\n\t\t\t\t+ `or a SubTree.`,\n\t\t)\n\t}\n\treturn entityKey\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,eAAe,MAAuC;AAClE,QAAM,YAAY,WAAW,gBAAgB;AAE7C,MAAI,cAAc,QAAW;AAC5B,UAAM,IAAI;AAAA,MACT;AAAA,IAAA;AAAA,EAGF;AACA,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityList.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [entityList, { update }] = useAccessorUpdateSubscription(getEntityList)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":["useDesugaredRelativeEntityList","useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useConstantLengthInvariant","useAccessorUpdateSubscription","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAaA,SAAS,cACR,2BACiC;AACjC,QAAM,qBAAqBA,+BAAAA,+BAA+B,yBAAyB;AACnFC,aAAAA;AAAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAYC,aAAAA,aAAA;AAClB,QAAM,iBAAiBC,kBAAAA,kBAAA;AACvB,QAAM,gBAAgBC,MAAAA,YAAY,MAAM;AACvC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,cAAc,kBAAmB;AAAA,EAChD,GAAG,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AACvBC,eAAAA;AAAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IAAA;AAED,UAAM,CAAC,YAAY,EAAE,QAAQ,IAAIC,8BAAAA,8BAA8B,aAAa;AAE5E,QAAI,mBAAmB,mBAAmB,QAAQ;AACjDC,4BAAAA,sBAAsB,mBAAmB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC7E;AAEA,WAAO;AAAA,EACR;AACA,SAAO;AACR;;"}
|
|
1
|
+
{"version":3,"file":"useEntityList.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index.js'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents/index.js'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription.js'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList.js'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [entityList, { update }] = useAccessorUpdateSubscription(getEntityList)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":["useDesugaredRelativeEntityList","useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useConstantLengthInvariant","useAccessorUpdateSubscription","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAaA,SAAS,cACR,2BACiC;AACjC,QAAM,qBAAqBA,+BAAAA,+BAA+B,yBAAyB;AACnFC,aAAAA;AAAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAYC,aAAAA,aAAA;AAClB,QAAM,iBAAiBC,kBAAAA,kBAAA;AACvB,QAAM,gBAAgBC,MAAAA,YAAY,MAAM;AACvC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,cAAc,kBAAmB;AAAA,EAChD,GAAG,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AACvBC,eAAAA;AAAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IAAA;AAED,UAAM,CAAC,YAAY,EAAE,QAAQ,IAAIC,8BAAAA,8BAA8B,aAAa;AAE5E,QAAI,mBAAmB,mBAAmB,QAAQ;AACjDC,4BAAAA,sBAAsB,mBAAmB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC7E;AAEA,WAAO;AAAA,EACR;AACA,SAAO;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [entityList, { update }] = useAccessorUpdateSubscription(getEntityList)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":[],"mappings":";;;;;;;AAaA,SAAS,cACR,2BACiC;AACjC,QAAM,qBAAqB,+BAA+B,yBAAyB;AACnF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAY,aAAA;AAClB,QAAM,iBAAiB,kBAAA;AACvB,QAAM,gBAAgB,YAAY,MAAM;AACvC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,cAAc,kBAAmB;AAAA,EAChD,GAAG,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AACvB;AAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IAAA;AAED,UAAM,CAAC,YAAY,EAAE,QAAQ,IAAI,8BAA8B,aAAa;AAE5E,QAAI,mBAAmB,mBAAmB,QAAQ;AACjD,4BAAsB,mBAAmB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC7E;AAEA,WAAO;AAAA,EACR;AACA,SAAO;AACR;"}
|
|
1
|
+
{"version":3,"file":"useEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index.js'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents/index.js'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription.js'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList.js'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [entityList, { update }] = useAccessorUpdateSubscription(getEntityList)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":[],"mappings":";;;;;;;AAaA,SAAS,cACR,2BACiC;AACjC,QAAM,qBAAqB,+BAA+B,yBAAyB;AACnF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAY,aAAA;AAClB,QAAM,iBAAiB,kBAAA;AACvB,QAAM,gBAAgB,YAAY,MAAM;AACvC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,cAAc,kBAAmB;AAAA,EAChD,GAAG,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AACvB;AAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IAAA;AAED,UAAM,CAAC,YAAY,EAAE,QAAQ,IAAI,8BAA8B,aAAa;AAE5E,QAAI,mBAAmB,mBAAmB,QAAQ;AACjD,4BAAsB,mBAAmB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC7E;AAEA,WAAO;AAAA,EACR;AACA,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntityListSubTree","useEntityListSubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAQO,MAAM,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAaA,wBAAAA,wBAAA;AACnB,QAAM,aAAaC,+BAAAA,+BAA+B,mBAAmB;AACrE,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAAA;AAAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAO9C,SAAOC,8BAAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;;"}
|
|
1
|
+
{"version":3,"file":"useEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription.js'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters.js'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree.js'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntityListSubTree","useEntityListSubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAQO,MAAM,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAaA,wBAAAA,wBAAA;AACnB,QAAM,aAAaC,+BAAAA,+BAA+B,mBAAmB;AACrE,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAAA;AAAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAO9C,SAAOC,8BAAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAQO,MAAM,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAa,wBAAA;AACnB,QAAM,aAAa,+BAA+B,mBAAmB;AACrE,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAO9C,SAAO,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
|
|
1
|
+
{"version":3,"file":"useEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription.js'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters.js'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree.js'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAQO,MAAM,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAa,wBAAA;AACnB,QAAM,aAAa,+BAA+B,mBAAmB;AACrE,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAO9C,SAAO,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\nimport { useEnvironment } from './useEnvironment'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntityListSubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntityListSubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\nexport type UseEntityListSubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderState<State> =\n\t| UseEntityListSubTreeLoaderStateInitial\n\t| UseEntityListSubTreeLoaderStateLoading\n\t| UseEntityListSubTreeLoaderStateRefreshing<State>\n\t| UseEntityListSubTreeLoaderStateLoaded<State>\n\t| UseEntityListSubTreeLoaderStateFailed\n\nexport type UseEntityListSubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedEntityList\n\nexport const useEntityListSubTreeLoader = <State>(\n\tentities: SugaredQualifiedEntityList | undefined,\n\tchildren: ReactNode,\n\tstate?: State,\n): [UseEntityListSubTreeLoaderState<State>, UseEntityListSubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<\n\t\t{\n\t\t\tentities: SugaredQualifiedEntityList\n\t\t\tstate?: State\n\t\t} | undefined\n\t>(undefined)\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntities = useObjectMemo(entities ?? emptyObject)\n\tconst resolvedEntities = entities ? memoizedEntities : undefined\n\n\tuseEffect(() => {\n\t\t;(async () => {\n\t\t\tif (!resolvedEntities) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities: resolvedEntities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...resolvedEntities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentities: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentities: resolvedEntities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntities, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntityListSubTree","useCallback"],"mappings":";;;;;;AA2DA,MAAM,cAAc,CAAA;AAEb,MAAM,6BAA6B,CACzC,UACA,UACA,UACsF;AACtF,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAAiD;AAAA,IAC5F,OAAO;AAAA,IACP,WAAW;AAAA,IACX,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmBC,MAAAA,OAKvB,MAAS;AAEX,QAAM,aAAaC,cAAAA,cAAA;AACnB,QAAM,CAAC,eAAe,gBAAgB,IAAIF,MAAAA,SAAwB,IAAI;AACtE,QAAM,mBAAmBG,WAAAA,cAAc,YAAY,WAAW;AAC9D,QAAM,mBAAmB,WAAW,mBAAmB;AAEvDC,QAAAA,UAAU,MAAM;AACd,KAAC,YAAY;AACb,UAAI,CAAC,kBAAkB;AACtB;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B,UAAU;AAAA,QACV;AAAA,MAAA;AAGD,wBAAkB,CAAA,OAAM;AACvB,YAAI,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AAC9E,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET,OAAO;AACN,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET;AAAA,MACD,CAAC;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,kBAAAA,mBAAmB;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAA,MAAK;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAE3B,8BAAkB;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,UAAU;AAAA,cACV,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UACF;AAAA,QAAA;AAAA,MACD;AAGD,UAAI,eAAe;AAClB,yBAAiB,UAAU;AAC3B,0BAAkB;AAAA,UACjB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MACF;AAAA,IACD,GAAA;AAAA,EACD,GAAG,CAAC,YAAY,kBAAkB,UAAU,OAAO,aAAa,CAAC;AAEjE,SAAO;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQC,MAAAA,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAA,CAAE;AAAA,IAAA;AAAA,EACnD;AAEF;;"}
|
|
1
|
+
{"version":3,"file":"useEntityListSubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree.js'\nimport { EntityListSubTree } from '../coreComponents/index.js'\nimport { useEnvironment } from './useEnvironment.js'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntityListSubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntityListSubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\nexport type UseEntityListSubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderState<State> =\n\t| UseEntityListSubTreeLoaderStateInitial\n\t| UseEntityListSubTreeLoaderStateLoading\n\t| UseEntityListSubTreeLoaderStateRefreshing<State>\n\t| UseEntityListSubTreeLoaderStateLoaded<State>\n\t| UseEntityListSubTreeLoaderStateFailed\n\nexport type UseEntityListSubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedEntityList\n\nexport const useEntityListSubTreeLoader = <State>(\n\tentities: SugaredQualifiedEntityList | undefined,\n\tchildren: ReactNode,\n\tstate?: State,\n): [UseEntityListSubTreeLoaderState<State>, UseEntityListSubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<\n\t\t{\n\t\t\tentities: SugaredQualifiedEntityList\n\t\t\tstate?: State\n\t\t} | undefined\n\t>(undefined)\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntities = useObjectMemo(entities ?? emptyObject)\n\tconst resolvedEntities = entities ? memoizedEntities : undefined\n\n\tuseEffect(() => {\n\t\t;(async () => {\n\t\t\tif (!resolvedEntities) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities: resolvedEntities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...resolvedEntities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentities: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentities: resolvedEntities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntities, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntityListSubTree","useCallback"],"mappings":";;;;;;AA2DA,MAAM,cAAc,CAAA;AAEb,MAAM,6BAA6B,CACzC,UACA,UACA,UACsF;AACtF,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAAiD;AAAA,IAC5F,OAAO;AAAA,IACP,WAAW;AAAA,IACX,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmBC,MAAAA,OAKvB,MAAS;AAEX,QAAM,aAAaC,cAAAA,cAAA;AACnB,QAAM,CAAC,eAAe,gBAAgB,IAAIF,MAAAA,SAAwB,IAAI;AACtE,QAAM,mBAAmBG,WAAAA,cAAc,YAAY,WAAW;AAC9D,QAAM,mBAAmB,WAAW,mBAAmB;AAEvDC,QAAAA,UAAU,MAAM;AACd,KAAC,YAAY;AACb,UAAI,CAAC,kBAAkB;AACtB;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B,UAAU;AAAA,QACV;AAAA,MAAA;AAGD,wBAAkB,CAAA,OAAM;AACvB,YAAI,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AAC9E,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET,OAAO;AACN,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET;AAAA,MACD,CAAC;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,kBAAAA,mBAAmB;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAA,MAAK;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAE3B,8BAAkB;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,UAAU;AAAA,cACV,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UACF;AAAA,QAAA;AAAA,MACD;AAGD,UAAI,eAAe;AAClB,yBAAiB,UAAU;AAC3B,0BAAkB;AAAA,UACjB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MACF;AAAA,IACD,GAAA;AAAA,EACD,GAAG,CAAC,YAAY,kBAAkB,UAAU,OAAO,aAAa,CAAC;AAEjE,SAAO;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQC,MAAAA,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAA,CAAE;AAAA,IAAA;AAAA,EACnD;AAEF;;"}
|