@contember/binding 1.0.0-rc.20 → 1.0.0-rc.23
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/BindingError.js +0 -1
- package/dist/development/BindingError.js.map +1 -1
- package/dist/development/accessorPropagation/AccessorProvider.js +3 -5
- package/dist/development/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/development/accessorPropagation/BindingOperationsContext.js +2 -4
- package/dist/development/accessorPropagation/BindingOperationsContext.js.map +1 -1
- package/dist/development/accessorPropagation/BindingOperationsProvider.js +2 -4
- package/dist/development/accessorPropagation/BindingOperationsProvider.js.map +1 -1
- package/dist/development/accessorPropagation/EntityKeyContext.js +1 -3
- package/dist/development/accessorPropagation/EntityKeyContext.js.map +1 -1
- package/dist/development/accessorPropagation/EntityKeyProvider.js +2 -4
- package/dist/development/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/development/accessorPropagation/EnvironmentContext.js +2 -4
- package/dist/development/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/development/accessorPropagation/TreeRootIdContext.js +1 -3
- package/dist/development/accessorPropagation/TreeRootIdContext.js.map +1 -1
- package/dist/development/accessorPropagation/TreeRootIdProvider.js +2 -4
- package/dist/development/accessorPropagation/TreeRootIdProvider.js.map +1 -1
- package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js +2 -4
- package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
- package/dist/development/accessorPropagation/useBindingOperations.js +2 -4
- package/dist/development/accessorPropagation/useBindingOperations.js.map +1 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js +3 -5
- package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js +3 -5
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js +3 -5
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
- package/dist/development/accessorPropagation/useEntity.js +7 -9
- package/dist/development/accessorPropagation/useEntity.js.map +1 -1
- package/dist/development/accessorPropagation/useEntityKey.js +3 -5
- package/dist/development/accessorPropagation/useEntityKey.js.map +1 -1
- package/dist/development/accessorPropagation/useEntityList.js +7 -9
- package/dist/development/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/development/accessorPropagation/useEntityListSubTree.js +4 -6
- package/dist/development/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js +2 -4
- package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
- package/dist/development/accessorPropagation/useEntitySubTree.js +4 -6
- package/dist/development/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useEntitySubTreeParameters.js +2 -4
- package/dist/development/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
- package/dist/development/accessorPropagation/useEnvironment.js +2 -4
- package/dist/development/accessorPropagation/useEnvironment.js.map +1 -1
- package/dist/development/accessorPropagation/useField.js +7 -9
- package/dist/development/accessorPropagation/useField.js.map +1 -1
- package/dist/development/accessorPropagation/useGetEntityByKey.js +1 -3
- package/dist/development/accessorPropagation/useGetEntityByKey.js.map +1 -1
- package/dist/development/accessorPropagation/useGetEntityListSubTree.js +4 -6
- package/dist/development/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useGetEntitySubTree.js +4 -6
- package/dist/development/accessorPropagation/useGetEntitySubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useGetTreeFilters.js +1 -3
- package/dist/development/accessorPropagation/useGetTreeFilters.js.map +1 -1
- package/dist/development/accessorPropagation/useHasEntity.js +2 -4
- package/dist/development/accessorPropagation/useHasEntity.js.map +1 -1
- package/dist/development/accessorPropagation/usePersist.js +1 -3
- package/dist/development/accessorPropagation/usePersist.js.map +1 -1
- package/dist/development/accessorPropagation/useTreeRootId.js +2 -4
- package/dist/development/accessorPropagation/useTreeRootId.js.map +1 -1
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js +9 -11
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/development/accessorSorting/addEntityAtIndex.js +2 -4
- package/dist/development/accessorSorting/addEntityAtIndex.js.map +1 -1
- package/dist/development/accessorSorting/errors.js +1 -3
- package/dist/development/accessorSorting/errors.js.map +1 -1
- package/dist/development/accessorSorting/moveEntity.js +1 -3
- package/dist/development/accessorSorting/moveEntity.js.map +1 -1
- package/dist/development/accessorSorting/repairEntitiesOrder.js +0 -1
- package/dist/development/accessorSorting/repairEntitiesOrder.js.map +1 -1
- package/dist/development/accessorSorting/sortEntities.js +0 -1
- package/dist/development/accessorSorting/sortEntities.js.map +1 -1
- package/dist/development/accessorSorting/useSortedEntities.js +6 -8
- package/dist/development/accessorSorting/useSortedEntities.js.map +1 -1
- package/dist/development/accessorTree/AccessorTree.js +4 -6
- package/dist/development/accessorTree/AccessorTree.js.map +1 -1
- package/dist/development/accessorTree/DirtinessContext.js +1 -3
- package/dist/development/accessorTree/DirtinessContext.js.map +1 -1
- package/dist/development/accessorTree/MutationStateContext.js +1 -3
- package/dist/development/accessorTree/MutationStateContext.js.map +1 -1
- package/dist/development/accessorTree/NormalizedPersistedData.js +0 -1
- package/dist/development/accessorTree/NormalizedPersistedData.js.map +1 -1
- package/dist/development/accessorTree/RuntimeId.js +22 -17
- package/dist/development/accessorTree/RuntimeId.js.map +1 -1
- package/dist/development/accessorTree/accessorTreeStateReducer.js +0 -1
- package/dist/development/accessorTree/accessorTreeStateReducer.js.map +1 -1
- package/dist/development/accessorTree/metadataToRequestError.js +0 -1
- package/dist/development/accessorTree/metadataToRequestError.js.map +1 -1
- package/dist/development/accessorTree/useDataBinding.js +5 -7
- package/dist/development/accessorTree/useDataBinding.js.map +1 -1
- package/dist/development/accessorTree/useDirtinessState.js +2 -4
- package/dist/development/accessorTree/useDirtinessState.js.map +1 -1
- package/dist/development/accessorTree/useMutationState.js +2 -4
- package/dist/development/accessorTree/useMutationState.js.map +1 -1
- package/dist/development/accessors/EntityAccessor.js +5 -7
- package/dist/development/accessors/EntityAccessor.js.map +1 -1
- package/dist/development/accessors/EntityListAccessor.js +1 -3
- package/dist/development/accessors/EntityListAccessor.js.map +1 -1
- package/dist/development/accessors/ErrorAccessor.js +0 -1
- package/dist/development/accessors/ErrorAccessor.js.map +1 -1
- package/dist/development/accessors/FieldAccessor.js +3 -5
- package/dist/development/accessors/FieldAccessor.js.map +1 -1
- package/dist/development/accessors/TreeRootAccessor.js +0 -1
- package/dist/development/accessors/TreeRootAccessor.js.map +1 -1
- package/dist/development/bindingTypes.js +0 -1
- package/dist/development/bindingTypes.js.map +1 -1
- package/dist/development/core/AccessorErrorManager.js +15 -11
- package/dist/development/core/AccessorErrorManager.js.map +1 -1
- package/dist/development/core/Config.js +18 -12
- package/dist/development/core/Config.js.map +1 -1
- package/dist/development/core/DataBinding.js +53 -48
- package/dist/development/core/DataBinding.js.map +1 -1
- package/dist/development/core/DirtinessTracker.js +10 -3
- package/dist/development/core/DirtinessTracker.js.map +1 -1
- package/dist/development/core/ErrorsPreprocessor.js +3 -5
- package/dist/development/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/development/core/EventManager.js +20 -16
- package/dist/development/core/EventManager.js.map +1 -1
- package/dist/development/core/IncrementalMarkerBuilder.js +14 -8
- package/dist/development/core/IncrementalMarkerBuilder.js.map +1 -1
- package/dist/development/core/MarkerComparator.js +6 -8
- package/dist/development/core/MarkerComparator.js.map +1 -1
- package/dist/development/core/MarkerMerger.js +17 -15
- package/dist/development/core/MarkerMerger.js.map +1 -1
- package/dist/development/core/MarkerTreeGenerator.js +18 -13
- package/dist/development/core/MarkerTreeGenerator.js.map +1 -1
- package/dist/development/core/MutationGenerator.js +13 -15
- package/dist/development/core/MutationGenerator.js.map +1 -1
- package/dist/development/core/QueryGenerator.js +9 -11
- package/dist/development/core/QueryGenerator.js.map +1 -1
- package/dist/development/core/RealmKeyGenerator.js +10 -6
- package/dist/development/core/RealmKeyGenerator.js.map +1 -1
- package/dist/development/core/RequestResponseNormalizer.js +7 -9
- package/dist/development/core/RequestResponseNormalizer.js.map +1 -1
- package/dist/development/core/StateInitializer.js +27 -23
- package/dist/development/core/StateInitializer.js.map +1 -1
- package/dist/development/core/TreeAugmenter.js +6 -8
- package/dist/development/core/TreeAugmenter.js.map +1 -1
- package/dist/development/core/TreeFilterGenerator.js +8 -8
- package/dist/development/core/TreeFilterGenerator.js.map +1 -1
- package/dist/development/core/TreeParameterMerger.js +2 -4
- package/dist/development/core/TreeParameterMerger.js.map +1 -1
- package/dist/development/core/TreeStore.js +19 -15
- package/dist/development/core/TreeStore.js.map +1 -1
- package/dist/development/core/VariableInputTransformer.js +2 -4
- package/dist/development/core/VariableInputTransformer.js.map +1 -1
- package/dist/development/core/exceptions/ErrorLocator.js +10 -6
- package/dist/development/core/exceptions/ErrorLocator.js.map +1 -1
- package/dist/development/core/exceptions/LocalizedBindingError.js +1 -3
- package/dist/development/core/exceptions/LocalizedBindingError.js.map +1 -1
- package/dist/development/core/exceptions/MarkerSugarer.js +7 -9
- package/dist/development/core/exceptions/MarkerSugarer.js.map +1 -1
- package/dist/development/core/exceptions/TreeParameterSugarer.js +0 -1
- package/dist/development/core/exceptions/TreeParameterSugarer.js.map +1 -1
- package/dist/development/core/factories/createBatchUpdatesOptions.js +1 -3
- package/dist/development/core/factories/createBatchUpdatesOptions.js.map +1 -1
- package/dist/development/core/operations/EntityOperations.js +13 -14
- package/dist/development/core/operations/EntityOperations.js.map +1 -1
- package/dist/development/core/operations/FieldOperations.js +10 -12
- package/dist/development/core/operations/FieldOperations.js.map +1 -1
- package/dist/development/core/operations/ListOperations.js +12 -14
- package/dist/development/core/operations/ListOperations.js.map +1 -1
- package/dist/development/core/operations/OperationsHelpers.js +4 -6
- package/dist/development/core/operations/OperationsHelpers.js.map +1 -1
- package/dist/development/core/requestAliases/MutationAlias.js +2 -4
- package/dist/development/core/requestAliases/MutationAlias.js.map +1 -1
- package/dist/development/core/requestAliases/mutationOperationSubTreeType.js +0 -1
- package/dist/development/core/requestAliases/mutationOperationSubTreeType.js.map +1 -1
- package/dist/development/core/requestAliases/mutationOperationType.js +0 -1
- package/dist/development/core/requestAliases/mutationOperationType.js.map +1 -1
- package/dist/development/core/schema/Schema.js +0 -1
- package/dist/development/core/schema/Schema.js.map +1 -1
- package/dist/development/core/schema/SchemaLoader.js +9 -5
- package/dist/development/core/schema/SchemaLoader.js.map +1 -1
- package/dist/development/core/schema/SchemaPreprocessor.js +0 -1
- package/dist/development/core/schema/SchemaPreprocessor.js.map +1 -1
- package/dist/development/core/schema/SchemaValidator.js +9 -11
- package/dist/development/core/schema/SchemaValidator.js.map +1 -1
- package/dist/development/core/state/StateIterator.js +2 -4
- package/dist/development/core/state/StateIterator.js.map +1 -1
- package/dist/development/core/state/getEntityMarker.js +0 -1
- package/dist/development/core/state/getEntityMarker.js.map +1 -1
- package/dist/development/core/utils/getCombinedSignal.js +0 -1
- package/dist/development/core/utils/getCombinedSignal.js.map +1 -1
- package/dist/development/coreComponents/Component.js +2 -4
- package/dist/development/coreComponents/Component.js.map +1 -1
- package/dist/development/coreComponents/DataBindingProvider.js +3 -5
- package/dist/development/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/development/coreComponents/Entity.js +3 -5
- package/dist/development/coreComponents/Entity.js.map +1 -1
- package/dist/development/coreComponents/EntityList.js +3 -5
- package/dist/development/coreComponents/EntityList.js.map +1 -1
- package/dist/development/coreComponents/EntityListSubTree.js +12 -14
- package/dist/development/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/development/coreComponents/EntitySubTree.js +14 -16
- package/dist/development/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/development/coreComponents/Field.js +5 -7
- package/dist/development/coreComponents/Field.js.map +1 -1
- package/dist/development/coreComponents/HasMany.js +8 -10
- package/dist/development/coreComponents/HasMany.js.map +1 -1
- package/dist/development/coreComponents/HasOne.js +8 -10
- package/dist/development/coreComponents/HasOne.js.map +1 -1
- package/dist/development/coreComponents/ParentEntity.js +3 -5
- package/dist/development/coreComponents/ParentEntity.js.map +1 -1
- package/dist/development/dao/Environment.js +7 -2
- package/dist/development/dao/Environment.js.map +1 -1
- package/dist/development/dao/VariableFieldValue.js +0 -1
- package/dist/development/dao/VariableFieldValue.js.map +1 -1
- package/dist/development/entityEvents/useDerivedField.js +4 -6
- package/dist/development/entityEvents/useDerivedField.js.map +1 -1
- package/dist/development/entityEvents/useEntityBeforePersist.js +1 -3
- package/dist/development/entityEvents/useEntityBeforePersist.js.map +1 -1
- package/dist/development/entityEvents/useEntityBeforeUpdate.js +1 -3
- package/dist/development/entityEvents/useEntityBeforeUpdate.js.map +1 -1
- package/dist/development/entityEvents/useEntityEvent.js +3 -5
- package/dist/development/entityEvents/useEntityEvent.js.map +1 -1
- package/dist/development/entityEvents/useEntityPersistError.js +1 -3
- package/dist/development/entityEvents/useEntityPersistError.js.map +1 -1
- package/dist/development/entityEvents/useEntityPersistSuccess.js +1 -3
- package/dist/development/entityEvents/useEntityPersistSuccess.js.map +1 -1
- package/dist/development/entityEvents/useOnConnectionUpdate.js +1 -3
- package/dist/development/entityEvents/useOnConnectionUpdate.js.map +1 -1
- package/dist/development/fieldHelpers/helpers/FieldHelper.js +8 -4
- package/dist/development/fieldHelpers/helpers/FieldHelper.js.map +1 -1
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.js +1 -3
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -1
- package/dist/development/fieldHelpers/helpers/UuidFieldHelper.js +2 -4
- package/dist/development/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -1
- package/dist/development/helperComponents/DeferredSubTrees.js +9 -11
- package/dist/development/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/development/helperComponents/EntityView.js +2 -4
- package/dist/development/helperComponents/EntityView.js.map +1 -1
- package/dist/development/helperComponents/FieldView.js +7 -9
- package/dist/development/helperComponents/FieldView.js.map +1 -1
- package/dist/development/helperComponents/StaticRender.js +2 -4
- package/dist/development/helperComponents/StaticRender.js.map +1 -1
- package/dist/development/helperComponents/SugaredField.js +3 -5
- package/dist/development/helperComponents/SugaredField.js.map +1 -1
- package/dist/development/index.js +101 -101
- package/dist/development/index.js.map +1 -1
- package/dist/development/markers/EntityFieldMarkersContainer.js +5 -7
- package/dist/development/markers/EntityFieldMarkersContainer.js.map +1 -1
- package/dist/development/markers/EntityFieldsWithHoistablesMarker.js +0 -1
- package/dist/development/markers/EntityFieldsWithHoistablesMarker.js.map +1 -1
- package/dist/development/markers/EntityListSubTreeMarker.js +8 -4
- package/dist/development/markers/EntityListSubTreeMarker.js.map +1 -1
- package/dist/development/markers/EntitySubTreeMarker.js +8 -4
- package/dist/development/markers/EntitySubTreeMarker.js.map +1 -1
- package/dist/development/markers/FieldMarker.js +8 -4
- package/dist/development/markers/FieldMarker.js.map +1 -1
- package/dist/development/markers/HasManyRelationMarker.js +9 -5
- package/dist/development/markers/HasManyRelationMarker.js.map +1 -1
- package/dist/development/markers/HasOneRelationMarker.js +8 -4
- package/dist/development/markers/HasOneRelationMarker.js.map +1 -1
- package/dist/development/markers/MarkerTreeRoot.js +0 -1
- package/dist/development/markers/MarkerTreeRoot.js.map +1 -1
- package/dist/development/markers/ParentEntityMarker.js +0 -1
- package/dist/development/markers/ParentEntityMarker.js.map +1 -1
- package/dist/development/markers/PlaceholderGenerator.js +1 -3
- package/dist/development/markers/PlaceholderGenerator.js.map +1 -1
- package/dist/development/queryLanguage/CacheStore.js +10 -4
- package/dist/development/queryLanguage/CacheStore.js.map +1 -1
- package/dist/development/queryLanguage/MarkerFactory.js +11 -13
- package/dist/development/queryLanguage/MarkerFactory.js.map +1 -1
- package/dist/development/queryLanguage/Parser.js +561 -556
- package/dist/development/queryLanguage/Parser.js.map +1 -1
- package/dist/development/queryLanguage/QueryLanguage.js +32 -27
- package/dist/development/queryLanguage/QueryLanguage.js.map +1 -1
- package/dist/development/queryLanguage/QueryLanguageError.js +0 -1
- package/dist/development/queryLanguage/QueryLanguageError.js.map +1 -1
- package/dist/development/queryLanguage/tokenList.js +1 -3
- package/dist/development/queryLanguage/tokenList.js.map +1 -1
- package/dist/development/structures/BijectiveIndexedMap.js +14 -9
- package/dist/development/structures/BijectiveIndexedMap.js.map +1 -1
- package/dist/development/structures/LRUCache.js +7 -2
- package/dist/development/structures/LRUCache.js.map +1 -1
- package/dist/development/structures/WeakIdCache.js +11 -4
- package/dist/development/structures/WeakIdCache.js.map +1 -1
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.js +1 -3
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.js.map +1 -1
- package/dist/development/treeParameters/EntityCreationParameters.js +0 -1
- package/dist/development/treeParameters/EntityCreationParameters.js.map +1 -1
- package/dist/development/treeParameters/EntityListPreferences.js +0 -1
- package/dist/development/treeParameters/EntityListPreferences.js.map +1 -1
- package/dist/development/treeParameters/EventListenersStore.js +0 -1
- package/dist/development/treeParameters/EventListenersStore.js.map +1 -1
- package/dist/development/treeParameters/LeafField.js +0 -1
- package/dist/development/treeParameters/LeafField.js.map +1 -1
- package/dist/development/treeParameters/QualifiedEntityParameters.js +0 -1
- package/dist/development/treeParameters/QualifiedEntityParameters.js.map +1 -1
- package/dist/development/treeParameters/Relation.js +0 -1
- package/dist/development/treeParameters/Relation.js.map +1 -1
- package/dist/development/utils/Hashing.js +0 -1
- package/dist/development/utils/Hashing.js.map +1 -1
- package/dist/development/utils/assert.js +1 -3
- package/dist/development/utils/assert.js.map +1 -1
- package/dist/development/utils/assertNever.js +1 -3
- package/dist/development/utils/assertNever.js.map +1 -1
- package/dist/development/utils/generateEnumerabilityPreventingEntropy.js +0 -1
- package/dist/development/utils/generateEnumerabilityPreventingEntropy.js.map +1 -1
- package/dist/development/utils/isEmptyObject.js +0 -1
- package/dist/development/utils/isEmptyObject.js.map +1 -1
- package/dist/development/utils/ucfirst.js +0 -1
- package/dist/development/utils/ucfirst.js.map +1 -1
- package/dist/production/BindingError.js.map +1 -1
- package/dist/production/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/production/accessorPropagation/BindingOperationsContext.js.map +1 -1
- package/dist/production/accessorPropagation/BindingOperationsProvider.js.map +1 -1
- package/dist/production/accessorPropagation/EntityKeyContext.js.map +1 -1
- package/dist/production/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/production/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/production/accessorPropagation/TreeRootIdContext.js.map +1 -1
- package/dist/production/accessorPropagation/TreeRootIdProvider.js.map +1 -1
- package/dist/production/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
- package/dist/production/accessorPropagation/useBindingOperations.js.map +1 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
- package/dist/production/accessorPropagation/useEntity.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityKey.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
- package/dist/production/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
- package/dist/production/accessorPropagation/useEnvironment.js.map +1 -1
- package/dist/production/accessorPropagation/useField.js.map +1 -1
- package/dist/production/accessorPropagation/useGetEntityByKey.js.map +1 -1
- package/dist/production/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useGetEntitySubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useGetTreeFilters.js.map +1 -1
- package/dist/production/accessorPropagation/useHasEntity.js.map +1 -1
- package/dist/production/accessorPropagation/usePersist.js.map +1 -1
- package/dist/production/accessorPropagation/useTreeRootId.js.map +1 -1
- package/dist/production/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/production/accessorSorting/addEntityAtIndex.js.map +1 -1
- package/dist/production/accessorSorting/errors.js.map +1 -1
- package/dist/production/accessorSorting/moveEntity.js.map +1 -1
- package/dist/production/accessorSorting/repairEntitiesOrder.js.map +1 -1
- package/dist/production/accessorSorting/sortEntities.js.map +1 -1
- package/dist/production/accessorSorting/useSortedEntities.js.map +1 -1
- package/dist/production/accessorTree/AccessorTree.js.map +1 -1
- package/dist/production/accessorTree/DirtinessContext.js.map +1 -1
- package/dist/production/accessorTree/MutationStateContext.js.map +1 -1
- package/dist/production/accessorTree/NormalizedPersistedData.js.map +1 -1
- package/dist/production/accessorTree/RuntimeId.js.map +1 -1
- package/dist/production/accessorTree/accessorTreeStateReducer.js.map +1 -1
- package/dist/production/accessorTree/metadataToRequestError.js.map +1 -1
- package/dist/production/accessorTree/useDataBinding.js.map +1 -1
- package/dist/production/accessorTree/useDirtinessState.js.map +1 -1
- package/dist/production/accessorTree/useMutationState.js.map +1 -1
- package/dist/production/accessors/EntityAccessor.js.map +1 -1
- package/dist/production/accessors/EntityListAccessor.js.map +1 -1
- package/dist/production/accessors/ErrorAccessor.js.map +1 -1
- package/dist/production/accessors/FieldAccessor.js.map +1 -1
- package/dist/production/accessors/TreeRootAccessor.js.map +1 -1
- package/dist/production/bindingTypes.js.map +1 -1
- package/dist/production/core/AccessorErrorManager.js.map +1 -1
- package/dist/production/core/Config.js.map +1 -1
- package/dist/production/core/DataBinding.js.map +1 -1
- package/dist/production/core/DirtinessTracker.js.map +1 -1
- package/dist/production/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/production/core/EventManager.js.map +1 -1
- package/dist/production/core/IncrementalMarkerBuilder.js.map +1 -1
- package/dist/production/core/MarkerComparator.js.map +1 -1
- package/dist/production/core/MarkerMerger.js.map +1 -1
- package/dist/production/core/MarkerTreeGenerator.js.map +1 -1
- package/dist/production/core/MutationGenerator.js.map +1 -1
- package/dist/production/core/QueryGenerator.js.map +1 -1
- package/dist/production/core/RealmKeyGenerator.js.map +1 -1
- package/dist/production/core/RequestResponseNormalizer.js.map +1 -1
- package/dist/production/core/StateInitializer.js.map +1 -1
- package/dist/production/core/TreeAugmenter.js.map +1 -1
- package/dist/production/core/TreeFilterGenerator.js.map +1 -1
- package/dist/production/core/TreeParameterMerger.js.map +1 -1
- package/dist/production/core/TreeStore.js.map +1 -1
- package/dist/production/core/VariableInputTransformer.js.map +1 -1
- package/dist/production/core/exceptions/ErrorLocator.js.map +1 -1
- package/dist/production/core/exceptions/LocalizedBindingError.js.map +1 -1
- package/dist/production/core/exceptions/MarkerSugarer.js.map +1 -1
- package/dist/production/core/exceptions/TreeParameterSugarer.js.map +1 -1
- package/dist/production/core/factories/createBatchUpdatesOptions.js.map +1 -1
- package/dist/production/core/operations/EntityOperations.js.map +1 -1
- package/dist/production/core/operations/FieldOperations.js.map +1 -1
- package/dist/production/core/operations/ListOperations.js.map +1 -1
- package/dist/production/core/operations/OperationsHelpers.js.map +1 -1
- package/dist/production/core/requestAliases/MutationAlias.js.map +1 -1
- package/dist/production/core/requestAliases/mutationOperationSubTreeType.js.map +1 -1
- package/dist/production/core/requestAliases/mutationOperationType.js.map +1 -1
- package/dist/production/core/schema/Schema.js.map +1 -1
- package/dist/production/core/schema/SchemaLoader.js.map +1 -1
- package/dist/production/core/schema/SchemaPreprocessor.js.map +1 -1
- package/dist/production/core/state/StateIterator.js.map +1 -1
- package/dist/production/core/state/getEntityMarker.js.map +1 -1
- package/dist/production/core/utils/getCombinedSignal.js.map +1 -1
- package/dist/production/coreComponents/Component.js.map +1 -1
- package/dist/production/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/production/coreComponents/Entity.js.map +1 -1
- package/dist/production/coreComponents/EntityList.js.map +1 -1
- package/dist/production/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/production/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/production/coreComponents/Field.js.map +1 -1
- package/dist/production/coreComponents/HasMany.js.map +1 -1
- package/dist/production/coreComponents/HasOne.js.map +1 -1
- package/dist/production/coreComponents/ParentEntity.js.map +1 -1
- package/dist/production/dao/Environment.js.map +1 -1
- package/dist/production/dao/VariableFieldValue.js.map +1 -1
- package/dist/production/entityEvents/useDerivedField.js.map +1 -1
- package/dist/production/entityEvents/useEntityBeforePersist.js.map +1 -1
- package/dist/production/entityEvents/useEntityBeforeUpdate.js.map +1 -1
- package/dist/production/entityEvents/useEntityEvent.js.map +1 -1
- package/dist/production/entityEvents/useEntityPersistError.js.map +1 -1
- package/dist/production/entityEvents/useEntityPersistSuccess.js.map +1 -1
- package/dist/production/entityEvents/useOnConnectionUpdate.js.map +1 -1
- package/dist/production/fieldHelpers/helpers/FieldHelper.js.map +1 -1
- package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -1
- package/dist/production/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -1
- package/dist/production/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/production/helperComponents/EntityView.js.map +1 -1
- package/dist/production/helperComponents/FieldView.js.map +1 -1
- package/dist/production/helperComponents/StaticRender.js.map +1 -1
- package/dist/production/helperComponents/SugaredField.js.map +1 -1
- package/dist/production/markers/EntityFieldMarkersContainer.js.map +1 -1
- package/dist/production/markers/EntityFieldsWithHoistablesMarker.js.map +1 -1
- package/dist/production/markers/EntityListSubTreeMarker.js.map +1 -1
- package/dist/production/markers/EntitySubTreeMarker.js.map +1 -1
- package/dist/production/markers/FieldMarker.js.map +1 -1
- package/dist/production/markers/HasManyRelationMarker.js.map +1 -1
- package/dist/production/markers/HasOneRelationMarker.js.map +1 -1
- package/dist/production/markers/MarkerTreeRoot.js.map +1 -1
- package/dist/production/markers/ParentEntityMarker.js.map +1 -1
- package/dist/production/markers/PlaceholderGenerator.js.map +1 -1
- package/dist/production/queryLanguage/CacheStore.js.map +1 -1
- package/dist/production/queryLanguage/MarkerFactory.js.map +1 -1
- package/dist/production/queryLanguage/Parser.js.map +1 -1
- package/dist/production/queryLanguage/QueryLanguage.js.map +1 -1
- package/dist/production/queryLanguage/QueryLanguageError.js.map +1 -1
- package/dist/production/queryLanguage/tokenList.js.map +1 -1
- package/dist/production/structures/BijectiveIndexedMap.js.map +1 -1
- package/dist/production/structures/LRUCache.js.map +1 -1
- package/dist/production/structures/WeakIdCache.js.map +1 -1
- package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.js.map +1 -1
- package/dist/production/treeParameters/EntityCreationParameters.js.map +1 -1
- package/dist/production/treeParameters/EntityListPreferences.js.map +1 -1
- package/dist/production/treeParameters/EventListenersStore.js.map +1 -1
- package/dist/production/treeParameters/LeafField.js.map +1 -1
- package/dist/production/treeParameters/QualifiedEntityParameters.js.map +1 -1
- package/dist/production/treeParameters/Relation.js.map +1 -1
- package/dist/production/utils/Hashing.js.map +1 -1
- package/dist/production/utils/assert.js.map +1 -1
- package/dist/production/utils/assertNever.js.map +1 -1
- package/dist/production/utils/generateEnumerabilityPreventingEntropy.js.map +1 -1
- package/dist/production/utils/isEmptyObject.js.map +1 -1
- package/dist/production/utils/ucfirst.js.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/tsconfig.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateIterator.js","sources":["../../../../src/core/state/StateIterator.ts"],"sourcesContent":["import { FieldMarker, HasManyRelationMarker, HasOneRelationMarker } from '../../markers'\nimport type { FieldValue, PlaceholderName } from '../../treeParameters'\nimport { assertNever } from '../../utils'\nimport type { TreeStore } from '../TreeStore'\nimport type { EntityListState } from './EntityListState'\nimport type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\nimport type { FieldState } from './FieldState'\nimport { getEntityMarker } from './getEntityMarker'\nimport type { RootStateNode, StateINode, StateNode } from './StateNode'\n\nexport class StateIterator {\n\tpublic static *eachSiblingRealm(\n\t\tstate: EntityRealmState,\n\t\trelevantPlaceholder?: PlaceholderName,\n\t): IterableIterator<EntityRealmState> {\n\t\tfor (let [realmKey, realm] of state.entity.realms) {\n\t\t\tif (realm.type === 'entityRealmStub') {\n\t\t\t\tif (relevantPlaceholder === undefined || getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {\n\t\t\t\t\trealm.getAccessor()\n\t\t\t\t\trealm = state.entity.realms.get(realmKey) as EntityRealmState\n\t\t\t\t} else {\n\t\t\t\t\t// This realm is irrelevant. No need to force-initialize it.\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield realm\n\t\t}\n\t}\n\n\t// Note that this only yields siblings with the same placeholderName!\n\tpublic static *eachSiblingRealmChild<Value extends FieldValue, S extends EntityListState | FieldState<Value>>(\n\t\ttreeStore: TreeStore,\n\t\tstate: S & StateNode<Value>,\n\t): IterableIterator<S> {\n\t\tif (state.type === 'entityList' && state.blueprint.parent === undefined) {\n\t\t\t// Top-level entity list\n\t\t\tfor (const [, rootStates] of treeStore.subTreeStatesByRoot) {\n\t\t\t\tconst rootList = rootStates.get(state.blueprint.marker.placeholderName)\n\t\t\t\tif (rootList?.type === 'entityList') {\n\t\t\t\t\tyield rootList as S\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet closestEntityRealm: EntityRealmState\n\t\tlet placeholderName: PlaceholderName\n\n\t\tif (state.type === 'field') {\n\t\t\tclosestEntityRealm = state.parent\n\t\t\tplaceholderName = state.placeholderName\n\t\t} else if (state.type === 'entityList') {\n\t\t\tclosestEntityRealm = state.blueprint.parent! // The parent-less case is handled above. Hence the assertion.\n\t\t\tplaceholderName = state.blueprint.marker.placeholderName\n\t\t} else {\n\t\t\treturn assertNever(state)\n\t\t}\n\n\t\tfor (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {\n\t\t\tconst child = realm.children.get(placeholderName)\n\t\t\tif (child === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (child.type === state.type) {\n\t\t\t\tyield child as S\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static *depthFirstAllNodes(root: StateNode): IterableIterator<StateNode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tswitch (childState.type) {\n\t\t\t\t\t\tcase 'field':\n\t\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tyield* this.depthFirstAllNodes(childState)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'entityRealmStub':\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(childState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'field':\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tyield root\n\t}\n\n\tpublic static *depthFirstINodes(\n\t\troot: StateINode,\n\t\tmatch?: (iNode: StateINode) => boolean,\n\t): IterableIterator<StateINode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tif (childState.type === 'entityRealm' || childState.type === 'entityList') {\n\t\t\t\t\t\tyield* this.depthFirstINodes(childState, match)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tif (match === undefined || match(root)) {\n\t\t\tyield root\n\t\t}\n\t}\n\n\tpublic static *eachRootState(treeStore: TreeStore): IterableIterator<[PlaceholderName, RootStateNode]> {\n\t\tfor (const rootStates of treeStore.subTreeStatesByRoot.values()) {\n\t\t\tyield* rootStates.entries()\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"StateIterator.js","sources":["../../../../src/core/state/StateIterator.ts"],"sourcesContent":["import { FieldMarker, HasManyRelationMarker, HasOneRelationMarker } from '../../markers'\nimport type { FieldValue, PlaceholderName } from '../../treeParameters'\nimport { assertNever } from '../../utils'\nimport type { TreeStore } from '../TreeStore'\nimport type { EntityListState } from './EntityListState'\nimport type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\nimport type { FieldState } from './FieldState'\nimport { getEntityMarker } from './getEntityMarker'\nimport type { RootStateNode, StateINode, StateNode } from './StateNode'\n\nexport class StateIterator {\n\tpublic static *eachSiblingRealm(\n\t\tstate: EntityRealmState,\n\t\trelevantPlaceholder?: PlaceholderName,\n\t): IterableIterator<EntityRealmState> {\n\t\tfor (let [realmKey, realm] of state.entity.realms) {\n\t\t\tif (realm.type === 'entityRealmStub') {\n\t\t\t\tif (relevantPlaceholder === undefined || getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {\n\t\t\t\t\trealm.getAccessor()\n\t\t\t\t\trealm = state.entity.realms.get(realmKey) as EntityRealmState\n\t\t\t\t} else {\n\t\t\t\t\t// This realm is irrelevant. No need to force-initialize it.\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield realm\n\t\t}\n\t}\n\n\t// Note that this only yields siblings with the same placeholderName!\n\tpublic static *eachSiblingRealmChild<Value extends FieldValue, S extends EntityListState | FieldState<Value>>(\n\t\ttreeStore: TreeStore,\n\t\tstate: S & StateNode<Value>,\n\t): IterableIterator<S> {\n\t\tif (state.type === 'entityList' && state.blueprint.parent === undefined) {\n\t\t\t// Top-level entity list\n\t\t\tfor (const [, rootStates] of treeStore.subTreeStatesByRoot) {\n\t\t\t\tconst rootList = rootStates.get(state.blueprint.marker.placeholderName)\n\t\t\t\tif (rootList?.type === 'entityList') {\n\t\t\t\t\tyield rootList as S\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet closestEntityRealm: EntityRealmState\n\t\tlet placeholderName: PlaceholderName\n\n\t\tif (state.type === 'field') {\n\t\t\tclosestEntityRealm = state.parent\n\t\t\tplaceholderName = state.placeholderName\n\t\t} else if (state.type === 'entityList') {\n\t\t\tclosestEntityRealm = state.blueprint.parent! // The parent-less case is handled above. Hence the assertion.\n\t\t\tplaceholderName = state.blueprint.marker.placeholderName\n\t\t} else {\n\t\t\treturn assertNever(state)\n\t\t}\n\n\t\tfor (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {\n\t\t\tconst child = realm.children.get(placeholderName)\n\t\t\tif (child === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (child.type === state.type) {\n\t\t\t\tyield child as S\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static *depthFirstAllNodes(root: StateNode): IterableIterator<StateNode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tswitch (childState.type) {\n\t\t\t\t\t\tcase 'field':\n\t\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tyield* this.depthFirstAllNodes(childState)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'entityRealmStub':\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(childState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'field':\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tyield root\n\t}\n\n\tpublic static *depthFirstINodes(\n\t\troot: StateINode,\n\t\tmatch?: (iNode: StateINode) => boolean,\n\t): IterableIterator<StateINode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tif (childState.type === 'entityRealm' || childState.type === 'entityList') {\n\t\t\t\t\t\tyield* this.depthFirstINodes(childState, match)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tif (match === undefined || match(root)) {\n\t\t\tyield root\n\t\t}\n\t}\n\n\tpublic static *eachRootState(treeStore: TreeStore): IterableIterator<[PlaceholderName, RootStateNode]> {\n\t\tfor (const rootStates of treeStore.subTreeStatesByRoot.values()) {\n\t\t\tyield* rootStates.entries()\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAUO,MAAM,cAAc;AAAA,UACX,iBACd,OACA,qBACqC;AACrC,aAAS,CAAC,UAAU,UAAU,MAAM,OAAO,QAAQ;AAC9C,UAAA,MAAM,SAAS,mBAAmB;AACjC,YAAA,wBAAwB,UAAa,gBAAgB,KAAK,EAAE,OAAO,aAAa,IAAI,mBAAmB,GAAG;AAC7G,gBAAM,YAAY;AAClB,kBAAQ,MAAM,OAAO,OAAO,IAAI,QAAQ;AAAA,QAAA,OAClC;AAEN;AAAA,QACD;AAAA,MACD;AACM,YAAA;AAAA,IACP;AAAA,EACD;AAAA,UAGe,sBACd,WACA,OACsB;AACtB,QAAI,MAAM,SAAS,gBAAgB,MAAM,UAAU,WAAW,QAAW;AAExE,iBAAW,CAAG,EAAA,eAAe,UAAU,qBAAqB;AAC3D,cAAM,WAAW,WAAW,IAAI,MAAM,UAAU,OAAO,eAAe;AAClE,YAAA,UAAU,SAAS,cAAc;AAC9B,gBAAA;AAAA,QACP;AAAA,MACD;AACA;AAAA,IACD;AAEI,QAAA;AACA,QAAA;AAEA,QAAA,MAAM,SAAS,SAAS;AAC3B,2BAAqB,MAAM;AAC3B,wBAAkB,MAAM;AAAA,IAAA,WACd,MAAM,SAAS,cAAc;AACvC,2BAAqB,MAAM,UAAU;AACnB,wBAAA,MAAM,UAAU,OAAO;AAAA,IAAA,OACnC;AACN,aAAO,YAAiB;AAAA,IACzB;AAEA,eAAW,SAAS,KAAK,iBAAiB,oBAAoB,eAAe,GAAG;AAC/E,YAAM,QAAQ,MAAM,SAAS,IAAI,eAAe;AAChD,UAAI,UAAU,QAAW;AACxB;AAAA,MACD;AACI,UAAA,MAAM,SAAS,MAAM,MAAM;AACxB,cAAA;AAAA,MACP;AAAA,IACD;AAAA,EACD;AAAA,UAEe,mBAAmB,MAA8C;AAC/E,YAAQ,KAAK;AAAA,WACP;AAAA,WACA;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,kBAAQ,WAAW;AAAA,iBACb;AAAA,iBACA;AAAA,iBACA;AACG,qBAAA,KAAK,mBAAmB,UAAU;AACzC;AAAA,iBACI;AACJ;AAAA;AAEA,qBAAO,YAAsB;AAAA;AAAA,QAEhC;AACA;AAAA,WACI;AACJ;AAAA;AAEA,eAAO,YAAgB;AAAA;AAEnB,UAAA;AAAA,EACP;AAAA,UAEe,iBACd,MACA,OAC+B;AAC/B,YAAQ,KAAK;AAAA,WACP;AAAA,WACA;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,cAAI,WAAW,SAAS,iBAAiB,WAAW,SAAS,cAAc;AACnE,mBAAA,KAAK,iBAAiB,YAAY,KAAK;AAAA,UAC/C;AAAA,QACD;AACA;AAAA;AAEA,eAAO,YAAgB;AAAA;AAEzB,QAAI,UAAU,UAAa,MAAM,IAAI,GAAG;AACjC,YAAA;AAAA,IACP;AAAA,EACD;AAAA,UAEe,cAAc,WAA0E;AACtG,eAAW,cAAc,UAAU,oBAAoB,OAAA,GAAU;AAChE,aAAO,WAAW;IACnB;AAAA,EACD;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEntityMarker.js","sources":["../../../../src/core/state/getEntityMarker.ts"],"sourcesContent":["import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\n\nexport const getEntityMarker = (realm: EntityRealmState | EntityRealmStateStub) =>\n\trealm.blueprint.type === 'listEntity' ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getEntityMarker.js","sources":["../../../../src/core/state/getEntityMarker.ts"],"sourcesContent":["import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\n\nexport const getEntityMarker = (realm: EntityRealmState | EntityRealmStateStub) =>\n\trealm.blueprint.type === 'listEntity' ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,CAAC,UAC/B,MAAM,UAAU,SAAS,eAAe,MAAM,UAAU,OAAO,UAAU,SAAS,MAAM,UAAU;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCombinedSignal.js","sources":["../../../../src/core/utils/getCombinedSignal.ts"],"sourcesContent":["// Returns a signal that aborts when all present signals are aborted.\nexport const getCombinedSignal = (components: Iterable<AbortSignal | undefined>): AbortSignal => {\n\tlet abortedCount = 0\n\tlet signalCount = 0\n\n\tconst controller = new AbortController()\n\tconst refresh = () => {\n\t\tif (signalCount === 0) {\n\t\t\treturn\n\t\t}\n\t\tif (abortedCount >= signalCount) {\n\t\t\tcontroller.abort()\n\t\t}\n\t}\n\n\tfor (const component of components) {\n\t\tif (!component) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsignalCount++\n\n\t\tif (component.aborted) {\n\t\t\tabortedCount++\n\t\t} else {\n\t\t\tcomponent.addEventListener('abort', () => {\n\t\t\t\tabortedCount++\n\t\t\t\trefresh()\n\t\t\t})\n\t\t}\n\t}\n\n\trefresh()\n\n\treturn controller.signal\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getCombinedSignal.js","sources":["../../../../src/core/utils/getCombinedSignal.ts"],"sourcesContent":["// Returns a signal that aborts when all present signals are aborted.\nexport const getCombinedSignal = (components: Iterable<AbortSignal | undefined>): AbortSignal => {\n\tlet abortedCount = 0\n\tlet signalCount = 0\n\n\tconst controller = new AbortController()\n\tconst refresh = () => {\n\t\tif (signalCount === 0) {\n\t\t\treturn\n\t\t}\n\t\tif (abortedCount >= signalCount) {\n\t\t\tcontroller.abort()\n\t\t}\n\t}\n\n\tfor (const component of components) {\n\t\tif (!component) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsignalCount++\n\n\t\tif (component.aborted) {\n\t\t\tabortedCount++\n\t\t} else {\n\t\t\tcomponent.addEventListener('abort', () => {\n\t\t\t\tabortedCount++\n\t\t\t\trefresh()\n\t\t\t})\n\t\t}\n\t}\n\n\trefresh()\n\n\treturn controller.signal\n}\n"],"names":[],"mappings":"AACa,MAAA,oBAAoB,CAAC,eAA+D;AAChG,MAAI,eAAe;AACnB,MAAI,cAAc;AAEZ,QAAA,aAAa,IAAI;AACvB,QAAM,UAAU,MAAM;AACrB,QAAI,gBAAgB,GAAG;AACtB;AAAA,IACD;AACA,QAAI,gBAAgB,aAAa;AAChC,iBAAW,MAAM;AAAA,IAClB;AAAA,EAAA;AAGD,aAAW,aAAa,YAAY;AACnC,QAAI,CAAC,WAAW;AACf;AAAA,IACD;AAEA;AAEA,QAAI,UAAU,SAAS;AACtB;AAAA,IAAA,OACM;AACI,gBAAA,iBAAiB,SAAS,MAAM;AACzC;AACQ;MAAA,CACR;AAAA,IACF;AAAA,EACD;AAEQ;AAER,SAAO,WAAW;AACnB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/coreComponents/Component.tsx"],"sourcesContent":["import { FunctionComponent, memo, NamedExoticComponent, ReactElement } from 'react'\nimport type { Environment } from '../dao'\nimport { assertNever } from '../utils'\nimport type { MarkerProvider, StaticRenderProvider, StaticRenderProviderProps } from './MarkerProvider'\n\nfunction Component<Props extends {}>(\n\tstatelessRender: FunctionComponent<Props>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: FunctionComponent<Props>,\n\tstaticRender: (\n\t\tprops: StaticRenderProviderProps<Props, NonStaticPropNames>,\n\t\tenvironment: Environment,\n\t) => ReactElement | null,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: FunctionComponent<Props>,\n\tmarkerProvisions: MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\trender: FunctionComponent<Props>,\n\tdecider?:\n\t\t| string\n\t\t| ((props: StaticRenderProviderProps<Props, NonStaticPropNames>, environment: Environment) => ReactElement | null)\n\t\t| MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n) {\n\tif (decider === undefined || typeof decider === 'string') {\n\t\trender.displayName = decider\n\t\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props> = memo<Props>(render)\n\t\taugmentedRender.staticRender = render as StaticRenderProvider<Props>['staticRender']\n\t\taugmentedRender.displayName = decider\n\n\t\treturn augmentedRender\n\t}\n\n\trender.displayName = displayName\n\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props, NonStaticPropNames> = memo<Props>(render)\n\taugmentedRender.displayName = displayName\n\n\tif (typeof decider === 'function') {\n\t\taugmentedRender.staticRender = decider\n\n\t\treturn augmentedRender\n\t}\n\tif (typeof decider === 'object') {\n\t\tfor (const provisionName in decider) {\n\t\t\tconst methodName = provisionName as keyof MarkerProvider<Props, NonStaticPropNames>\n\t\t\t;(augmentedRender[methodName] as MarkerProvider<Props, NonStaticPropNames>[typeof methodName]) =\n\t\t\t\tdecider[methodName]\n\t\t}\n\n\t\treturn augmentedRender\n\t}\n\tassertNever(decider)\n}\n\nexport { Component }\n"],"names":[],"mappings":";;AAsBA,mBACC,QACA,SAIA,aACC;
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/coreComponents/Component.tsx"],"sourcesContent":["import { FunctionComponent, memo, NamedExoticComponent, ReactElement } from 'react'\nimport type { Environment } from '../dao'\nimport { assertNever } from '../utils'\nimport type { MarkerProvider, StaticRenderProvider, StaticRenderProviderProps } from './MarkerProvider'\n\nfunction Component<Props extends {}>(\n\tstatelessRender: FunctionComponent<Props>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: FunctionComponent<Props>,\n\tstaticRender: (\n\t\tprops: StaticRenderProviderProps<Props, NonStaticPropNames>,\n\t\tenvironment: Environment,\n\t) => ReactElement | null,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: FunctionComponent<Props>,\n\tmarkerProvisions: MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\trender: FunctionComponent<Props>,\n\tdecider?:\n\t\t| string\n\t\t| ((props: StaticRenderProviderProps<Props, NonStaticPropNames>, environment: Environment) => ReactElement | null)\n\t\t| MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n) {\n\tif (decider === undefined || typeof decider === 'string') {\n\t\trender.displayName = decider\n\t\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props> = memo<Props>(render)\n\t\taugmentedRender.staticRender = render as StaticRenderProvider<Props>['staticRender']\n\t\taugmentedRender.displayName = decider\n\n\t\treturn augmentedRender\n\t}\n\n\trender.displayName = displayName\n\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props, NonStaticPropNames> = memo<Props>(render)\n\taugmentedRender.displayName = displayName\n\n\tif (typeof decider === 'function') {\n\t\taugmentedRender.staticRender = decider\n\n\t\treturn augmentedRender\n\t}\n\tif (typeof decider === 'object') {\n\t\tfor (const provisionName in decider) {\n\t\t\tconst methodName = provisionName as keyof MarkerProvider<Props, NonStaticPropNames>\n\t\t\t;(augmentedRender[methodName] as MarkerProvider<Props, NonStaticPropNames>[typeof methodName]) =\n\t\t\t\tdecider[methodName]\n\t\t}\n\n\t\treturn augmentedRender\n\t}\n\tassertNever(decider)\n}\n\nexport { Component }\n"],"names":[],"mappings":";;AAsBA,mBACC,QACA,SAIA,aACC;AACD,MAAI,YAAY,UAAa,OAAO,YAAY,UAAU;AACzD,WAAO,cAAc;AACf,UAAA,mBAAuE,KAAY,MAAM;AAC/F,qBAAgB,eAAe;AAC/B,qBAAgB,cAAc;AAEvB,WAAA;AAAA,EACR;AAEA,SAAO,cAAc;AACf,QAAA,kBAA2F,KAAY,MAAM;AACnH,kBAAgB,cAAc;AAE1B,MAAA,OAAO,YAAY,YAAY;AAClC,oBAAgB,eAAe;AAExB,WAAA;AAAA,EACR;AACI,MAAA,OAAO,YAAY,UAAU;AAChC,eAAW,iBAAiB,SAAS;AACpC,YAAM,aAAa;AACjB,sBAAgB,cACjB,QAAQ;AAAA,IACV;AAEO,WAAA;AAAA,EACR;AACA,cAAmB;AACpB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataBindingProvider.js","sources":["../../../src/coreComponents/DataBindingProvider.tsx"],"sourcesContent":["import { ComponentType, createElement, memo, ReactElement, ReactNode } from 'react'\nimport { AccessorTree, AccessorTreeState, useDataBinding } from '../accessorTree'\n\nexport interface DataBindingProviderBaseProps {\n\tchildren?: ReactNode\n\trefreshOnEnvironmentChange?: boolean\n\trefreshOnPersist?: boolean\n}\n\nexport interface DataBindingStateComponentProps {\n\taccessorTreeState: AccessorTreeState\n\tchildren?: ReactNode\n}\n\nexport type DataBindingProviderProps<StateProps> = DataBindingProviderBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tstateComponent: ComponentType<StateProps & DataBindingStateComponentProps>\n\t\t\t\tstateProps?: StateProps\n\t\t }\n\t)\n\nexport const DataBindingProvider = memo(function DataBindingProvider<StateProps extends DataBindingStateComponentProps>(\n\tprops: DataBindingProviderProps<StateProps>,\n) {\n\tconst accessorTreeState = useDataBinding({\n\t\tnodeTree: props.children,\n\t\trefreshOnEnvironmentChange: props.refreshOnEnvironmentChange,\n\t\trefreshOnPersist: props.refreshOnPersist ?? false,\n\t})\n\n\tconst children =\n\t\t'stateComponent' in props && props.stateComponent\n\t\t\t? createElement(\n\t\t\t\t\tprops.stateComponent,\n\t\t\t\t\t{\n\t\t\t\t\t\t...props.stateProps!,\n\t\t\t\t\t\taccessorTreeState: accessorTreeState,\n\t\t\t\t\t},\n\t\t\t\t\tprops.children,\n\t\t\t )\n\t\t\t: props.children\n\treturn <AccessorTree state={accessorTreeState}>{children}</AccessorTree>\n}) as <StateProps>(props: DataBindingProviderProps<StateProps>) => ReactElement\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DataBindingProvider.js","sources":["../../../src/coreComponents/DataBindingProvider.tsx"],"sourcesContent":["import { ComponentType, createElement, memo, ReactElement, ReactNode } from 'react'\nimport { AccessorTree, AccessorTreeState, useDataBinding } from '../accessorTree'\n\nexport interface DataBindingProviderBaseProps {\n\tchildren?: ReactNode\n\trefreshOnEnvironmentChange?: boolean\n\trefreshOnPersist?: boolean\n}\n\nexport interface DataBindingStateComponentProps {\n\taccessorTreeState: AccessorTreeState\n\tchildren?: ReactNode\n}\n\nexport type DataBindingProviderProps<StateProps> = DataBindingProviderBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tstateComponent: ComponentType<StateProps & DataBindingStateComponentProps>\n\t\t\t\tstateProps?: StateProps\n\t\t }\n\t)\n\nexport const DataBindingProvider = memo(function DataBindingProvider<StateProps extends DataBindingStateComponentProps>(\n\tprops: DataBindingProviderProps<StateProps>,\n) {\n\tconst accessorTreeState = useDataBinding({\n\t\tnodeTree: props.children,\n\t\trefreshOnEnvironmentChange: props.refreshOnEnvironmentChange,\n\t\trefreshOnPersist: props.refreshOnPersist ?? false,\n\t})\n\n\tconst children =\n\t\t'stateComponent' in props && props.stateComponent\n\t\t\t? createElement(\n\t\t\t\t\tprops.stateComponent,\n\t\t\t\t\t{\n\t\t\t\t\t\t...props.stateProps!,\n\t\t\t\t\t\taccessorTreeState: accessorTreeState,\n\t\t\t\t\t},\n\t\t\t\t\tprops.children,\n\t\t\t )\n\t\t\t: props.children\n\treturn <AccessorTree state={accessorTreeState}>{children}</AccessorTree>\n}) as <StateProps>(props: DataBindingProviderProps<StateProps>) => ReactElement\n"],"names":["_jsx"],"mappings":";;;AAuBa,MAAA,sBAAsB,KAAK,8BACvC,OACC;AACD,QAAM,oBAAoB,eAAe;AAAA,IACxC,UAAU,MAAM;AAAA,IAChB,4BAA4B,MAAM;AAAA,IAClC,kBAAkB,MAAM,oBAAoB;AAAA,EAAA,CAC5C;AAED,QAAM,WACL,oBAAoB,SAAS,MAAM,iBAChC,cACA,MAAM,gBACN;AAAA,OACI,MAAM;AAAA,IACT;AAAA,EAED,GAAA,MAAM,QACN,IACA,MAAM;AACV,SAAQA,8BAAA,cAAA;AAAA,IAAa,OAAO;AAAA,EAAA,GAAoB,QAAS;AAC1D,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entity.js","sources":["../../../src/coreComponents/Entity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { AccessorProvider } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport { Component } from './Component'\n\nexport interface EntityBaseProps {\n\taccessor: EntityAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityProps = EntityBaseProps\n\nexport const Entity = Component(\n\t({ children, accessor }: EntityProps) => {\n\treturn (\n\t\t// HACK: the ?. is actually important, despite the typings.\n\t\t<AccessorProvider accessor={accessor} key={accessor?.key}>\n\t\t\t{children}\n\t\t</AccessorProvider>\n\t)\n\t},\n\t'Entity',\n)\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Entity.js","sources":["../../../src/coreComponents/Entity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { AccessorProvider } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport { Component } from './Component'\n\nexport interface EntityBaseProps {\n\taccessor: EntityAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityProps = EntityBaseProps\n\nexport const Entity = Component(\n\t({ children, accessor }: EntityProps) => {\n\treturn (\n\t\t// HACK: the ?. is actually important, despite the typings.\n\t\t<AccessorProvider accessor={accessor} key={accessor?.key}>\n\t\t\t{children}\n\t\t</AccessorProvider>\n\t)\n\t},\n\t'Entity',\n)\n"],"names":["_jsx"],"mappings":";;;AAYO,MAAM,SAAS,UACrB,CAAC,EAAE,UAAU,eAA4B;AACzC,SAEEA,8BAAA,kBAAA;AAAA,IAAiB;AAAA,IAAoB,KAAK,UAAU;AAAA,EAAA,GACnD,QACF;AAED,GACA,QACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityList.js","sources":["../../../src/coreComponents/EntityList.tsx"],"sourcesContent":["import { ComponentType, createElement, ReactElement, ReactNode } from 'react'\nimport type { EntityListAccessor } from '../accessors'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\n\nexport interface EntityListBaseProps {\n\taccessor: EntityListAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityListProps<ListProps> = EntityListBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\nexport const EntityList = Component(\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: props.accessor,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{Array.from(props.accessor, entity => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Entity key={entity.key} accessor={entity}>\n\t\t\t\t\t\t\t{props.children}\n\t\t\t\t\t\t</Entity>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</>\n\t\t)\n\t},\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: undefined as any,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn <>{props.children}</>\n\t},\n\t'EntityList',\n) as <ListProps>(props: EntityListProps<ListProps>) => ReactElement\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"EntityList.js","sources":["../../../src/coreComponents/EntityList.tsx"],"sourcesContent":["import { ComponentType, createElement, ReactElement, ReactNode } from 'react'\nimport type { EntityListAccessor } from '../accessors'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\n\nexport interface EntityListBaseProps {\n\taccessor: EntityListAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityListProps<ListProps> = EntityListBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\nexport const EntityList = Component(\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: props.accessor,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{Array.from(props.accessor, entity => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Entity key={entity.key} accessor={entity}>\n\t\t\t\t\t\t\t{props.children}\n\t\t\t\t\t\t</Entity>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</>\n\t\t)\n\t},\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: undefined as any,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn <>{props.children}</>\n\t},\n\t'EntityList',\n) as <ListProps>(props: EntityListProps<ListProps>) => ReactElement\n"],"names":["_jsx","_jsxFragment"],"mappings":";;;AAmBa,MAAA,aAAa,UACzB,CAAuB,UAAsC;AACxD,MAAA,mBAAmB,SAAS,MAAM,eAAe;AAC7C,WAAA,cAAc,MAAM,eAAe;AAAA,SACtC,MAAM;AAAA,MACT,UAAU,MAAM;AAAA,MAChB,UAAU,MAAM;AAAA,IAAA,CAChB;AAAA,EACF;AACA,SAEGA,8BAAAC,UAAA,MAAA,MAAM,KAAK,MAAM,UAAU,CAAU,WAAA;AACrC,WACED,8BAAA,QAAA;AAAA,MAAO,KAAK,OAAO;AAAA,MAAK,UAAU;AAAA,IAAA,GACjC,MAAM,QACR;AAAA,EAED,CAAA,CACF;AAEF,GACA,CAAuB,UAAsC;AACxD,MAAA,mBAAmB,SAAS,MAAM,eAAe;AAC7C,WAAA,cAAc,MAAM,eAAe;AAAA,SACtC,MAAM;AAAA,MACT,UAAU;AAAA,MACV,UAAU,MAAM;AAAA,IAAA,CAChB;AAAA,EACF;AACO,SAAAA,8BAAAC,UAAA,MAAG,MAAM,QAAS;AAC1B,GACA,YACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityListSubTree.js","sources":["../../../src/coreComponents/EntityListSubTree.tsx"],"sourcesContent":["import { whereToFilter } from '@contember/client'\nimport { useConstantValueInvariant } from '@contember/react-utils'\nimport { ComponentType, ReactElement, ReactNode, useCallback } from 'react'\nimport {\n\tuseAccessorUpdateSubscription,\n\tuseEntityListSubTreeParameters,\n\tuseGetEntityListSubTree,\n} from '../accessorPropagation'\nimport { NIL_UUID, PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '../treeParameters'\nimport { Component } from './Component'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\n\nexport interface EntityListSubTreeAdditionalProps {\n\tvariables?: Environment.DeltaFactory\n}\n\nexport type EntityListSubTreeProps<ListProps, EntityProps> = {\n\ttreeRootId?: TreeRootId\n\tchildren?: ReactNode\n} & EntityListSubTreeAdditionalProps &\n\t(SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList) &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\nexport const EntityListSubTree = Component(\n\t<ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntityListSubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntityListSubTree()\n\t\tconst parameters = useEntityListSubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ?\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne\n\t\t// ) :\n\t\t// \tprops.children\n\t\t// )\n\t\treturn <EntityList {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntityListSubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntityListSubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={0 as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst newEnvironment =\n\t\t\t\tprops.variables === undefined\n\t\t\t\t\t? oldEnvironment\n\t\t\t\t\t: oldEnvironment.putDelta(Environment.generateDelta(oldEnvironment, props.variables))\n\n\t\t\tif (newEnvironment.hasName('rootWhere') || newEnvironment.hasName('rootWhereAsFilter')) {\n\t\t\t\treturn newEnvironment\n\t\t\t}\n\n\t\t\tconst rootWhere = { id: NIL_UUID } as const\n\t\t\treturn newEnvironment.putDelta({\n\t\t\t\trootWhere,\n\t\t\t\trootWhereAsFilter: whereToFilter(rootWhere),\n\t\t\t})\n\t\t},\n\t},\n\t'EntityListSubTree',\n) as <ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => ReactElement\n"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"EntityListSubTree.js","sources":["../../../src/coreComponents/EntityListSubTree.tsx"],"sourcesContent":["import { whereToFilter } from '@contember/client'\nimport { useConstantValueInvariant } from '@contember/react-utils'\nimport { ComponentType, ReactElement, ReactNode, useCallback } from 'react'\nimport {\n\tuseAccessorUpdateSubscription,\n\tuseEntityListSubTreeParameters,\n\tuseGetEntityListSubTree,\n} from '../accessorPropagation'\nimport { NIL_UUID, PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '../treeParameters'\nimport { Component } from './Component'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\n\nexport interface EntityListSubTreeAdditionalProps {\n\tvariables?: Environment.DeltaFactory\n}\n\nexport type EntityListSubTreeProps<ListProps, EntityProps> = {\n\ttreeRootId?: TreeRootId\n\tchildren?: ReactNode\n} & EntityListSubTreeAdditionalProps &\n\t(SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList) &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\nexport const EntityListSubTree = Component(\n\t<ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntityListSubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntityListSubTree()\n\t\tconst parameters = useEntityListSubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ?\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne\n\t\t// ) :\n\t\t// \tprops.children\n\t\t// )\n\t\treturn <EntityList {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntityListSubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntityListSubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={0 as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst newEnvironment =\n\t\t\t\tprops.variables === undefined\n\t\t\t\t\t? oldEnvironment\n\t\t\t\t\t: oldEnvironment.putDelta(Environment.generateDelta(oldEnvironment, props.variables))\n\n\t\t\tif (newEnvironment.hasName('rootWhere') || newEnvironment.hasName('rootWhereAsFilter')) {\n\t\t\t\treturn newEnvironment\n\t\t\t}\n\n\t\t\tconst rootWhere = { id: NIL_UUID } as const\n\t\t\treturn newEnvironment.putDelta({\n\t\t\t\trootWhere,\n\t\t\t\trootWhereAsFilter: whereToFilter(rootWhere),\n\t\t\t})\n\t\t},\n\t},\n\t'EntityListSubTree',\n) as <ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => ReactElement\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;AAiCa,MAAA,oBAAoB,UAChC,CAAyB,UAA0D;AACxD,4BAAA,MAAM,YAAY,6CAA6C;AAEzF,QAAM,aAAa;AACb,QAAA,aAAa,+BAA+B,KAAK;AACvD,QAAM,cAAc,YACnB,MAAM,WAAW,YAAY,MAAM,UAAU,GAC7C,CAAC,YAAY,YAAY,MAAM,UAAU,CAC1C;AACM,QAAA,WAAW,8BAA8B,WAAW;AAQ1D,SAAQA,8BAAA,YAAA;AAAA,OAAe;AAAA,IAAO;AAAA,EAAA,CAAoB;AACnD,GACA;AAAA,EACC,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACjD,QAAA,gBAAgB,SAAS,MAAM,YAAY;AAC9C,aAAO,cAAc,2CAA2C,OAAO,QAAQ,WAAW;AAAA,IAC3F;AACA,WAAO,cAAc,8BAA8B,OAAO,QAAQ,WAAW;AAAA,EAC9E;AAAA,EACA,cAAc,WACZA,8BAAA,YAAA;AAAA,OAAe;AAAA,IAAO,UAAU;AAAA,EAAA,GAC/BA,8BAAA,OAAA;AAAA,IAAM,OAAO;AAAA,EAAA,CAAkB,GAC/B,MAAM,QACR;AAAA,EAED,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,UAAM,iBACL,MAAM,cAAc,SACjB,iBACA,eAAe,SAAS,YAAY,cAAc,gBAAgB,MAAM,SAAS,CAAC;AAEtF,QAAI,eAAe,QAAQ,WAAW,KAAK,eAAe,QAAQ,mBAAmB,GAAG;AAChF,aAAA;AAAA,IACR;AAEM,UAAA,YAAY,EAAE,IAAI;AACxB,WAAO,eAAe,SAAS;AAAA,MAC9B;AAAA,MACA,mBAAmB,cAAc,SAAS;AAAA,IAAA,CAC1C;AAAA,EACF;AACD,GACA,mBACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntitySubTree.js","sources":["../../../src/coreComponents/EntitySubTree.tsx"],"sourcesContent":["import { whereToFilter } from '@contember/client'\nimport { useConstantValueInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback } from 'react'\nimport { useAccessorUpdateSubscription, useEntitySubTreeParameters, useGetEntitySubTree } from '../accessorPropagation'\nimport { SetOrderFieldOnCreate, SetOrderFieldOnCreateOwnProps } from '../accessorSorting'\nimport { NIL_UUID, PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory, QueryLanguage } from '../queryLanguage'\nimport type {\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\n\nexport interface EntitySubTreeAdditionalProps {\n\tvariables?: Environment.DeltaFactory\n}\n\nexport type EntitySubTreeAdditionalCreationProps = {} | SetOrderFieldOnCreateOwnProps\n\nexport type EntitySubTreeProps<EntityProps> = {\n\ttreeRootId?: TreeRootId\n\tchildren?: ReactNode\n} & EntitySubTreeAdditionalProps &\n\t(SugaredQualifiedSingleEntity | (SugaredUnconstrainedQualifiedSingleEntity & EntitySubTreeAdditionalCreationProps))\nexport const EntitySubTree = Component(\n\t<EntityProps extends {}>(props: EntitySubTreeProps<EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntitySubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntitySubTree()\n\t\tconst parameters = useEntitySubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top-level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ? (\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne>\n\t\t// ) : (\n\t\t// \tprops.children\n\t\t// )}\n\t\treturn <Entity {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntitySubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntitySubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t<Entity {...props} accessor={0 as any}>\n\t\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t\t{props.children}\n\t\t\t\t</Entity>\n\t\t\t\t{props.isCreating && 'orderField' in props && (\n\t\t\t\t\t<SetOrderFieldOnCreate\n\t\t\t\t\t\torderField={props.orderField}\n\t\t\t\t\t\tnewOrderFieldValue={props.newOrderFieldValue}\n\t\t\t\t\t\tentity={props.entity}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst newEnvironment =\n\t\t\t\tprops.variables === undefined\n\t\t\t\t\t? oldEnvironment\n\t\t\t\t\t: oldEnvironment.putDelta(Environment.generateDelta(oldEnvironment, props.variables))\n\n\t\t\tif (newEnvironment.hasName('rootWhere') || newEnvironment.hasName('rootWhereAsFilter')) {\n\t\t\t\treturn newEnvironment\n\t\t\t}\n\n\t\t\tif (props.isCreating) {\n\t\t\t\tconst rootWhere = { id: NIL_UUID } as const\n\t\t\t\treturn newEnvironment.putDelta({\n\t\t\t\t\trootWhere,\n\t\t\t\t\trootWhereAsFilter: whereToFilter(rootWhere),\n\t\t\t\t\trootShouldExists: 'no',\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst qualifiedSingleEntity = QueryLanguage.desugarQualifiedSingleEntity(props, newEnvironment, { missingSetOnCreate: 'fill' })\n\t\t\treturn newEnvironment.putDelta({\n\t\t\t\trootWhere: qualifiedSingleEntity.where,\n\t\t\t\trootWhereAsFilter: whereToFilter(qualifiedSingleEntity.where),\n\t\t\t\trootShouldExists: qualifiedSingleEntity.setOnCreate ? 'maybe' : 'yes',\n\t\t\t})\n\t\t},\n\t},\n\t'EntitySubTree',\n) as <EntityProps>(pros: EntitySubTreeProps<EntityProps>) => ReactElement\n"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"EntitySubTree.js","sources":["../../../src/coreComponents/EntitySubTree.tsx"],"sourcesContent":["import { whereToFilter } from '@contember/client'\nimport { useConstantValueInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback } from 'react'\nimport { useAccessorUpdateSubscription, useEntitySubTreeParameters, useGetEntitySubTree } from '../accessorPropagation'\nimport { SetOrderFieldOnCreate, SetOrderFieldOnCreateOwnProps } from '../accessorSorting'\nimport { NIL_UUID, PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory, QueryLanguage } from '../queryLanguage'\nimport type {\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\n\nexport interface EntitySubTreeAdditionalProps {\n\tvariables?: Environment.DeltaFactory\n}\n\nexport type EntitySubTreeAdditionalCreationProps = {} | SetOrderFieldOnCreateOwnProps\n\nexport type EntitySubTreeProps<EntityProps> = {\n\ttreeRootId?: TreeRootId\n\tchildren?: ReactNode\n} & EntitySubTreeAdditionalProps &\n\t(SugaredQualifiedSingleEntity | (SugaredUnconstrainedQualifiedSingleEntity & EntitySubTreeAdditionalCreationProps))\nexport const EntitySubTree = Component(\n\t<EntityProps extends {}>(props: EntitySubTreeProps<EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntitySubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntitySubTree()\n\t\tconst parameters = useEntitySubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top-level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ? (\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne>\n\t\t// ) : (\n\t\t// \tprops.children\n\t\t// )}\n\t\treturn <Entity {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntitySubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntitySubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t<Entity {...props} accessor={0 as any}>\n\t\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t\t{props.children}\n\t\t\t\t</Entity>\n\t\t\t\t{props.isCreating && 'orderField' in props && (\n\t\t\t\t\t<SetOrderFieldOnCreate\n\t\t\t\t\t\torderField={props.orderField}\n\t\t\t\t\t\tnewOrderFieldValue={props.newOrderFieldValue}\n\t\t\t\t\t\tentity={props.entity}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst newEnvironment =\n\t\t\t\tprops.variables === undefined\n\t\t\t\t\t? oldEnvironment\n\t\t\t\t\t: oldEnvironment.putDelta(Environment.generateDelta(oldEnvironment, props.variables))\n\n\t\t\tif (newEnvironment.hasName('rootWhere') || newEnvironment.hasName('rootWhereAsFilter')) {\n\t\t\t\treturn newEnvironment\n\t\t\t}\n\n\t\t\tif (props.isCreating) {\n\t\t\t\tconst rootWhere = { id: NIL_UUID } as const\n\t\t\t\treturn newEnvironment.putDelta({\n\t\t\t\t\trootWhere,\n\t\t\t\t\trootWhereAsFilter: whereToFilter(rootWhere),\n\t\t\t\t\trootShouldExists: 'no',\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst qualifiedSingleEntity = QueryLanguage.desugarQualifiedSingleEntity(props, newEnvironment, { missingSetOnCreate: 'fill' })\n\t\t\treturn newEnvironment.putDelta({\n\t\t\t\trootWhere: qualifiedSingleEntity.where,\n\t\t\t\trootWhereAsFilter: whereToFilter(qualifiedSingleEntity.where),\n\t\t\t\trootShouldExists: qualifiedSingleEntity.setOnCreate ? 'maybe' : 'yes',\n\t\t\t})\n\t\t},\n\t},\n\t'EntitySubTree',\n) as <EntityProps>(pros: EntitySubTreeProps<EntityProps>) => ReactElement\n"],"names":["_jsx","_jsxFragment"],"mappings":";;;;;;;;;;;;;;AA4Ba,MAAA,gBAAgB,UAC5B,CAAyB,UAA2C;AACzC,4BAAA,MAAM,YAAY,yCAAyC;AAErF,QAAM,aAAa;AACb,QAAA,aAAa,2BAA2B,KAAK;AACnD,QAAM,cAAc,YACnB,MAAM,WAAW,YAAY,MAAM,UAAU,GAC7C,CAAC,YAAY,YAAY,MAAM,UAAU,CAC1C;AACM,QAAA,WAAW,8BAA8B,WAAW;AAQ1D,SAAQA,8BAAA,QAAA;AAAA,OAAW;AAAA,IAAO;AAAA,EAAA,CAAoB;AAC/C,GACA;AAAA,EACC,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACjD,QAAA,gBAAgB,SAAS,MAAM,YAAY;AAC9C,aAAO,cAAc,uCAAuC,OAAO,QAAQ,WAAW;AAAA,IACvF;AACA,WAAO,cAAc,0BAA0B,OAAO,QAAQ,WAAW;AAAA,EAC1E;AAAA,EACA,cAAc,CACb,UAAAA,8BAAAC,UAAA,MACED,8BAAA,QAAA;AAAA,OAAW;AAAA,IAAO,UAAU;AAAA,EAAA,GAC3BA,8BAAA,OAAA;AAAA,IAAM,OAAO;AAAA,EAAA,CAAkB,GAC/B,MAAM,QACR,GACC,MAAM,cAAc,gBAAgB,SACnCA,8BAAA,uBAAA;AAAA,IACA,YAAY,MAAM;AAAA,IAClB,oBAAoB,MAAM;AAAA,IAC1B,QAAQ,MAAM;AAAA,EAAA,CACf,CAEF;AAAA,EAED,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,UAAM,iBACL,MAAM,cAAc,SACjB,iBACA,eAAe,SAAS,YAAY,cAAc,gBAAgB,MAAM,SAAS,CAAC;AAEtF,QAAI,eAAe,QAAQ,WAAW,KAAK,eAAe,QAAQ,mBAAmB,GAAG;AAChF,aAAA;AAAA,IACR;AAEA,QAAI,MAAM,YAAY;AACf,YAAA,YAAY,EAAE,IAAI;AACxB,aAAO,eAAe,SAAS;AAAA,QAC9B;AAAA,QACA,mBAAmB,cAAc,SAAS;AAAA,QAC1C,kBAAkB;AAAA,MAAA,CAClB;AAAA,IACF;AACM,UAAA,wBAAwB,cAAc,6BAA6B,OAAO,gBAAgB,EAAE,oBAAoB,QAAQ;AAC9H,WAAO,eAAe,SAAS;AAAA,MAC9B,WAAW,sBAAsB;AAAA,MACjC,mBAAmB,cAAc,sBAAsB,KAAK;AAAA,MAC5D,kBAAkB,sBAAsB,cAAc,UAAU;AAAA,IAAA,CAChE;AAAA,EACF;AACD,GACA,eACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","sources":["../../../src/coreComponents/Field.tsx"],"sourcesContent":["import { GraphQlBuilder } from '@contember/client'\nimport type { ReactElement, ReactNode } from 'react'\nimport { useField } from '../accessorPropagation'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { FieldValue, SugaredRelativeSingleField } from '../treeParameters'\nimport { Component } from './Component'\n\nexport interface FieldBasicProps extends SugaredRelativeSingleField {}\n\nexport interface FieldRuntimeProps<Persisted extends FieldValue = FieldValue> {\n\tformat?: (value: Persisted | null) => ReactNode\n}\n\nexport interface FieldProps<Persisted extends FieldValue = FieldValue>\n\textends FieldBasicProps,\n\t\tFieldRuntimeProps<Persisted> {}\n\nexport const Field = Component(\n\t<Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => {\n\t\tconst field = useField<Persisted>(props)\n\n\t\tif (props.format !== undefined) {\n\t\t\treturn <>{props.format(field.value)}</>\n\t\t}\n\n\t\tif (\n\t\t\tfield.value instanceof GraphQlBuilder.GraphQlLiteral ||\n\t\t\tfield.value === null ||\n\t\t\ttypeof field.value === 'boolean'\n\t\t) {\n\t\t\treturn null\n\t\t}\n\t\treturn <>{field.value}</>\n\t},\n\t{\n\t\tgenerateLeafMarker: (props, environment) => MarkerFactory.createFieldMarker(props, environment),\n\t},\n\t'Field',\n) as <Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => ReactElement\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"Field.js","sources":["../../../src/coreComponents/Field.tsx"],"sourcesContent":["import { GraphQlBuilder } from '@contember/client'\nimport type { ReactElement, ReactNode } from 'react'\nimport { useField } from '../accessorPropagation'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { FieldValue, SugaredRelativeSingleField } from '../treeParameters'\nimport { Component } from './Component'\n\nexport interface FieldBasicProps extends SugaredRelativeSingleField {}\n\nexport interface FieldRuntimeProps<Persisted extends FieldValue = FieldValue> {\n\tformat?: (value: Persisted | null) => ReactNode\n}\n\nexport interface FieldProps<Persisted extends FieldValue = FieldValue>\n\textends FieldBasicProps,\n\t\tFieldRuntimeProps<Persisted> {}\n\nexport const Field = Component(\n\t<Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => {\n\t\tconst field = useField<Persisted>(props)\n\n\t\tif (props.format !== undefined) {\n\t\t\treturn <>{props.format(field.value)}</>\n\t\t}\n\n\t\tif (\n\t\t\tfield.value instanceof GraphQlBuilder.GraphQlLiteral ||\n\t\t\tfield.value === null ||\n\t\t\ttypeof field.value === 'boolean'\n\t\t) {\n\t\t\treturn null\n\t\t}\n\t\treturn <>{field.value}</>\n\t},\n\t{\n\t\tgenerateLeafMarker: (props, environment) => MarkerFactory.createFieldMarker(props, environment),\n\t},\n\t'Field',\n) as <Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => ReactElement\n"],"names":["_jsx","_jsxFragment"],"mappings":";;;;;AAiBa,MAAA,QAAQ,UACpB,CAA4C,UAAiC;AACtE,QAAA,QAAQ,SAAoB,KAAK;AAEnC,MAAA,MAAM,WAAW,QAAW;AAC/B,WAAUA,8BAAAC,UAAA,MAAA,MAAM,OAAO,MAAM,KAAK,CAAE;AAAA,EACrC;AAGC,MAAA,MAAM,iBAAiB,eAAe,kBACtC,MAAM,UAAU,QAChB,OAAO,MAAM,UAAU,WACtB;AACM,WAAA;AAAA,EACR;AACO,SAAAD,8BAAAC,UAAA,MAAG,MAAM,KAAM;AACvB,GACA;AAAA,EACC,oBAAoB,CAAC,OAAO,gBAAgB,cAAc,kBAAkB,OAAO,WAAW;AAC/F,GACA,OACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HasMany.js","sources":["../../../src/coreComponents/HasMany.tsx"],"sourcesContent":["import type { ComponentType, ReactElement, ReactNode } from 'react'\nimport { useEntityList } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredRelativeEntityList } from '../treeParameters'\nimport { Component } from './Component'\nimport type { EntityBaseProps } from './Entity'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\n\nexport type HasManyProps<ListProps = never, EntityProps = never> = SugaredRelativeEntityList & {\n\tchildren?: ReactNode\n\tvariables?: Environment.DeltaFactory\n} & (\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\nexport const HasMany = Component(\n\t<ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => {\n\t\tconst entityList = useEntityList(props)\n\n\t\treturn <EntityList {...props} accessor={entityList} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tif (props.variables === undefined) {\n\t\t\t\treturn oldEnvironment\n\t\t\t}\n\t\t\treturn oldEnvironment.putDelta(Environment.generateDelta(oldEnvironment, props.variables))\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeEntityListFields(props, environment, fields),\n\t},\n\t'HasMany',\n) as <ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => ReactElement\n"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"HasMany.js","sources":["../../../src/coreComponents/HasMany.tsx"],"sourcesContent":["import type { ComponentType, ReactElement, ReactNode } from 'react'\nimport { useEntityList } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredRelativeEntityList } from '../treeParameters'\nimport { Component } from './Component'\nimport type { EntityBaseProps } from './Entity'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\n\nexport type HasManyProps<ListProps = never, EntityProps = never> = SugaredRelativeEntityList & {\n\tchildren?: ReactNode\n\tvariables?: Environment.DeltaFactory\n} & (\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\nexport const HasMany = Component(\n\t<ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => {\n\t\tconst entityList = useEntityList(props)\n\n\t\treturn <EntityList {...props} accessor={entityList} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tif (props.variables === undefined) {\n\t\t\t\treturn oldEnvironment\n\t\t\t}\n\t\t\treturn oldEnvironment.putDelta(Environment.generateDelta(oldEnvironment, props.variables))\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeEntityListFields(props, environment, fields),\n\t},\n\t'HasMany',\n) as <ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => ReactElement\n"],"names":["_jsx"],"mappings":";;;;;;;;AAsBa,MAAA,UAAU,UACtB,CAAyB,UAAgD;AAClE,QAAA,aAAa,cAAc,KAAK;AAEtC,SAAQA,8BAAA,YAAA;AAAA,OAAe;AAAA,IAAO,UAAU;AAAA,EAAA,CAAY;AACrD,GACA;AAAA,EACC,qBAAqB,CAAC,OAAO,mBAAmB;AAC3C,QAAA,MAAM,cAAc,QAAW;AAC3B,aAAA;AAAA,IACR;AACA,WAAO,eAAe,SAAS,YAAY,cAAc,gBAAgB,MAAM,SAAS,CAAC;AAAA,EAC1F;AAAA,EACA,cAAc,WACZA,8BAAA,YAAA;AAAA,OAAe;AAAA,IAAO,UAAU;AAAA,EAAA,GAC/BA,8BAAA,OAAA;AAAA,IAAM,OAAO;AAAA,EAAA,CAAkB,GAC/B,MAAM,QACR;AAAA,EAED,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,+BAA+B,OAAO,aAAa,MAAM;AACzE,GACA,SACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HasOne.js","sources":["../../../src/coreComponents/HasOne.tsx"],"sourcesContent":["import type { ComponentType, ReactElement, ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredRelativeSingleEntity } from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity, EntityBaseProps } from './Entity'\nimport { Field } from './Field'\n\nexport type HasOneProps<EntityProps = never> = SugaredRelativeSingleEntity & {\n\tchildren?: ReactNode\n\tvariables?: Environment.DeltaFactory\n}\n\nexport const HasOne = Component(\n\t<EntityProps extends {}>(props: HasOneProps<EntityProps>) => {\n\t\tconst entity = useEntity(props)\n\n\t\treturn <Entity {...props} accessor={entity} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tif (props.variables === undefined) {\n\t\t\t\treturn oldEnvironment\n\t\t\t}\n\t\t\treturn oldEnvironment.putDelta(Environment.generateDelta(oldEnvironment, props.variables))\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<Entity {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</Entity>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeSingleEntityFields(props, environment, fields),\n\t},\n\t'HasOne',\n) as <EntityProps extends {}>(props: HasOneProps<EntityProps>) => ReactElement\n"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"HasOne.js","sources":["../../../src/coreComponents/HasOne.tsx"],"sourcesContent":["import type { ComponentType, ReactElement, ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredRelativeSingleEntity } from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity, EntityBaseProps } from './Entity'\nimport { Field } from './Field'\n\nexport type HasOneProps<EntityProps = never> = SugaredRelativeSingleEntity & {\n\tchildren?: ReactNode\n\tvariables?: Environment.DeltaFactory\n}\n\nexport const HasOne = Component(\n\t<EntityProps extends {}>(props: HasOneProps<EntityProps>) => {\n\t\tconst entity = useEntity(props)\n\n\t\treturn <Entity {...props} accessor={entity} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tif (props.variables === undefined) {\n\t\t\t\treturn oldEnvironment\n\t\t\t}\n\t\t\treturn oldEnvironment.putDelta(Environment.generateDelta(oldEnvironment, props.variables))\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<Entity {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</Entity>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeSingleEntityFields(props, environment, fields),\n\t},\n\t'HasOne',\n) as <EntityProps extends {}>(props: HasOneProps<EntityProps>) => ReactElement\n"],"names":["_jsx"],"mappings":";;;;;;;;AAea,MAAA,SAAS,UACrB,CAAyB,UAAoC;AACtD,QAAA,SAAS,UAAU,KAAK;AAE9B,SAAQA,8BAAA,QAAA;AAAA,OAAW;AAAA,IAAO,UAAU;AAAA,EAAA,CAAQ;AAC7C,GACA;AAAA,EACC,qBAAqB,CAAC,OAAO,mBAAmB;AAC3C,QAAA,MAAM,cAAc,QAAW;AAC3B,aAAA;AAAA,IACR;AACA,WAAO,eAAe,SAAS,YAAY,cAAc,gBAAgB,MAAM,SAAS,CAAC;AAAA,EAC1F;AAAA,EACA,cAAc,WACZA,8BAAA,QAAA;AAAA,OAAW;AAAA,IAAO,UAAU;AAAA,EAAA,GAC3BA,8BAAA,OAAA;AAAA,IAAM,OAAO;AAAA,EAAA,CAAkB,GAC/B,MAAM,QACR;AAAA,EAED,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,iCAAiC,OAAO,aAAa,MAAM;AAC3E,GACA,QACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParentEntity.js","sources":["../../../src/coreComponents/ParentEntity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredParentEntityParameters } from '../treeParameters'\nimport { Component } from './Component'\n\nexport interface ParentEntityProps extends SugaredParentEntityParameters {\n\tchildren?: ReactNode\n}\n\nexport const ParentEntity = Component<ParentEntityProps>(\n\tprops => <>{props.children}</>,\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createParentEntityMarker(props, fields, environment),\n\t},\n\t'ParentEntity',\n)\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ParentEntity.js","sources":["../../../src/coreComponents/ParentEntity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredParentEntityParameters } from '../treeParameters'\nimport { Component } from './Component'\n\nexport interface ParentEntityProps extends SugaredParentEntityParameters {\n\tchildren?: ReactNode\n}\n\nexport const ParentEntity = Component<ParentEntityProps>(\n\tprops => <>{props.children}</>,\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createParentEntityMarker(props, fields, environment),\n\t},\n\t'ParentEntity',\n)\n"],"names":["_jsx","_jsxFragment"],"mappings":";;;AASO,MAAM,eAAe,UAC3B,CAAA,UAAYA,8BAAAC,UAAA,MAAA,MAAM,QAAS,GAC3B;AAAA,EACC,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,yBAAyB,OAAO,QAAQ,WAAW;AACnE,GACA,cACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Environment.js","sources":["../../../src/dao/Environment.ts"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Filter, UniqueWhere } from '../treeParameters'\n\nclass Environment {\n\tprivate readonly names: Environment.NameStore\n\n\tpublic constructor(names: Environment.NameStore = Environment.defaultNameStore) {\n\t\tthis.names = {\n\t\t\t...Environment.defaultNameStore,\n\t\t\t...names,\n\t\t}\n\t}\n\n\tpublic static create(delta: Partial<Environment.NameStore> = {}) {\n\t\treturn new Environment({\n\t\t\t...Environment.defaultSystemVariables,\n\t\t\tdimensions: {},\n\t\t}).putDelta(delta)\n\t}\n\n\tpublic hasName(name: keyof Environment.NameStore): boolean {\n\t\treturn name in this.names\n\t}\n\n\tpublic hasDimension(dimensionName: keyof Environment.SelectedDimensions): boolean {\n\t\treturn dimensionName in this.names.dimensions\n\t}\n\n\tpublic getValueOrElse<F, V extends Environment.Value = Environment.Value>(\n\t\tname: keyof Environment.NameStore,\n\t\tfallback: F,\n\t): V | F {\n\t\tif (!this.hasName(name)) {\n\t\t\treturn fallback\n\t\t}\n\t\treturn this.names[name] as V\n\t}\n\n\tpublic getDimensionOrElse<F>(dimensionName: keyof Environment.SelectedDimensions, fallback: F): string[] | F {\n\t\tif (!this.hasDimension(dimensionName)) {\n\t\t\treturn fallback\n\t\t}\n\t\treturn this.names.dimensions[dimensionName]\n\t}\n\n\tpublic getValue<V extends Environment.Value = Environment.Value>(name: keyof Environment.NameStore): V {\n\t\treturn this.names[name] as V\n\t}\n\n\tpublic getDimension(dimensionName: keyof Environment.SelectedDimensions): string[] {\n\t\treturn this.names.dimensions[dimensionName]\n\t}\n\n\tpublic getAllNames(): Environment.NameStore {\n\t\treturn { ...this.names }\n\t}\n\n\tpublic getAllDimensions(): Environment.SelectedDimensions {\n\t\treturn { ...this.names.dimensions }\n\t}\n\n\tpublic getSystemVariable<N extends Environment.SystemVariableName>(name: N): Environment.SystemVariables[N] {\n\t\treturn this.names[name]\n\t}\n\n\tpublic putName(name: Environment.Name, value: Environment.Value): Environment {\n\t\treturn new Environment({\n\t\t\t...this.names,\n\t\t\tdimensions: { ...this.names.dimensions },\n\t\t\t[name]: value,\n\t\t})\n\t}\n\n\tpublic putSystemVariable<N extends Environment.SystemVariableName>(\n\t\tname: N,\n\t\tvalue: Environment.SystemVariables[N],\n\t): Environment {\n\t\treturn this.putName(name, value)\n\t}\n\n\tpublic putDelta(delta: Partial<Environment.NameStore>): Environment {\n\t\tconst currentNames = this.getAllNames()\n\n\t\tfor (const newName in delta) {\n\t\t\tconst deltaValue = delta[newName]\n\t\t\tif (deltaValue === undefined) {\n\t\t\t\tdelete currentNames[newName]\n\t\t\t} else {\n\t\t\t\tcurrentNames[newName] = deltaValue\n\t\t\t}\n\t\t}\n\n\t\treturn new Environment(currentNames)\n\t}\n\n\tpublic updateDimensionsIfNecessary(\n\t\tdimensions: Environment.NameStore['dimensions'],\n\t\tdefaultDimensions: Environment.NameStore['dimensions'],\n\t): Environment {\n\t\tconst normalizedDimensions: Environment.NameStore['dimensions'] = {\n\t\t\t...defaultDimensions,\n\t\t\t...dimensions,\n\t\t}\n\n\t\tconst dimensionsEqual = JSON.stringify(this.names.dimensions) === JSON.stringify(normalizedDimensions)\n\t\treturn dimensionsEqual\n\t\t\t? this\n\t\t\t: new Environment({\n\t\t\t\t\t...this.names,\n\t\t\t\t\tdimensions: { ...normalizedDimensions },\n\t\t\t })\n\t}\n\n\tpublic static generateDelta(\n\t\tcurrentEnvironment: Environment,\n\t\tdelta: Environment.DeltaFactory,\n\t): Partial<Environment.NameStore> {\n\t\tconst newDelta: Partial<Environment.NameStore> = {}\n\n\t\tfor (const name in delta) {\n\t\t\tconst value = delta[name]\n\n\t\t\tnewDelta[name] =\n\t\t\t\tvalue &&\n\t\t\t\tvalue instanceof Function &&\n\t\t\t\t!Environment.systemVariableNames.has(name as Environment.SystemVariableName)\n\t\t\t\t\t? value(currentEnvironment)\n\t\t\t\t\t: delta[name]\n\t\t}\n\n\t\treturn newDelta\n\t}\n\n\tpublic applySystemMiddleware<\n\t\tN extends Environment.SystemMiddlewareName,\n\t\tA extends Parameters<Exclude<Environment.SystemMiddleware[N], undefined>>,\n\t>(name: N, ...args: A): ReturnType<Exclude<Environment.SystemMiddleware[N], undefined>> | A {\n\t\tconst middleware: Environment.SystemMiddleware[N] = this.names[name]\n\t\tif (typeof middleware === 'function') {\n\t\t\treturn (middleware as (...args: A) => any)(...args)\n\t\t}\n\t\treturn args\n\t}\n}\n\nnamespace Environment {\n\texport type Name = string | number\n\n\texport type Value = ReactNode\n\n\texport interface SystemVariables {\n\t\tlabelMiddleware?: (label: ReactNode) => ReactNode\n\t\trootWhere?: UniqueWhere\n\t\trootWhereAsFilter?: Filter\n\t\trootShouldExists?: 'no' | 'maybe' | 'yes'\n\t}\n\n\texport const systemVariableNames: Set<SystemVariableName> = new Set([\n\t\t'labelMiddleware',\n\t\t'rootWhere',\n\t\t'rootWhereAsFilter',\n\t\t'rootShouldExists',\n\t])\n\n\texport const reservedVariableNames: Set<string> = new Set([\n\t\t...systemVariableNames,\n\t\t'dimensions',\n\t])\n\n\texport type SystemVariableName = keyof SystemVariables\n\n\texport interface SelectedDimensions {\n\t\t[key: string]: string[]\n\t}\n\n\texport interface NameStore extends SystemVariables {\n\t\tdimensions: SelectedDimensions\n\n\t\t[name: string]: Value\n\t}\n\n\texport type DeltaFactory = { [N in string]: ((environment: Environment) => Environment.Value) | Environment.Value } &\n\t\t{ [N in keyof SystemVariables]?: SystemVariables[N] }\n\n\texport type SystemMiddleware = {\n\t\t[N in SystemMiddlewareName]: SystemVariables[N]\n\t}\n\n\texport type SystemMiddlewareName = 'labelMiddleware'\n\n\texport const defaultSystemVariables: SystemVariables = {\n\t\tlabelMiddleware: label => label,\n\t}\n\n\texport const defaultNameStore: NameStore = {\n\t\t...defaultSystemVariables,\n\t\tdimensions: {},\n\t}\n}\n\nexport { Environment }\n"],"names":[],"mappings":";;;;;;AAGA,
|
|
1
|
+
{"version":3,"file":"Environment.js","sources":["../../../src/dao/Environment.ts"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Filter, UniqueWhere } from '../treeParameters'\n\nclass Environment {\n\tprivate readonly names: Environment.NameStore\n\n\tpublic constructor(names: Environment.NameStore = Environment.defaultNameStore) {\n\t\tthis.names = {\n\t\t\t...Environment.defaultNameStore,\n\t\t\t...names,\n\t\t}\n\t}\n\n\tpublic static create(delta: Partial<Environment.NameStore> = {}) {\n\t\treturn new Environment({\n\t\t\t...Environment.defaultSystemVariables,\n\t\t\tdimensions: {},\n\t\t}).putDelta(delta)\n\t}\n\n\tpublic hasName(name: keyof Environment.NameStore): boolean {\n\t\treturn name in this.names\n\t}\n\n\tpublic hasDimension(dimensionName: keyof Environment.SelectedDimensions): boolean {\n\t\treturn dimensionName in this.names.dimensions\n\t}\n\n\tpublic getValueOrElse<F, V extends Environment.Value = Environment.Value>(\n\t\tname: keyof Environment.NameStore,\n\t\tfallback: F,\n\t): V | F {\n\t\tif (!this.hasName(name)) {\n\t\t\treturn fallback\n\t\t}\n\t\treturn this.names[name] as V\n\t}\n\n\tpublic getDimensionOrElse<F>(dimensionName: keyof Environment.SelectedDimensions, fallback: F): string[] | F {\n\t\tif (!this.hasDimension(dimensionName)) {\n\t\t\treturn fallback\n\t\t}\n\t\treturn this.names.dimensions[dimensionName]\n\t}\n\n\tpublic getValue<V extends Environment.Value = Environment.Value>(name: keyof Environment.NameStore): V {\n\t\treturn this.names[name] as V\n\t}\n\n\tpublic getDimension(dimensionName: keyof Environment.SelectedDimensions): string[] {\n\t\treturn this.names.dimensions[dimensionName]\n\t}\n\n\tpublic getAllNames(): Environment.NameStore {\n\t\treturn { ...this.names }\n\t}\n\n\tpublic getAllDimensions(): Environment.SelectedDimensions {\n\t\treturn { ...this.names.dimensions }\n\t}\n\n\tpublic getSystemVariable<N extends Environment.SystemVariableName>(name: N): Environment.SystemVariables[N] {\n\t\treturn this.names[name]\n\t}\n\n\tpublic putName(name: Environment.Name, value: Environment.Value): Environment {\n\t\treturn new Environment({\n\t\t\t...this.names,\n\t\t\tdimensions: { ...this.names.dimensions },\n\t\t\t[name]: value,\n\t\t})\n\t}\n\n\tpublic putSystemVariable<N extends Environment.SystemVariableName>(\n\t\tname: N,\n\t\tvalue: Environment.SystemVariables[N],\n\t): Environment {\n\t\treturn this.putName(name, value)\n\t}\n\n\tpublic putDelta(delta: Partial<Environment.NameStore>): Environment {\n\t\tconst currentNames = this.getAllNames()\n\n\t\tfor (const newName in delta) {\n\t\t\tconst deltaValue = delta[newName]\n\t\t\tif (deltaValue === undefined) {\n\t\t\t\tdelete currentNames[newName]\n\t\t\t} else {\n\t\t\t\tcurrentNames[newName] = deltaValue\n\t\t\t}\n\t\t}\n\n\t\treturn new Environment(currentNames)\n\t}\n\n\tpublic updateDimensionsIfNecessary(\n\t\tdimensions: Environment.NameStore['dimensions'],\n\t\tdefaultDimensions: Environment.NameStore['dimensions'],\n\t): Environment {\n\t\tconst normalizedDimensions: Environment.NameStore['dimensions'] = {\n\t\t\t...defaultDimensions,\n\t\t\t...dimensions,\n\t\t}\n\n\t\tconst dimensionsEqual = JSON.stringify(this.names.dimensions) === JSON.stringify(normalizedDimensions)\n\t\treturn dimensionsEqual\n\t\t\t? this\n\t\t\t: new Environment({\n\t\t\t\t\t...this.names,\n\t\t\t\t\tdimensions: { ...normalizedDimensions },\n\t\t\t })\n\t}\n\n\tpublic static generateDelta(\n\t\tcurrentEnvironment: Environment,\n\t\tdelta: Environment.DeltaFactory,\n\t): Partial<Environment.NameStore> {\n\t\tconst newDelta: Partial<Environment.NameStore> = {}\n\n\t\tfor (const name in delta) {\n\t\t\tconst value = delta[name]\n\n\t\t\tnewDelta[name] =\n\t\t\t\tvalue &&\n\t\t\t\tvalue instanceof Function &&\n\t\t\t\t!Environment.systemVariableNames.has(name as Environment.SystemVariableName)\n\t\t\t\t\t? value(currentEnvironment)\n\t\t\t\t\t: delta[name]\n\t\t}\n\n\t\treturn newDelta\n\t}\n\n\tpublic applySystemMiddleware<\n\t\tN extends Environment.SystemMiddlewareName,\n\t\tA extends Parameters<Exclude<Environment.SystemMiddleware[N], undefined>>,\n\t>(name: N, ...args: A): ReturnType<Exclude<Environment.SystemMiddleware[N], undefined>> | A {\n\t\tconst middleware: Environment.SystemMiddleware[N] = this.names[name]\n\t\tif (typeof middleware === 'function') {\n\t\t\treturn (middleware as (...args: A) => any)(...args)\n\t\t}\n\t\treturn args\n\t}\n}\n\nnamespace Environment {\n\texport type Name = string | number\n\n\texport type Value = ReactNode\n\n\texport interface SystemVariables {\n\t\tlabelMiddleware?: (label: ReactNode) => ReactNode\n\t\trootWhere?: UniqueWhere\n\t\trootWhereAsFilter?: Filter\n\t\trootShouldExists?: 'no' | 'maybe' | 'yes'\n\t}\n\n\texport const systemVariableNames: Set<SystemVariableName> = new Set([\n\t\t'labelMiddleware',\n\t\t'rootWhere',\n\t\t'rootWhereAsFilter',\n\t\t'rootShouldExists',\n\t])\n\n\texport const reservedVariableNames: Set<string> = new Set([\n\t\t...systemVariableNames,\n\t\t'dimensions',\n\t])\n\n\texport type SystemVariableName = keyof SystemVariables\n\n\texport interface SelectedDimensions {\n\t\t[key: string]: string[]\n\t}\n\n\texport interface NameStore extends SystemVariables {\n\t\tdimensions: SelectedDimensions\n\n\t\t[name: string]: Value\n\t}\n\n\texport type DeltaFactory = { [N in string]: ((environment: Environment) => Environment.Value) | Environment.Value } &\n\t\t{ [N in keyof SystemVariables]?: SystemVariables[N] }\n\n\texport type SystemMiddleware = {\n\t\t[N in SystemMiddlewareName]: SystemVariables[N]\n\t}\n\n\texport type SystemMiddlewareName = 'labelMiddleware'\n\n\texport const defaultSystemVariables: SystemVariables = {\n\t\tlabelMiddleware: label => label,\n\t}\n\n\texport const defaultNameStore: NameStore = {\n\t\t...defaultSystemVariables,\n\t\tdimensions: {},\n\t}\n}\n\nexport { Environment }\n"],"names":[],"mappings":";;;;;;AAGA,MAAM,YAAY;AAAA,EAGV,YAAY,QAA+B,YAAY,kBAAkB;AAF/D;AAGhB,SAAK,QAAQ;AAAA,SACT,YAAY;AAAA,SACZ;AAAA,IAAA;AAAA,EAEL;AAAA,SAEc,OAAO,QAAwC,IAAI;AAChE,WAAO,IAAI,YAAY;AAAA,SACnB,YAAY;AAAA,MACf,YAAY,CAAC;AAAA,IAAA,CACb,EAAE,SAAS,KAAK;AAAA,EAClB;AAAA,EAEO,QAAQ,MAA4C;AAC1D,WAAO,QAAQ,KAAK;AAAA,EACrB;AAAA,EAEO,aAAa,eAA8D;AAC1E,WAAA,iBAAiB,KAAK,MAAM;AAAA,EACpC;AAAA,EAEO,eACN,MACA,UACQ;AACR,QAAI,CAAC,KAAK,QAAQ,IAAI,GAAG;AACjB,aAAA;AAAA,IACR;AACA,WAAO,KAAK,MAAM;AAAA,EACnB;AAAA,EAEO,mBAAsB,eAAqD,UAA2B;AAC5G,QAAI,CAAC,KAAK,aAAa,aAAa,GAAG;AAC/B,aAAA;AAAA,IACR;AACO,WAAA,KAAK,MAAM,WAAW;AAAA,EAC9B;AAAA,EAEO,SAA0D,MAAsC;AACtG,WAAO,KAAK,MAAM;AAAA,EACnB;AAAA,EAEO,aAAa,eAA+D;AAC3E,WAAA,KAAK,MAAM,WAAW;AAAA,EAC9B;AAAA,EAEO,cAAqC;AACpC,WAAA,KAAK,KAAK;EAClB;AAAA,EAEO,mBAAmD;AAClD,WAAA,KAAK,KAAK,MAAM,WAAW;AAAA,EACnC;AAAA,EAEO,kBAA4D,MAAyC;AAC3G,WAAO,KAAK,MAAM;AAAA,EACnB;AAAA,EAEO,QAAQ,MAAwB,OAAuC;AAC7E,WAAO,IAAI,YAAY;AAAA,SACnB,KAAK;AAAA,MACR,YAAY,KAAK,KAAK,MAAM,WAAW;AAAA,OACtC,OAAO;AAAA,IAAA,CACR;AAAA,EACF;AAAA,EAEO,kBACN,MACA,OACc;AACP,WAAA,KAAK,QAAQ,MAAM,KAAK;AAAA,EAChC;AAAA,EAEO,SAAS,OAAoD;AAC7D,UAAA,eAAe,KAAK;AAE1B,eAAW,WAAW,OAAO;AAC5B,YAAM,aAAa,MAAM;AACzB,UAAI,eAAe,QAAW;AAC7B,eAAO,aAAa;AAAA,MAAA,OACd;AACN,qBAAa,WAAW;AAAA,MACzB;AAAA,IACD;AAEO,WAAA,IAAI,YAAY,YAAY;AAAA,EACpC;AAAA,EAEO,4BACN,YACA,mBACc;AACd,UAAM,uBAA4D;AAAA,SAC9D;AAAA,SACA;AAAA,IAAA;AAGE,UAAA,kBAAkB,KAAK,UAAU,KAAK,MAAM,UAAU,MAAM,KAAK,UAAU,oBAAoB;AAC9F,WAAA,kBACJ,OACA,IAAI,YAAY;AAAA,SACb,KAAK;AAAA,MACR,YAAY,KAAK,qBAAqB;AAAA,IAAA,CACrC;AAAA,EACL;AAAA,SAEc,cACb,oBACA,OACiC;AACjC,UAAM,WAA2C,CAAA;AAEjD,eAAW,QAAQ,OAAO;AACzB,YAAM,QAAQ,MAAM;AAEpB,eAAS,QACR,SACA,iBAAiB,YACjB,CAAC,YAAY,oBAAoB,IAAI,IAAsC,IACxE,MAAM,kBAAkB,IACxB,MAAM;AAAA,IACX;AAEO,WAAA;AAAA,EACR;AAAA,EAEO,sBAGL,SAAY,MAA8E;AACrF,UAAA,aAA8C,KAAK,MAAM;AAC3D,QAAA,OAAO,eAAe,YAAY;AAC7B,aAAA,WAAmC,GAAG,IAAI;AAAA,IACnD;AACO,WAAA;AAAA,EACR;AACD;AAEA,AAAA,EAAU,iBAAV;AAYc,eAAA,0CAAmD,IAAI;AAAA,IACnE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACA;AAEY,eAAA,4CAAyC,IAAI;AAAA,IACzD,GAAG,aAAA;AAAA,IACH;AAAA,EAAA,CACA;AAuBY,eAA0C,yBAAA;AAAA,IACtD,iBAAiB,CAAS,UAAA;AAAA,EAAA;AAGd,eAA8B,mBAAA;AAAA,OACvC,aAAA;AAAA,IACH,YAAY,CAAC;AAAA,EAAA;AACd,GApDS,eAAA,eAAA,CAAA,EAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariableFieldValue.js","sources":["../../../src/dao/VariableFieldValue.ts"],"sourcesContent":["export class VariableFieldValue {\n\tpublic constructor(public readonly variableName: string) {}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VariableFieldValue.js","sources":["../../../src/dao/VariableFieldValue.ts"],"sourcesContent":["export class VariableFieldValue {\n\tpublic constructor(public readonly variableName: string) {}\n}\n"],"names":[],"mappings":"AAAO,MAAM,mBAAmB;AAAA,EACxB,YAA4B,cAAsB;AAAtB,SAAA,eAAA;AAAA,EAAuB;AAC3D;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDerivedField.js","sources":["../../../src/entityEvents/useDerivedField.ts"],"sourcesContent":["import { useCallback, useEffect } from 'react'\nimport { useDesugaredRelativeSingleField, useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { FieldAccessor } from '../accessors'\nimport type { FieldValue, SugaredRelativeSingleField } from '../treeParameters'\n\nconst identityFunction = <Value>(value: Value) => value\n\n// TODO this is fundamentally wrong. This shouldn't only happen on beforeUpdate, but also on initialize.\n// \twe need a useEffect equivalent.\n\n/**\n * Derived fields are meant for cases when the user is expected to primarily edit the `sourceField` whose optionally\n * transformed value is then copied to the `derivedField`. This happens after each update until either the `derivedField`\n * is touched or until it is persisted at which point the tie between the fields is automatically severed.\n * @deprecated This is fundamentally wrong and shouldn't be used for now.\n */\nexport const useDerivedField = <SourceValue extends FieldValue = FieldValue>(\n\tsourceField: string | SugaredRelativeSingleField,\n\tderivedField: string | SugaredRelativeSingleField,\n\ttransform: (sourceValue: SourceValue | null) => SourceValue | null = identityFunction,\n\tagent: string = 'derivedField',\n) => {\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst potentiallyStaleParent = getEntityByKey(entityKey)\n\tconst stableGetEntityReference = potentiallyStaleParent.getAccessor\n\n\tconst desugaredSource = useDesugaredRelativeSingleField(sourceField)\n\tconst desugaredDerived = useDesugaredRelativeSingleField(derivedField)\n\n\tconst potentiallyStaleSourceAccessor = potentiallyStaleParent.getRelativeSingleField<SourceValue>(desugaredSource)\n\tconst stableGetSourceReference = potentiallyStaleSourceAccessor.getAccessor\n\n\tconst onBeforeUpdate = useCallback<FieldAccessor.BeforeUpdateListener<SourceValue>>(\n\t\tsourceAccessor => {\n\t\t\tstableGetEntityReference().batchUpdates(getAccessor => {\n\t\t\t\t// This is tricky: we're deliberately getting the Entity, and not the field\n\t\t\t\tconst derivedHostEntity = getAccessor().getRelativeSingleEntity(desugaredDerived)\n\n\t\t\t\tif (derivedHostEntity.existsOnServer) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tconst derivedAccessor = getAccessor().getRelativeSingleField<SourceValue>(desugaredDerived)\n\n\t\t\t\tif (derivedAccessor.isTouched) {\n\t\t\t\t\t// Querying the user\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tconst transformedValue = transform(sourceAccessor.value)\n\t\t\t\tderivedAccessor.updateValue(transformedValue, {\n\t\t\t\t\tagent,\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\t\t[stableGetEntityReference, desugaredDerived, transform, agent],\n\t)\n\n\tuseEffect(\n\t\t() => stableGetSourceReference().addEventListener({ type: 'beforeUpdate' }, onBeforeUpdate),\n\t\t[onBeforeUpdate, stableGetSourceReference],\n\t)\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,mBAAmB,CAAQ,UAAiB;
|
|
1
|
+
{"version":3,"file":"useDerivedField.js","sources":["../../../src/entityEvents/useDerivedField.ts"],"sourcesContent":["import { useCallback, useEffect } from 'react'\nimport { useDesugaredRelativeSingleField, useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { FieldAccessor } from '../accessors'\nimport type { FieldValue, SugaredRelativeSingleField } from '../treeParameters'\n\nconst identityFunction = <Value>(value: Value) => value\n\n// TODO this is fundamentally wrong. This shouldn't only happen on beforeUpdate, but also on initialize.\n// \twe need a useEffect equivalent.\n\n/**\n * Derived fields are meant for cases when the user is expected to primarily edit the `sourceField` whose optionally\n * transformed value is then copied to the `derivedField`. This happens after each update until either the `derivedField`\n * is touched or until it is persisted at which point the tie between the fields is automatically severed.\n * @deprecated This is fundamentally wrong and shouldn't be used for now.\n */\nexport const useDerivedField = <SourceValue extends FieldValue = FieldValue>(\n\tsourceField: string | SugaredRelativeSingleField,\n\tderivedField: string | SugaredRelativeSingleField,\n\ttransform: (sourceValue: SourceValue | null) => SourceValue | null = identityFunction,\n\tagent: string = 'derivedField',\n) => {\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst potentiallyStaleParent = getEntityByKey(entityKey)\n\tconst stableGetEntityReference = potentiallyStaleParent.getAccessor\n\n\tconst desugaredSource = useDesugaredRelativeSingleField(sourceField)\n\tconst desugaredDerived = useDesugaredRelativeSingleField(derivedField)\n\n\tconst potentiallyStaleSourceAccessor = potentiallyStaleParent.getRelativeSingleField<SourceValue>(desugaredSource)\n\tconst stableGetSourceReference = potentiallyStaleSourceAccessor.getAccessor\n\n\tconst onBeforeUpdate = useCallback<FieldAccessor.BeforeUpdateListener<SourceValue>>(\n\t\tsourceAccessor => {\n\t\t\tstableGetEntityReference().batchUpdates(getAccessor => {\n\t\t\t\t// This is tricky: we're deliberately getting the Entity, and not the field\n\t\t\t\tconst derivedHostEntity = getAccessor().getRelativeSingleEntity(desugaredDerived)\n\n\t\t\t\tif (derivedHostEntity.existsOnServer) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tconst derivedAccessor = getAccessor().getRelativeSingleField<SourceValue>(desugaredDerived)\n\n\t\t\t\tif (derivedAccessor.isTouched) {\n\t\t\t\t\t// Querying the user\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tconst transformedValue = transform(sourceAccessor.value)\n\t\t\t\tderivedAccessor.updateValue(transformedValue, {\n\t\t\t\t\tagent,\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\t\t[stableGetEntityReference, desugaredDerived, transform, agent],\n\t)\n\n\tuseEffect(\n\t\t() => stableGetSourceReference().addEventListener({ type: 'beforeUpdate' }, onBeforeUpdate),\n\t\t[onBeforeUpdate, stableGetSourceReference],\n\t)\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,mBAAmB,CAAQ,UAAiB;AAW3C,MAAM,kBAAkB,CAC9B,aACA,cACA,YAAqE,kBACrE,QAAgB,mBACZ;AACJ,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACjB,QAAA,yBAAyB,eAAe,SAAS;AACvD,QAAM,2BAA2B,uBAAuB;AAElD,QAAA,kBAAkB,gCAAgC,WAAW;AAC7D,QAAA,mBAAmB,gCAAgC,YAAY;AAE/D,QAAA,iCAAiC,uBAAuB,uBAAoC,eAAe;AACjH,QAAM,2BAA2B,+BAA+B;AAE1D,QAAA,iBAAiB,YACtB,CAAkB,mBAAA;AACQ,6BAAA,EAAE,aAAa,CAAe,gBAAA;AAEtD,YAAM,oBAAoB,YAAA,EAAc,wBAAwB,gBAAgB;AAEhF,UAAI,kBAAkB,gBAAgB;AACrC;AAAA,MACD;AAEA,YAAM,kBAAkB,YAAA,EAAc,uBAAoC,gBAAgB;AAE1F,UAAI,gBAAgB,WAAW;AAE9B;AAAA,MACD;AAEM,YAAA,mBAAmB,UAAU,eAAe,KAAK;AACvD,sBAAgB,YAAY,kBAAkB;AAAA,QAC7C;AAAA,MAAA,CACA;AAAA,IAAA,CACD;AAAA,KAEF,CAAC,0BAA0B,kBAAkB,WAAW,KAAK,CAC9D;AAEA,YACC,MAAM,2BAA2B,iBAAiB,EAAE,MAAM,eAAe,GAAG,cAAc,GAC1F,CAAC,gBAAgB,wBAAwB,CAC1C;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityBeforePersist.js","sources":["../../../src/entityEvents/useEntityBeforePersist.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport { useEntityEvent } from './useEntityEvent'\n\nexport const useEntityBeforePersist = (listener: EntityAccessor.EntityEventListenerMap['beforePersist']) => {\n\tuseEntityEvent('beforePersist', listener)\n}\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"useEntityBeforePersist.js","sources":["../../../src/entityEvents/useEntityBeforePersist.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport { useEntityEvent } from './useEntityEvent'\n\nexport const useEntityBeforePersist = (listener: EntityAccessor.EntityEventListenerMap['beforePersist']) => {\n\tuseEntityEvent('beforePersist', listener)\n}\n"],"names":[],"mappings":";AAGa,MAAA,yBAAyB,CAAC,aAAqE;AAC3G,iBAAe,iBAAiB,QAAQ;AACzC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityBeforeUpdate.js","sources":["../../../src/entityEvents/useEntityBeforeUpdate.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport { useEntityEvent } from './useEntityEvent'\n\nexport const useEntityBeforeUpdate = (listener: EntityAccessor.EntityEventListenerMap['beforeUpdate']) => {\n\tuseEntityEvent('beforeUpdate', listener)\n}\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"useEntityBeforeUpdate.js","sources":["../../../src/entityEvents/useEntityBeforeUpdate.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport { useEntityEvent } from './useEntityEvent'\n\nexport const useEntityBeforeUpdate = (listener: EntityAccessor.EntityEventListenerMap['beforeUpdate']) => {\n\tuseEntityEvent('beforeUpdate', listener)\n}\n"],"names":[],"mappings":";AAGa,MAAA,wBAAwB,CAAC,aAAoE;AACzG,iBAAe,gBAAgB,QAAQ;AACxC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityEvent.js","sources":["../../../src/entityEvents/useEntityEvent.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport type { FieldName } from '../treeParameters'\n\nexport function useEntityEvent(\n\ttype: 'beforePersist',\n\tlistener: EntityAccessor.EntityEventListenerMap['beforePersist'],\n): void\nexport function useEntityEvent(\n\ttype: 'beforeUpdate',\n\tlistener: EntityAccessor.EntityEventListenerMap['beforeUpdate'],\n): void\nexport function useEntityEvent(\n\ttype: 'connectionUpdate',\n\thasOneField: FieldName,\n\tlistener: EntityAccessor.EntityEventListenerMap['connectionUpdate'],\n): void\nexport function useEntityEvent(\n\ttype: 'persistError',\n\tlistener: EntityAccessor.EntityEventListenerMap['persistError'],\n): void\nexport function useEntityEvent(\n\ttype: 'persistSuccess',\n\tlistener: EntityAccessor.EntityEventListenerMap['persistSuccess'],\n): void\nexport function useEntityEvent(type: 'update', listener: EntityAccessor.EntityEventListenerMap['update']): void\nexport function useEntityEvent(type: keyof EntityAccessor.RuntimeEntityEventListenerMap, ...args: unknown[]): void {\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst potentiallyStaleParent = getEntityByKey(entityKey)\n\n\t// The identity of this function is guaranteed to be stable\n\tconst stableGetEntityReference = potentiallyStaleParent.getAccessor\n\n\tuseEffect(() => {\n\t\t// addEventListener returns an unsubscribe function, which we're deliberately re-returning from here.\n\t\tconst entityAccessor = stableGetEntityReference()\n\t\tif (type === 'connectionUpdate') {\n\t\t\treturn entityAccessor.addEventListener(\n\t\t\t\t{\n\t\t\t\t\ttype,\n\t\t\t\t\tkey: args[0] as string,\n\t\t\t\t},\n\t\t\t\targs[1] as any,\n\t\t\t)\n\t\t} else {\n\t\t\treturn entityAccessor.addEventListener(\n\t\t\t\t{\n\t\t\t\t\ttype,\n\t\t\t\t},\n\t\t\t\targs[0] as any,\n\t\t\t)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [...args, stableGetEntityReference])\n}\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"useEntityEvent.js","sources":["../../../src/entityEvents/useEntityEvent.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport type { FieldName } from '../treeParameters'\n\nexport function useEntityEvent(\n\ttype: 'beforePersist',\n\tlistener: EntityAccessor.EntityEventListenerMap['beforePersist'],\n): void\nexport function useEntityEvent(\n\ttype: 'beforeUpdate',\n\tlistener: EntityAccessor.EntityEventListenerMap['beforeUpdate'],\n): void\nexport function useEntityEvent(\n\ttype: 'connectionUpdate',\n\thasOneField: FieldName,\n\tlistener: EntityAccessor.EntityEventListenerMap['connectionUpdate'],\n): void\nexport function useEntityEvent(\n\ttype: 'persistError',\n\tlistener: EntityAccessor.EntityEventListenerMap['persistError'],\n): void\nexport function useEntityEvent(\n\ttype: 'persistSuccess',\n\tlistener: EntityAccessor.EntityEventListenerMap['persistSuccess'],\n): void\nexport function useEntityEvent(type: 'update', listener: EntityAccessor.EntityEventListenerMap['update']): void\nexport function useEntityEvent(type: keyof EntityAccessor.RuntimeEntityEventListenerMap, ...args: unknown[]): void {\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst potentiallyStaleParent = getEntityByKey(entityKey)\n\n\t// The identity of this function is guaranteed to be stable\n\tconst stableGetEntityReference = potentiallyStaleParent.getAccessor\n\n\tuseEffect(() => {\n\t\t// addEventListener returns an unsubscribe function, which we're deliberately re-returning from here.\n\t\tconst entityAccessor = stableGetEntityReference()\n\t\tif (type === 'connectionUpdate') {\n\t\t\treturn entityAccessor.addEventListener(\n\t\t\t\t{\n\t\t\t\t\ttype,\n\t\t\t\t\tkey: args[0] as string,\n\t\t\t\t},\n\t\t\t\targs[1] as any,\n\t\t\t)\n\t\t} else {\n\t\t\treturn entityAccessor.addEventListener(\n\t\t\t\t{\n\t\t\t\t\ttype,\n\t\t\t\t},\n\t\t\t\targs[0] as any,\n\t\t\t)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [...args, stableGetEntityReference])\n}\n"],"names":[],"mappings":";;;AA2BO,wBAAwB,SAA6D,MAAuB;AAClH,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACjB,QAAA,yBAAyB,eAAe,SAAS;AAGvD,QAAM,2BAA2B,uBAAuB;AAExD,YAAU,MAAM;AAEf,UAAM,iBAAiB;AACvB,QAAI,SAAS,oBAAoB;AAChC,aAAO,eAAe,iBACrB;AAAA,QACC;AAAA,QACA,KAAK,KAAK;AAAA,MAAA,GAEX,KAAK,EACN;AAAA,IAAA,OACM;AACN,aAAO,eAAe,iBACrB;AAAA,QACC;AAAA,MAAA,GAED,KAAK,EACN;AAAA,IACD;AAAA,EAEE,GAAA,CAAC,GAAG,MAAM,wBAAwB,CAAC;AACvC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityPersistError.js","sources":["../../../src/entityEvents/useEntityPersistError.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport { useEntityEvent } from './useEntityEvent'\n\nexport const useEntityPersistError = (listener: EntityAccessor.EntityEventListenerMap['persistError']) => {\n\tuseEntityEvent('persistError', listener)\n}\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"useEntityPersistError.js","sources":["../../../src/entityEvents/useEntityPersistError.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport { useEntityEvent } from './useEntityEvent'\n\nexport const useEntityPersistError = (listener: EntityAccessor.EntityEventListenerMap['persistError']) => {\n\tuseEntityEvent('persistError', listener)\n}\n"],"names":[],"mappings":";AAGa,MAAA,wBAAwB,CAAC,aAAoE;AACzG,iBAAe,gBAAgB,QAAQ;AACxC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityPersistSuccess.js","sources":["../../../src/entityEvents/useEntityPersistSuccess.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport { useEntityEvent } from './useEntityEvent'\n\nexport const useEntityPersistSuccess = (listener: EntityAccessor.EntityEventListenerMap['persistSuccess']) => {\n\tuseEntityEvent('persistSuccess', listener)\n}\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"useEntityPersistSuccess.js","sources":["../../../src/entityEvents/useEntityPersistSuccess.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport { useEntityEvent } from './useEntityEvent'\n\nexport const useEntityPersistSuccess = (listener: EntityAccessor.EntityEventListenerMap['persistSuccess']) => {\n\tuseEntityEvent('persistSuccess', listener)\n}\n"],"names":[],"mappings":";AAGa,MAAA,0BAA0B,CAAC,aAAsE;AAC7G,iBAAe,kBAAkB,QAAQ;AAC1C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOnConnectionUpdate.js","sources":["../../../src/entityEvents/useOnConnectionUpdate.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport type { FieldName } from '../treeParameters'\nimport { useEntityEvent } from './useEntityEvent'\n\nexport const useOnConnectionUpdate = (\n\tfieldName: FieldName,\n\tlistener: EntityAccessor.EntityEventListenerMap['connectionUpdate'],\n) => {\n\tuseEntityEvent('connectionUpdate', fieldName, listener)\n}\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"useOnConnectionUpdate.js","sources":["../../../src/entityEvents/useOnConnectionUpdate.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport type { FieldName } from '../treeParameters'\nimport { useEntityEvent } from './useEntityEvent'\n\nexport const useOnConnectionUpdate = (\n\tfieldName: FieldName,\n\tlistener: EntityAccessor.EntityEventListenerMap['connectionUpdate'],\n) => {\n\tuseEntityEvent('connectionUpdate', fieldName, listener)\n}\n"],"names":[],"mappings":";AAIa,MAAA,wBAAwB,CACpC,WACA,aACI;AACW,iBAAA,oBAAoB,WAAW,QAAQ;AACvD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldHelper.js","sources":["../../../../src/fieldHelpers/helpers/FieldHelper.ts"],"sourcesContent":["import { FieldAccessor } from '../../accessors'\nimport type { FieldValue } from '../../treeParameters'\n\nexport class FieldHelper<Value extends FieldValue = FieldValue> {\n\tprotected readonly getAccessor: FieldAccessor.GetFieldAccessor<Value>\n\n\tpublic constructor(field: FieldAccessor<Value> | FieldAccessor.GetFieldAccessor<Value>) {\n\t\tthis.getAccessor = field instanceof FieldAccessor ? field.getAccessor : field\n\t}\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"FieldHelper.js","sources":["../../../../src/fieldHelpers/helpers/FieldHelper.ts"],"sourcesContent":["import { FieldAccessor } from '../../accessors'\nimport type { FieldValue } from '../../treeParameters'\n\nexport class FieldHelper<Value extends FieldValue = FieldValue> {\n\tprotected readonly getAccessor: FieldAccessor.GetFieldAccessor<Value>\n\n\tpublic constructor(field: FieldAccessor<Value> | FieldAccessor.GetFieldAccessor<Value>) {\n\t\tthis.getAccessor = field instanceof FieldAccessor ? field.getAccessor : field\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAGO,MAAM,YAAmD;AAAA,EAGxD,YAAY,OAAqE;AAFrE;AAGlB,SAAK,cAAc,iBAAiB,gBAAgB,MAAM,cAAc;AAAA,EACzE;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemporalFieldHelper.js","sources":["../../../../src/fieldHelpers/helpers/TemporalFieldHelper.ts"],"sourcesContent":["import type { FieldAccessor } from '../../accessors'\nimport { FieldHelper } from './FieldHelper'\n\nclass TemporalFieldHelper extends FieldHelper<string> {\n\tpublic setToNow(options?: FieldAccessor.UpdateOptions) {\n\t\tthis.getAccessor().updateValue(new Date().toISOString(), options)\n\t}\n\n\t//public setToDate() TODO\n\t//public setToTime() TODO\n\t//public setToDateTime() TODO\n}\nnamespace TemporalFieldHelper {\n\texport const setToNow = (\n\t\tfield: FieldAccessor<string> | FieldAccessor.GetFieldAccessor<string>,\n\t\toptions?: FieldAccessor.UpdateOptions,\n\t) => {\n\t\tnew TemporalFieldHelper(field).setToNow(options)\n\t}\n}\nexport { TemporalFieldHelper }\n"],"names":[],"mappings":";AAGA,
|
|
1
|
+
{"version":3,"file":"TemporalFieldHelper.js","sources":["../../../../src/fieldHelpers/helpers/TemporalFieldHelper.ts"],"sourcesContent":["import type { FieldAccessor } from '../../accessors'\nimport { FieldHelper } from './FieldHelper'\n\nclass TemporalFieldHelper extends FieldHelper<string> {\n\tpublic setToNow(options?: FieldAccessor.UpdateOptions) {\n\t\tthis.getAccessor().updateValue(new Date().toISOString(), options)\n\t}\n\n\t//public setToDate() TODO\n\t//public setToTime() TODO\n\t//public setToDateTime() TODO\n}\nnamespace TemporalFieldHelper {\n\texport const setToNow = (\n\t\tfield: FieldAccessor<string> | FieldAccessor.GetFieldAccessor<string>,\n\t\toptions?: FieldAccessor.UpdateOptions,\n\t) => {\n\t\tnew TemporalFieldHelper(field).setToNow(options)\n\t}\n}\nexport { TemporalFieldHelper }\n"],"names":[],"mappings":";AAGA,MAAM,4BAA4B,YAAoB;AAAA,EAC9C,SAAS,SAAuC;AACjD,SAAA,cAAc,YAAY,IAAI,OAAO,YAAA,GAAe,OAAO;AAAA,EACjE;AAKD;AACA,AAAA,EAAU,yBAAV;AACc,uBAAA,WAAW,CACvB,OACA,YACI;AACJ,QAAI,qBAAoB,KAAK,EAAE,SAAS,OAAO;AAAA,EAAA;AAChD,GANS,uBAAA,uBAAA,CAAA,EAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UuidFieldHelper.js","sources":["../../../../src/fieldHelpers/helpers/UuidFieldHelper.ts"],"sourcesContent":["import { v4 as uuidV4 } from 'uuid'\nimport type { FieldAccessor } from '../../accessors'\nimport { FieldHelper } from './FieldHelper'\n\nclass UuidFieldHelper extends FieldHelper<string> {\n\tpublic setToUuid(options?: FieldAccessor.UpdateOptions) {\n\t\tthis.getAccessor().updateValue(uuidV4(), options)\n\t}\n}\nnamespace UuidFieldHelper {\n\texport const setToUuid = (\n\t\tfield: FieldAccessor<string> | FieldAccessor.GetFieldAccessor<string>,\n\t\toptions?: FieldAccessor.UpdateOptions,\n\t) => {\n\t\tnew UuidFieldHelper(field).setToUuid(options)\n\t}\n}\nexport { UuidFieldHelper }\n"],"names":["uuidV4"],"mappings":";;AAIA,
|
|
1
|
+
{"version":3,"file":"UuidFieldHelper.js","sources":["../../../../src/fieldHelpers/helpers/UuidFieldHelper.ts"],"sourcesContent":["import { v4 as uuidV4 } from 'uuid'\nimport type { FieldAccessor } from '../../accessors'\nimport { FieldHelper } from './FieldHelper'\n\nclass UuidFieldHelper extends FieldHelper<string> {\n\tpublic setToUuid(options?: FieldAccessor.UpdateOptions) {\n\t\tthis.getAccessor().updateValue(uuidV4(), options)\n\t}\n}\nnamespace UuidFieldHelper {\n\texport const setToUuid = (\n\t\tfield: FieldAccessor<string> | FieldAccessor.GetFieldAccessor<string>,\n\t\toptions?: FieldAccessor.UpdateOptions,\n\t) => {\n\t\tnew UuidFieldHelper(field).setToUuid(options)\n\t}\n}\nexport { UuidFieldHelper }\n"],"names":["uuidV4"],"mappings":";;AAIA,MAAM,wBAAwB,YAAoB;AAAA,EAC1C,UAAU,SAAuC;AACvD,SAAK,YAAY,EAAE,YAAYA,MAAU,OAAO;AAAA,EACjD;AACD;AACA,AAAA,EAAU,qBAAV;AACc,mBAAA,YAAY,CACxB,OACA,YACI;AACJ,QAAI,iBAAgB,KAAK,EAAE,UAAU,OAAO;AAAA,EAAA;AAC7C,GANS,mBAAA,mBAAA,CAAA,EAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeferredSubTrees.js","sources":["../../../src/helperComponents/DeferredSubTrees.tsx"],"sourcesContent":["import { ReactNode, useCallback, useEffect, useState } from 'react'\nimport { TreeRootIdProvider, useBindingOperations } from '../accessorPropagation'\nimport { useMutationState } from '../accessorTree'\nimport { Component } from '../coreComponents'\nimport { useEntityBeforePersist } from '../entityEvents'\nimport { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '../markers'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { TreeRootId } from '../treeParameters'\n\nexport interface DeferredSubTreesProps {\n\tfallback: ReactNode\n\tchildren: ReactNode\n}\n\ntype LoadState =\n\t| { name: 'initial' }\n\t| { name: 'loading' }\n\t| {\n\t\t\tname: 'success'\n\t\t\ttreeRootId: TreeRootId | undefined\n\t }\n\nexport const DeferredSubTrees = Component<DeferredSubTreesProps>(\n\tprops => {\n\t\tconst { extendTree } = useBindingOperations()\n\t\tconst isMutating = useMutationState()\n\n\t\tconst [loadState, setLoadState] = useState<LoadState>({ name: 'initial' })\n\n\t\tconst [abortController] = useState(() => new AbortController())\n\t\tconst signal = abortController.signal\n\n\t\tuseEntityBeforePersist(\n\t\t\tuseCallback(getAccessor => {\n\t\t\t\t// This is a hack. We're really just circumventing the change of ids after a creation so that nested\n\t\t\t\t// components don't error.\n\t\t\t\tif (getAccessor().existsOnServer) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tsetLoadState({ name: 'initial' })\n\t\t\t}, []),\n\t\t)\n\n\t\tuseEffect(() => {\n\t\t\treturn () => {\n\t\t\t\tabortController.abort()\n\t\t\t}\n\t\t}, [abortController])\n\n\t\tuseEffect(() => {\n\t\t\tif (isMutating || loadState.name !== 'initial' || signal.aborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetLoadState({ name: 'loading' })\n\n\t\t\tconst newFragment = <OnlyKeepSubTrees>{props.children}</OnlyKeepSubTrees>\n\n\t\t\textendTree(newFragment, { signal })\n\t\t\t\t.then(treeRootId => !signal.aborted && setLoadState({ name: 'success', treeRootId }))\n\t\t\t\t.catch(error => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t})\n\t\t}, [extendTree, isMutating, loadState.name, props.children, signal])\n\n\t\tswitch (loadState.name) {\n\t\t\tcase 'initial':\n\t\t\tcase 'loading':\n\t\t\t\treturn <>{props.fallback}</>\n\t\t\tcase 'success':\n\t\t\t\t// This is tricky. The relations & fields within children will just render normally as if this\n\t\t\t\t// component didn't exist. The sub trees, however, will read the new treeRootId and draw their data\n\t\t\t\t// from the newly loaded batch provided by this component. That way the sub trees (and only the sub trees!)\n\t\t\t\t// effectively get lazy loaded.\n\t\t\t\treturn <TreeRootIdProvider treeRootId={loadState.treeRootId}>{props.children}</TreeRootIdProvider>\n\t\t}\n\t},\n\t{\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t{props.children}\n\t\t\t\t{props.fallback}\n\t\t\t</>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tconst fieldsWithHoistablesMarker = MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment)\n\n\t\t\t// We want to get rid of the subTrees but leave whatever relations and fields are present.\n\t\t\t//\n\t\t\t// Mutating from here is fine since we've literally just created it and no other code could possibly possess\n\t\t\t// a reference to this.\n\t\t\tfieldsWithHoistablesMarker.subTrees?.clear()\n\n\t\t\treturn fieldsWithHoistablesMarker\n\t\t},\n\t},\n\t'DeferredSubTree',\n)\n\nconst OnlyKeepSubTrees = Component<{ children: ReactNode }>(\n\t() => null,\n\t{\n\t\tgenerateBranchMarker: (props, fields) => {\n\t\t\t// This is the complement of the equivalent method above: this time we're only keeping the sub trees.\n\t\t\tconst emptyFields = MarkerFactory.createEntityFieldMarkersContainer(undefined)\n\n\t\t\tif (fields instanceof EntityFieldMarkersContainer) {\n\t\t\t\treturn emptyFields\n\t\t\t}\n\t\t\treturn new EntityFieldsWithHoistablesMarker(emptyFields, fields.subTrees, undefined)\n\t\t},\n\t},\n\t'OnlyKeepSubTrees',\n)\n"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DeferredSubTrees.js","sources":["../../../src/helperComponents/DeferredSubTrees.tsx"],"sourcesContent":["import { ReactNode, useCallback, useEffect, useState } from 'react'\nimport { TreeRootIdProvider, useBindingOperations } from '../accessorPropagation'\nimport { useMutationState } from '../accessorTree'\nimport { Component } from '../coreComponents'\nimport { useEntityBeforePersist } from '../entityEvents'\nimport { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '../markers'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { TreeRootId } from '../treeParameters'\n\nexport interface DeferredSubTreesProps {\n\tfallback: ReactNode\n\tchildren: ReactNode\n}\n\ntype LoadState =\n\t| { name: 'initial' }\n\t| { name: 'loading' }\n\t| {\n\t\t\tname: 'success'\n\t\t\ttreeRootId: TreeRootId | undefined\n\t }\n\nexport const DeferredSubTrees = Component<DeferredSubTreesProps>(\n\tprops => {\n\t\tconst { extendTree } = useBindingOperations()\n\t\tconst isMutating = useMutationState()\n\n\t\tconst [loadState, setLoadState] = useState<LoadState>({ name: 'initial' })\n\n\t\tconst [abortController] = useState(() => new AbortController())\n\t\tconst signal = abortController.signal\n\n\t\tuseEntityBeforePersist(\n\t\t\tuseCallback(getAccessor => {\n\t\t\t\t// This is a hack. We're really just circumventing the change of ids after a creation so that nested\n\t\t\t\t// components don't error.\n\t\t\t\tif (getAccessor().existsOnServer) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tsetLoadState({ name: 'initial' })\n\t\t\t}, []),\n\t\t)\n\n\t\tuseEffect(() => {\n\t\t\treturn () => {\n\t\t\t\tabortController.abort()\n\t\t\t}\n\t\t}, [abortController])\n\n\t\tuseEffect(() => {\n\t\t\tif (isMutating || loadState.name !== 'initial' || signal.aborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetLoadState({ name: 'loading' })\n\n\t\t\tconst newFragment = <OnlyKeepSubTrees>{props.children}</OnlyKeepSubTrees>\n\n\t\t\textendTree(newFragment, { signal })\n\t\t\t\t.then(treeRootId => !signal.aborted && setLoadState({ name: 'success', treeRootId }))\n\t\t\t\t.catch(error => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t})\n\t\t}, [extendTree, isMutating, loadState.name, props.children, signal])\n\n\t\tswitch (loadState.name) {\n\t\t\tcase 'initial':\n\t\t\tcase 'loading':\n\t\t\t\treturn <>{props.fallback}</>\n\t\t\tcase 'success':\n\t\t\t\t// This is tricky. The relations & fields within children will just render normally as if this\n\t\t\t\t// component didn't exist. The sub trees, however, will read the new treeRootId and draw their data\n\t\t\t\t// from the newly loaded batch provided by this component. That way the sub trees (and only the sub trees!)\n\t\t\t\t// effectively get lazy loaded.\n\t\t\t\treturn <TreeRootIdProvider treeRootId={loadState.treeRootId}>{props.children}</TreeRootIdProvider>\n\t\t}\n\t},\n\t{\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t{props.children}\n\t\t\t\t{props.fallback}\n\t\t\t</>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tconst fieldsWithHoistablesMarker = MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment)\n\n\t\t\t// We want to get rid of the subTrees but leave whatever relations and fields are present.\n\t\t\t//\n\t\t\t// Mutating from here is fine since we've literally just created it and no other code could possibly possess\n\t\t\t// a reference to this.\n\t\t\tfieldsWithHoistablesMarker.subTrees?.clear()\n\n\t\t\treturn fieldsWithHoistablesMarker\n\t\t},\n\t},\n\t'DeferredSubTree',\n)\n\nconst OnlyKeepSubTrees = Component<{ children: ReactNode }>(\n\t() => null,\n\t{\n\t\tgenerateBranchMarker: (props, fields) => {\n\t\t\t// This is the complement of the equivalent method above: this time we're only keeping the sub trees.\n\t\t\tconst emptyFields = MarkerFactory.createEntityFieldMarkersContainer(undefined)\n\n\t\t\tif (fields instanceof EntityFieldMarkersContainer) {\n\t\t\t\treturn emptyFields\n\t\t\t}\n\t\t\treturn new EntityFieldsWithHoistablesMarker(emptyFields, fields.subTrees, undefined)\n\t\t},\n\t},\n\t'OnlyKeepSubTrees',\n)\n"],"names":["_jsx","_jsxFragment"],"mappings":";;;;;;;;;AAsBa,MAAA,mBAAmB,UAC/B,CAAS,UAAA;AACF,QAAA,EAAE,eAAe;AACvB,QAAM,aAAa;AAEnB,QAAM,CAAC,WAAW,gBAAgB,SAAoB,EAAE,MAAM,WAAW;AAEzE,QAAM,CAAC,mBAAmB,SAAS,MAAM,IAAI,gBAAiB,CAAA;AAC9D,QAAM,SAAS,gBAAgB;AAE/B,yBACC,YAAY,CAAe,gBAAA;AAGtB,QAAA,cAAc,gBAAgB;AACjC;AAAA,IACD;AACa,iBAAA,EAAE,MAAM,UAAA,CAAW;AAAA,EAAA,GAC9B,CAAA,CAAE,CACN;AAEA,YAAU,MAAM;AACf,WAAO,MAAM;AACZ,sBAAgB,MAAM;AAAA,IAAA;AAAA,EACvB,GACE,CAAC,eAAe,CAAC;AAEpB,YAAU,MAAM;AACf,QAAI,cAAc,UAAU,SAAS,aAAa,OAAO,SAAS;AACjE;AAAA,IACD;AACa,iBAAA,EAAE,MAAM,UAAA,CAAW;AAEhC,UAAM,cAAcA,8BAAC,kBAAkB,MAAA,MAAM,QAAS;AAEtD,eAAW,aAAa,EAAE,OAAA,CAAQ,EAChC,KAAK,gBAAc,CAAC,OAAO,WAAW,aAAa,EAAE,MAAM,WAAW,WAAY,CAAA,CAAC,EACnF,MAAM,CAAS,UAAA;AACf,UAAI,OAAO,SAAS;AACnB;AAAA,MACD;AACM,YAAA;AAAA,IAAA,CACN;AAAA,EAAA,GACA,CAAC,YAAY,YAAY,UAAU,MAAM,MAAM,UAAU,MAAM,CAAC;AAEnE,UAAQ,UAAU;AAAA,SACZ;AAAA,SACA;AACG,aAAAA,8BAAAC,UAAA,MAAG,MAAM,QAAS;AAAA,SACrB;AAKJ,aAAQD,8BAAA,oBAAA;AAAA,QAAmB,YAAY,UAAU;AAAA,MAAA,GAAa,MAAM,QAAS;AAAA;AAEhF,GACA;AAAA,EACC,cAAc,CACb,UAAAA,8BAAAC,UAAA,MACE,MAAM,UACN,MAAM,QACR;AAAA,EAED,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACrD,UAAM,6BAA6B,cAAc,uCAAuC,QAAQ,WAAW;AAM3G,+BAA2B,UAAU;AAE9B,WAAA;AAAA,EACR;AACD,GACA,iBACD;AAEA,MAAM,mBAAmB,UACxB,MAAM,MACN;AAAA,EACC,sBAAsB,CAAC,OAAO,WAAW;AAElC,UAAA,cAAc,cAAc,kCAAkC,MAAS;AAE7E,QAAI,kBAAkB,6BAA6B;AAC3C,aAAA;AAAA,IACR;AACA,WAAO,IAAI,iCAAiC,aAAa,OAAO,UAAU,MAAS;AAAA,EACpF;AACD,GACA,kBACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityView.js","sources":["../../../src/helperComponents/EntityView.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport type { SugaredRelativeSingleEntity } from '../treeParameters'\n\nexport interface EntityViewProps {\n\trender: (entity: EntityAccessor) => ReactNode\n\tfield?: string | SugaredRelativeSingleEntity\n}\n\nexport function EntityView(props: EntityViewProps) {\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst entity = 'field' in props ? useEntity(props.field)! : useEntity()\n\n\treturn <>{props.render(entity)}</>\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"EntityView.js","sources":["../../../src/helperComponents/EntityView.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport type { SugaredRelativeSingleEntity } from '../treeParameters'\n\nexport interface EntityViewProps {\n\trender: (entity: EntityAccessor) => ReactNode\n\tfield?: string | SugaredRelativeSingleEntity\n}\n\nexport function EntityView(props: EntityViewProps) {\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst entity = 'field' in props ? useEntity(props.field)! : useEntity()\n\n\treturn <>{props.render(entity)}</>\n}\n"],"names":["_jsx","_jsxFragment"],"mappings":";;AAUO,oBAAoB,OAAwB;AAElD,QAAM,SAAS,WAAW,QAAQ,UAAU,MAAM,KAAK,IAAK;AAE5D,SAAUA,8BAAAC,UAAA,MAAA,MAAM,OAAO,MAAM,CAAE;AAChC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldView.js","sources":["../../../src/helperComponents/FieldView.tsx"],"sourcesContent":["import { useArrayMapMemo, useConstantLengthInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback, useMemo } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport type { FieldAccessor } from '../accessors'\nimport { throwBindingError } from '../BindingError'\nimport { Component } from '../coreComponents'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { FieldValue, RelativeSingleField, SugaredRelativeSingleField } from '../treeParameters'\nimport { SugaredField } from './SugaredField'\n\ninterface FieldViewCommonProps {\n\tfallbackIfUnpersisted?: ReactNode\n}\n\ntype FieldViewProps = FieldViewCommonProps &\n\t(\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfield: string | SugaredRelativeSingleField\n\t\t }\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfields: Array<string | SugaredRelativeSingleField>\n\t\t }\n\t)\n\n// Just short type aliases so that we can type the overloads in a tractable fashion.\ntype FV = FieldValue\ntype SRSF = string | SugaredRelativeSingleField\ntype CP = FieldViewCommonProps\ntype RN = ReactNode\ntype REN = ReactElement | null\n\nexport const FieldView = Component<FieldViewProps>(\n\tprops => {\n\t\tconst { fallbackIfUnpersisted, render } = props\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\n\t\tuseConstantLengthInvariant(\n\t\t\tfields,\n\t\t\t`The number of fields in the 'fields' prop of the 'FieldView' must remain constant between renders!`,\n\t\t)\n\n\t\t// TODO over-subscribe less\n\t\tconst entityAccessor = useEntity()\n\t\tconst environment = entityAccessor.environment\n\n\t\tconst desugarField = useCallback(\n\t\t\t(rsf: SRSF) => QueryLanguage.desugarRelativeSingleField(rsf, environment),\n\t\t\t[environment],\n\t\t)\n\t\tconst desugaredFields = useArrayMapMemo(fields, desugarField)\n\n\t\tconst retrieveField = useCallback(\n\t\t\t(desugaredRsf: RelativeSingleField) => entityAccessor.getRelativeSingleField(desugaredRsf),\n\t\t\t[entityAccessor],\n\t\t)\n\t\tconst accessors = useArrayMapMemo(desugaredFields, retrieveField)\n\n\t\t// TODO we probably want something like useDeferredValue from here.\n\t\t// Will probably just wait for Concurrent React though.\n\t\tconst output = useMemo(() => {\n\t\t\tif (!entityAccessor.existsOnServer && fallbackIfUnpersisted !== undefined) {\n\t\t\t\treturn fallbackIfUnpersisted\n\t\t\t}\n\t\t\treturn render(...accessors)\n\t\t}, [accessors, entityAccessor.existsOnServer, fallbackIfUnpersisted, render])\n\n\t\treturn <>{output}</>\n\t},\n\tprops => {\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{props.fallbackIfUnpersisted}\n\t\t\t\t{fields.map((field, i) => (\n\t\t\t\t\t<SugaredField key={i} field={field} />\n\t\t\t\t))}\n\t\t\t</>\n\t\t)\n\t},\n\t'FieldView',\n) as {\n\t<FV1 extends FV>(props: CP & { field: SRSF; render: (field1: FieldAccessor<FV1>) => RN }): REN\n\t<FV1 extends FV>(props: CP & { fields: [SRSF]; render: (field1: FieldAccessor<FV1>) => RN }): REN\n\t<FV1 extends FV, FV2 extends FV>(\n\t\tprops: CP & { fields: [SRSF, SRSF]; render: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>) => RN },\n\t): REN\n\t<FV1 extends FV, FV2 extends FV, FV3 extends FV>(\n\t\tprops: CP & {\n\t\t\tfields: [SRSF, SRSF, SRSF]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>) => RN\n\t\t},\n\t): REN\n\t<FV1 extends FV, FV2 extends FV, FV3 extends FV, FV4 extends FV>(\n\t\tprops: CP & {\n\t\t\tfields: [SRSF, SRSF, SRSF, SRSF]\n\t\t\trender: (\n\t\t\t\tfield1: FieldAccessor<FV1>,\n\t\t\t\tfield2: FieldAccessor<FV2>,\n\t\t\t\tfield3: FieldAccessor<FV3>,\n\t\t\t\tfield4: FieldAccessor<FV4>,\n\t\t\t) => RN\n\t\t},\n\t): REN\n\t<FV1 extends FV, FV2 extends FV, FV3 extends FV, FV4 extends FV, FV5 extends FV>(\n\t\tprops: CP & {\n\t\t\tfields: [SRSF, SRSF, SRSF, SRSF, SRSF]\n\t\t\trender: (\n\t\t\t\tfield1: FieldAccessor<FV1>,\n\t\t\t\tfield2: FieldAccessor<FV2>,\n\t\t\t\tfield3: FieldAccessor<FV3>,\n\t\t\t\tfield4: FieldAccessor<FV4>,\n\t\t\t\tfield5: FieldAccessor<FV5>,\n\t\t\t) => RN\n\t\t},\n\t): REN\n\t(props: FieldViewProps): REN\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"FieldView.js","sources":["../../../src/helperComponents/FieldView.tsx"],"sourcesContent":["import { useArrayMapMemo, useConstantLengthInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback, useMemo } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport type { FieldAccessor } from '../accessors'\nimport { throwBindingError } from '../BindingError'\nimport { Component } from '../coreComponents'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { FieldValue, RelativeSingleField, SugaredRelativeSingleField } from '../treeParameters'\nimport { SugaredField } from './SugaredField'\n\ninterface FieldViewCommonProps {\n\tfallbackIfUnpersisted?: ReactNode\n}\n\ntype FieldViewProps = FieldViewCommonProps &\n\t(\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfield: string | SugaredRelativeSingleField\n\t\t }\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfields: Array<string | SugaredRelativeSingleField>\n\t\t }\n\t)\n\n// Just short type aliases so that we can type the overloads in a tractable fashion.\ntype FV = FieldValue\ntype SRSF = string | SugaredRelativeSingleField\ntype CP = FieldViewCommonProps\ntype RN = ReactNode\ntype REN = ReactElement | null\n\nexport const FieldView = Component<FieldViewProps>(\n\tprops => {\n\t\tconst { fallbackIfUnpersisted, render } = props\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\n\t\tuseConstantLengthInvariant(\n\t\t\tfields,\n\t\t\t`The number of fields in the 'fields' prop of the 'FieldView' must remain constant between renders!`,\n\t\t)\n\n\t\t// TODO over-subscribe less\n\t\tconst entityAccessor = useEntity()\n\t\tconst environment = entityAccessor.environment\n\n\t\tconst desugarField = useCallback(\n\t\t\t(rsf: SRSF) => QueryLanguage.desugarRelativeSingleField(rsf, environment),\n\t\t\t[environment],\n\t\t)\n\t\tconst desugaredFields = useArrayMapMemo(fields, desugarField)\n\n\t\tconst retrieveField = useCallback(\n\t\t\t(desugaredRsf: RelativeSingleField) => entityAccessor.getRelativeSingleField(desugaredRsf),\n\t\t\t[entityAccessor],\n\t\t)\n\t\tconst accessors = useArrayMapMemo(desugaredFields, retrieveField)\n\n\t\t// TODO we probably want something like useDeferredValue from here.\n\t\t// Will probably just wait for Concurrent React though.\n\t\tconst output = useMemo(() => {\n\t\t\tif (!entityAccessor.existsOnServer && fallbackIfUnpersisted !== undefined) {\n\t\t\t\treturn fallbackIfUnpersisted\n\t\t\t}\n\t\t\treturn render(...accessors)\n\t\t}, [accessors, entityAccessor.existsOnServer, fallbackIfUnpersisted, render])\n\n\t\treturn <>{output}</>\n\t},\n\tprops => {\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{props.fallbackIfUnpersisted}\n\t\t\t\t{fields.map((field, i) => (\n\t\t\t\t\t<SugaredField key={i} field={field} />\n\t\t\t\t))}\n\t\t\t</>\n\t\t)\n\t},\n\t'FieldView',\n) as {\n\t<FV1 extends FV>(props: CP & { field: SRSF; render: (field1: FieldAccessor<FV1>) => RN }): REN\n\t<FV1 extends FV>(props: CP & { fields: [SRSF]; render: (field1: FieldAccessor<FV1>) => RN }): REN\n\t<FV1 extends FV, FV2 extends FV>(\n\t\tprops: CP & { fields: [SRSF, SRSF]; render: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>) => RN },\n\t): REN\n\t<FV1 extends FV, FV2 extends FV, FV3 extends FV>(\n\t\tprops: CP & {\n\t\t\tfields: [SRSF, SRSF, SRSF]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>) => RN\n\t\t},\n\t): REN\n\t<FV1 extends FV, FV2 extends FV, FV3 extends FV, FV4 extends FV>(\n\t\tprops: CP & {\n\t\t\tfields: [SRSF, SRSF, SRSF, SRSF]\n\t\t\trender: (\n\t\t\t\tfield1: FieldAccessor<FV1>,\n\t\t\t\tfield2: FieldAccessor<FV2>,\n\t\t\t\tfield3: FieldAccessor<FV3>,\n\t\t\t\tfield4: FieldAccessor<FV4>,\n\t\t\t) => RN\n\t\t},\n\t): REN\n\t<FV1 extends FV, FV2 extends FV, FV3 extends FV, FV4 extends FV, FV5 extends FV>(\n\t\tprops: CP & {\n\t\t\tfields: [SRSF, SRSF, SRSF, SRSF, SRSF]\n\t\t\trender: (\n\t\t\t\tfield1: FieldAccessor<FV1>,\n\t\t\t\tfield2: FieldAccessor<FV2>,\n\t\t\t\tfield3: FieldAccessor<FV3>,\n\t\t\t\tfield4: FieldAccessor<FV4>,\n\t\t\t\tfield5: FieldAccessor<FV5>,\n\t\t\t) => RN\n\t\t},\n\t): REN\n\t(props: FieldViewProps): REN\n}\n"],"names":["_jsx","_jsxFragment"],"mappings":";;;;;;;AAiCa,MAAA,YAAY,UACxB,CAAS,UAAA;AACF,QAAA,EAAE,uBAAuB,WAAW;AAC1C,QAAM,SACL,YAAY,SAAS,MAAM,QAAQ,MAAM,MAAM,IAC5C,MAAM,SACN,WAAW,SAAS,MAAM,QAC1B,CAAC,MAAM,KAAK,IACZ,kBAAkB,sEAAsE;AAE5F,6BACC,QACA,oGACD;AAGA,QAAM,iBAAiB;AACvB,QAAM,cAAc,eAAe;AAE7B,QAAA,eAAe,YACpB,CAAC,QAAc,cAAc,2BAA2B,KAAK,WAAW,GACxE,CAAC,WAAW,CACb;AACM,QAAA,kBAAkB,gBAAgB,QAAQ,YAAY;AAEtD,QAAA,gBAAgB,YACrB,CAAC,iBAAsC,eAAe,uBAAuB,YAAY,GACzF,CAAC,cAAc,CAChB;AACM,QAAA,YAAY,gBAAgB,iBAAiB,aAAa;AAI1D,QAAA,SAAS,QAAQ,MAAM;AAC5B,QAAI,CAAC,eAAe,kBAAkB,0BAA0B,QAAW;AACnE,aAAA;AAAA,IACR;AACO,WAAA,OAAO,GAAG,SAAS;AAAA,EAAA,GACxB,CAAC,WAAW,eAAe,gBAAgB,uBAAuB,MAAM,CAAC;AAE5E,uDAAU,MAAO;AAClB,GACA,CAAS,UAAA;AACR,QAAM,SACL,YAAY,SAAS,MAAM,QAAQ,MAAM,MAAM,IAC5C,MAAM,SACN,WAAW,SAAS,MAAM,QAC1B,CAAC,MAAM,KAAK,IACZ,kBAAkB,sEAAsE;AAE3F,SAAAA,8BAAAC,UAAA,MACE,MAAM,uBACN,OAAO,IAAI,CAAC,OAAO,MAClBD,8BAAA,cAAA;AAAA,IAAa,KAAK;AAAA,IAAG;AAAA,EAAc,CAAA,CACpC,CACF;AAEF,GACA,WACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticRender.js","sources":["../../../src/helperComponents/StaticRender.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Component } from '../coreComponents'\n\nexport interface StaticRenderProps {\n\tchildren?: ReactNode\n}\n\nexport const StaticRender = Component<StaticRenderProps>(\n\t() => null,\n\t({ children }) => <>{children}</>,\n\t'StaticRender',\n)\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"StaticRender.js","sources":["../../../src/helperComponents/StaticRender.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Component } from '../coreComponents'\n\nexport interface StaticRenderProps {\n\tchildren?: ReactNode\n}\n\nexport const StaticRender = Component<StaticRenderProps>(\n\t() => null,\n\t({ children }) => <>{children}</>,\n\t'StaticRender',\n)\n"],"names":["_jsx","_jsxFragment"],"mappings":";;AAOa,MAAA,eAAe,UAC3B,MAAM,MACN,CAAC,EAAE,eAAeA,8BAAAC,UAAA,MAAG,QAAS,GAC9B,cACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SugaredField.js","sources":["../../../src/helperComponents/SugaredField.tsx"],"sourcesContent":["import { Component, Field, FieldProps } from '../coreComponents'\nimport type { SugaredRelativeSingleField } from '../treeParameters'\nimport { FieldValue } from '../treeParameters'\nimport { ReactElement } from 'react'\n\nexport interface SugaredFieldProps<Persisted extends FieldValue = FieldValue> extends Omit<FieldProps<Persisted>, 'field'> {\n\tfield: string | SugaredRelativeSingleField\n}\n\nexport const SugaredField = Component(<Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => {\n\tif (typeof props.field === 'string') {\n\t\treturn <Field {...props} field={props.field} />\n\t}\n\treturn <Field {...props} {...props.field} />\n}, 'SugaredField') as <Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => ReactElement\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SugaredField.js","sources":["../../../src/helperComponents/SugaredField.tsx"],"sourcesContent":["import { Component, Field, FieldProps } from '../coreComponents'\nimport type { SugaredRelativeSingleField } from '../treeParameters'\nimport { FieldValue } from '../treeParameters'\nimport { ReactElement } from 'react'\n\nexport interface SugaredFieldProps<Persisted extends FieldValue = FieldValue> extends Omit<FieldProps<Persisted>, 'field'> {\n\tfield: string | SugaredRelativeSingleField\n}\n\nexport const SugaredField = Component(<Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => {\n\tif (typeof props.field === 'string') {\n\t\treturn <Field {...props} field={props.field} />\n\t}\n\treturn <Field {...props} {...props.field} />\n}, 'SugaredField') as <Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => ReactElement\n"],"names":["_jsx"],"mappings":";;;AASa,MAAA,eAAe,UAAU,CAA4C,UAAwC;AACrH,MAAA,OAAO,MAAM,UAAU,UAAU;AACpC,WAAQA,8BAAA,OAAA;AAAA,SAAU;AAAA,MAAO,OAAO,MAAM;AAAA,IAAA,CAAO;AAAA,EAC9C;AACA,SAAQA,8BAAA,OAAA;AAAA,OAAU;AAAA,OAAW,MAAM;AAAA,EAAA,CAAO;AAC3C,GAAG,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityFieldMarkersContainer.js","sources":["../../../src/markers/EntityFieldMarkersContainer.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\nimport type { FieldName, PlaceholderName } from '../treeParameters'\nimport { assertNever } from '../utils'\nimport type { EntityFieldMarkers } from './EntityFieldMarkers'\nimport type { EntityFieldPlaceholders } from './EntityFieldPlaceholders'\nimport { FieldMarker } from './FieldMarker'\nimport { HasManyRelationMarker } from './HasManyRelationMarker'\nimport { HasOneRelationMarker } from './HasOneRelationMarker'\n\nexport class EntityFieldMarkersContainer {\n\tpublic constructor(\n\t\tpublic readonly hasAtLeastOneBearingField: boolean,\n\t\tpublic readonly markers: EntityFieldMarkers, // Indexed by placeholder names\n\t\tpublic readonly placeholders: EntityFieldPlaceholders, // Indexed by field names\n\t) {}\n\n\t// …asserting that it's present\n\tpublic getFieldByPlaceholder(placeholder: PlaceholderName): FieldName {\n\t\tconst marker = this.markers.get(placeholder)\n\n\t\tif (marker instanceof FieldMarker) {\n\t\t\treturn marker.fieldName\n\t\t}\n\t\tif (marker instanceof HasOneRelationMarker || marker instanceof HasManyRelationMarker) {\n\t\t\treturn marker.parameters.field\n\t\t}\n\t\tif (marker === undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn assertNever(marker)\n\t}\n\n\tpublic *getPlaceholdersByField(field: FieldName): IterableIterator<PlaceholderName> {\n\t\tconst placeholders = this.placeholders.get(field)\n\n\t\tif (placeholders === undefined) {\n\t\t\treturn\n\t\t}\n\t\tif (typeof placeholders === 'string') {\n\t\t\tyield placeholders\n\t\t\treturn\n\t\t}\n\t\tyield* placeholders.values()\n\t}\n}\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"EntityFieldMarkersContainer.js","sources":["../../../src/markers/EntityFieldMarkersContainer.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\nimport type { FieldName, PlaceholderName } from '../treeParameters'\nimport { assertNever } from '../utils'\nimport type { EntityFieldMarkers } from './EntityFieldMarkers'\nimport type { EntityFieldPlaceholders } from './EntityFieldPlaceholders'\nimport { FieldMarker } from './FieldMarker'\nimport { HasManyRelationMarker } from './HasManyRelationMarker'\nimport { HasOneRelationMarker } from './HasOneRelationMarker'\n\nexport class EntityFieldMarkersContainer {\n\tpublic constructor(\n\t\tpublic readonly hasAtLeastOneBearingField: boolean,\n\t\tpublic readonly markers: EntityFieldMarkers, // Indexed by placeholder names\n\t\tpublic readonly placeholders: EntityFieldPlaceholders, // Indexed by field names\n\t) {}\n\n\t// …asserting that it's present\n\tpublic getFieldByPlaceholder(placeholder: PlaceholderName): FieldName {\n\t\tconst marker = this.markers.get(placeholder)\n\n\t\tif (marker instanceof FieldMarker) {\n\t\t\treturn marker.fieldName\n\t\t}\n\t\tif (marker instanceof HasOneRelationMarker || marker instanceof HasManyRelationMarker) {\n\t\t\treturn marker.parameters.field\n\t\t}\n\t\tif (marker === undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn assertNever(marker)\n\t}\n\n\tpublic *getPlaceholdersByField(field: FieldName): IterableIterator<PlaceholderName> {\n\t\tconst placeholders = this.placeholders.get(field)\n\n\t\tif (placeholders === undefined) {\n\t\t\treturn\n\t\t}\n\t\tif (typeof placeholders === 'string') {\n\t\t\tyield placeholders\n\t\t\treturn\n\t\t}\n\t\tyield* placeholders.values()\n\t}\n}\n"],"names":[],"mappings":";;;;;AASO,MAAM,4BAA4B;AAAA,EACjC,YACU,2BACA,SACA,cACf;AAHe,SAAA,4BAAA;AACA,SAAA,UAAA;AACA,SAAA,eAAA;AAAA,EACd;AAAA,EAGI,sBAAsB,aAAyC;AACrE,UAAM,SAAS,KAAK,QAAQ,IAAI,WAAW;AAE3C,QAAI,kBAAkB,aAAa;AAClC,aAAO,OAAO;AAAA,IACf;AACI,QAAA,kBAAkB,wBAAwB,kBAAkB,uBAAuB;AACtF,aAAO,OAAO,WAAW;AAAA,IAC1B;AACA,QAAI,WAAW,QAAW;AACzB,YAAM,IAAI,aAAa;AAAA,IACxB;AACA,WAAO,YAAkB;AAAA,EAC1B;AAAA,GAEQ,uBAAuB,OAAqD;AACnF,UAAM,eAAe,KAAK,aAAa,IAAI,KAAK;AAEhD,QAAI,iBAAiB,QAAW;AAC/B;AAAA,IACD;AACI,QAAA,OAAO,iBAAiB,UAAU;AAC/B,YAAA;AACN;AAAA,IACD;AACA,WAAO,aAAa;EACrB;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityFieldsWithHoistablesMarker.js","sources":["../../../src/markers/EntityFieldsWithHoistablesMarker.ts"],"sourcesContent":["import type { ParentEntityParameters } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport type { SubTreeMarkers } from './SubTreeMarkers'\n\nexport class EntityFieldsWithHoistablesMarker {\n\tpublic constructor(\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly subTrees: SubTreeMarkers | undefined,\n\t\tpublic readonly parentReference: ParentEntityParameters | undefined,\n\t) {}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityFieldsWithHoistablesMarker.js","sources":["../../../src/markers/EntityFieldsWithHoistablesMarker.ts"],"sourcesContent":["import type { ParentEntityParameters } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport type { SubTreeMarkers } from './SubTreeMarkers'\n\nexport class EntityFieldsWithHoistablesMarker {\n\tpublic constructor(\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly subTrees: SubTreeMarkers | undefined,\n\t\tpublic readonly parentReference: ParentEntityParameters | undefined,\n\t) {}\n}\n"],"names":[],"mappings":"AAIO,MAAM,iCAAiC;AAAA,EACtC,YACU,QACA,UACA,iBACf;AAHe,SAAA,SAAA;AACA,SAAA,WAAA;AACA,SAAA,kBAAA;AAAA,EACd;AACJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityListSubTreeMarker.js","sources":["../../../src/markers/EntityListSubTreeMarker.ts"],"sourcesContent":["import type { Environment } from '../dao'\nimport type { QualifiedEntityList, UnconstrainedQualifiedEntityList } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\nexport class EntityListSubTreeMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getEntityListSubTreePlaceholder(this.parameters)\n\t}\n\n\tpublic get entityName() {\n\t\treturn this.parameters.entityName\n\t}\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"EntityListSubTreeMarker.js","sources":["../../../src/markers/EntityListSubTreeMarker.ts"],"sourcesContent":["import type { Environment } from '../dao'\nimport type { QualifiedEntityList, UnconstrainedQualifiedEntityList } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\nexport class EntityListSubTreeMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getEntityListSubTreePlaceholder(this.parameters)\n\t}\n\n\tpublic get entityName() {\n\t\treturn this.parameters.entityName\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAKO,MAAM,wBAAwB;AAAA,EAG7B,YACU,YACA,QACA,aACf;AANc;AAGC,SAAA,aAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AAEhB,SAAK,kBAAkB,qBAAqB,gCAAgC,KAAK,UAAU;AAAA,EAC5F;AAAA,MAEW,aAAa;AACvB,WAAO,KAAK,WAAW;AAAA,EACxB;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntitySubTreeMarker.js","sources":["../../../src/markers/EntitySubTreeMarker.ts"],"sourcesContent":["import type { Environment } from '../dao'\nimport type { QualifiedSingleEntity, UnconstrainedQualifiedSingleEntity } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\nexport class EntitySubTreeMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getEntitySubTreePlaceholder(this.parameters)\n\t}\n\n\tpublic get entityName() {\n\t\treturn this.parameters.entityName\n\t}\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"EntitySubTreeMarker.js","sources":["../../../src/markers/EntitySubTreeMarker.ts"],"sourcesContent":["import type { Environment } from '../dao'\nimport type { QualifiedSingleEntity, UnconstrainedQualifiedSingleEntity } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\nexport class EntitySubTreeMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getEntitySubTreePlaceholder(this.parameters)\n\t}\n\n\tpublic get entityName() {\n\t\treturn this.parameters.entityName\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAKO,MAAM,oBAAoB;AAAA,EAGzB,YACU,YACA,QACA,aACf;AANc;AAGC,SAAA,aAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AAEhB,SAAK,kBAAkB,qBAAqB,4BAA4B,KAAK,UAAU;AAAA,EACxF;AAAA,MAEW,aAAa;AACvB,WAAO,KAAK,WAAW;AAAA,EACxB;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldMarker.js","sources":["../../../src/markers/FieldMarker.ts"],"sourcesContent":["import type { FieldName, FieldValue } from '../treeParameters'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\n/**\n * A nonbearing field is only defined in context of create mutations. An entity will be created if and only if some\n * other fields (not just nonbearing fields) are filled as well. This is particularly useful for programmatically\n * controlled fields within repeaters.\n */\nexport class FieldMarker {\n\tpublic readonly placeholderName: string\n\n\tconstructor(\n\t\tpublic readonly fieldName: FieldName,\n\t\tpublic readonly defaultValue?: FieldValue,\n\t\tpublic readonly isNonbearing: boolean = false,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getFieldPlaceholder(this.fieldName)\n\t}\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"FieldMarker.js","sources":["../../../src/markers/FieldMarker.ts"],"sourcesContent":["import type { FieldName, FieldValue } from '../treeParameters'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\n/**\n * A nonbearing field is only defined in context of create mutations. An entity will be created if and only if some\n * other fields (not just nonbearing fields) are filled as well. This is particularly useful for programmatically\n * controlled fields within repeaters.\n */\nexport class FieldMarker {\n\tpublic readonly placeholderName: string\n\n\tconstructor(\n\t\tpublic readonly fieldName: FieldName,\n\t\tpublic readonly defaultValue?: FieldValue,\n\t\tpublic readonly isNonbearing: boolean = false,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getFieldPlaceholder(this.fieldName)\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAQO,MAAM,YAAY;AAAA,EAGxB,YACiB,WACA,cACA,eAAwB,OACvC;AANc;AAGC,SAAA,YAAA;AACA,SAAA,eAAA;AACA,SAAA,eAAA;AAEhB,SAAK,kBAAkB,qBAAqB,oBAAoB,KAAK,SAAS;AAAA,EAC/E;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HasManyRelationMarker.js","sources":["../../../src/markers/HasManyRelationMarker.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\nimport type { Environment } from '../dao'\nimport type { HasManyRelation } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\n// This doesn't represent reduced has many relations.\nexport class HasManyRelationMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: HasManyRelation,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tif (parameters.initialEntityCount < 0 || !Number.isInteger(parameters.initialEntityCount)) {\n\t\t\t\tthrow new BindingError(`The preferred 'initialEntityCount' for a relation must be a non-negative integer!`)\n\t\t\t}\n\t\t}\n\t\tthis.placeholderName = PlaceholderGenerator.getHasManyRelationPlaceholder(this.parameters)\n\t}\n\n\tpublic get isNonbearing() {\n\t\treturn this.parameters.isNonbearing\n\t}\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"HasManyRelationMarker.js","sources":["../../../src/markers/HasManyRelationMarker.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\nimport type { Environment } from '../dao'\nimport type { HasManyRelation } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\n// This doesn't represent reduced has many relations.\nexport class HasManyRelationMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: HasManyRelation,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tif (parameters.initialEntityCount < 0 || !Number.isInteger(parameters.initialEntityCount)) {\n\t\t\t\tthrow new BindingError(`The preferred 'initialEntityCount' for a relation must be a non-negative integer!`)\n\t\t\t}\n\t\t}\n\t\tthis.placeholderName = PlaceholderGenerator.getHasManyRelationPlaceholder(this.parameters)\n\t}\n\n\tpublic get isNonbearing() {\n\t\treturn this.parameters.isNonbearing\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAOO,MAAM,sBAAsB;AAAA,EAG3B,YACU,YACA,QACA,aACf;AANc;AAGC,SAAA,aAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AAOhB,SAAK,kBAAkB,qBAAqB,8BAA8B,KAAK,UAAU;AAAA,EAC1F;AAAA,MAEW,eAAe;AACzB,WAAO,KAAK,WAAW;AAAA,EACxB;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HasOneRelationMarker.js","sources":["../../../src/markers/HasOneRelationMarker.ts"],"sourcesContent":["import type { Environment } from '../dao'\nimport type { HasOneRelation } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\n// This may also represent a reduced has many relation.\nexport class HasOneRelationMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: HasOneRelation,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getHasOneRelationPlaceholder(this.parameters)\n\t}\n\n\tpublic get isNonbearing() {\n\t\treturn this.parameters.isNonbearing\n\t}\n}\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"HasOneRelationMarker.js","sources":["../../../src/markers/HasOneRelationMarker.ts"],"sourcesContent":["import type { Environment } from '../dao'\nimport type { HasOneRelation } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\n// This may also represent a reduced has many relation.\nexport class HasOneRelationMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: HasOneRelation,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getHasOneRelationPlaceholder(this.parameters)\n\t}\n\n\tpublic get isNonbearing() {\n\t\treturn this.parameters.isNonbearing\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAMO,MAAM,qBAAqB;AAAA,EAG1B,YACU,YACA,QACA,aACf;AANc;AAGC,SAAA,aAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AAEhB,SAAK,kBAAkB,qBAAqB,6BAA6B,KAAK,UAAU;AAAA,EACzF;AAAA,MAEW,eAAe;AACzB,WAAO,KAAK,WAAW;AAAA,EACxB;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerTreeRoot.js","sources":["../../../src/markers/MarkerTreeRoot.ts"],"sourcesContent":["import type { Alias, PlaceholderName } from '../treeParameters'\nimport type { SubTreeMarkers } from './SubTreeMarkers'\n\nexport class MarkerTreeRoot {\n\tpublic constructor(\n\t\tpublic readonly subTrees: SubTreeMarkers,\n\t\tpublic readonly placeholdersByAliases: Map<Alias, PlaceholderName>,\n\t) {}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MarkerTreeRoot.js","sources":["../../../src/markers/MarkerTreeRoot.ts"],"sourcesContent":["import type { Alias, PlaceholderName } from '../treeParameters'\nimport type { SubTreeMarkers } from './SubTreeMarkers'\n\nexport class MarkerTreeRoot {\n\tpublic constructor(\n\t\tpublic readonly subTrees: SubTreeMarkers,\n\t\tpublic readonly placeholdersByAliases: Map<Alias, PlaceholderName>,\n\t) {}\n}\n"],"names":[],"mappings":"AAGO,MAAM,eAAe;AAAA,EACpB,YACU,UACA,uBACf;AAFe,SAAA,WAAA;AACA,SAAA,wBAAA;AAAA,EACd;AACJ;;"}
|