@contember/binding 1.0.0-rc.9 → 1.0.3
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 +71 -51
- 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 +28 -26
- 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 -548
- 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 +6 -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 +2 -4
- 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 +18 -3
- 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 +1 -3
- 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/index.js +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 +9 -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 +5 -0
- 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 +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/accessorTree/MutationRequestResponse.d.ts +4 -0
- package/dist/types/accessorTree/MutationRequestResponse.d.ts.map +1 -1
- package/dist/types/accessorTree/QueryRequestResponse.d.ts +4 -0
- package/dist/types/accessorTree/QueryRequestResponse.d.ts.map +1 -1
- package/dist/types/accessorTree/RequestError.d.ts +9 -1
- package/dist/types/accessorTree/RequestError.d.ts.map +1 -1
- package/dist/types/core/DataBinding.d.ts +1 -0
- package/dist/types/core/DataBinding.d.ts.map +1 -1
- package/dist/types/core/StateInitializer.d.ts.map +1 -1
- package/dist/types/queryLanguage/Parser.d.ts +1 -0
- package/dist/types/queryLanguage/Parser.d.ts.map +1 -1
- package/dist/types/queryLanguage/tokenList.d.ts +1 -0
- package/dist/types/queryLanguage/tokenList.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/accessorTree/MutationRequestResponse.ts +1 -0
- package/src/accessorTree/QueryRequestResponse.ts +1 -0
- package/src/accessorTree/RequestError.ts +7 -1
- package/src/core/DataBinding.ts +22 -2
- package/src/core/StateInitializer.ts +1 -3
- package/src/queryLanguage/Parser.ts +12 -1
- package/src/queryLanguage/tokenList.ts +6 -0
- package/src/tsconfig.json +1 -1
- package/src/utils/assertNever.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BijectiveIndexedMap.js","sources":["../../../src/structures/BijectiveIndexedMap.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\n\n// Bijective as in we need to supply the inverse and also guarantee that the values are unique.\n// Provided this invariant, this should behave more or less like a regular map except it has a somewhat special\n// iteration order. Unlike a regular map, which just honors insertion order, this also provides a special method\n// changeKey. With this, we can change the key under which a value (that is already on the map) is accessible.\n// With an ordinary map, that operation would require us to delete the original [K1, V] pair and insert\n// a new one [K2, V]. That would however change the order of iteration. This main purpose of this data structure is\n// the ability to avoid that and enable the value V to preserve its original place.\nexport class BijectiveIndexedMap<K, V> implements Map<K, V> {\n\tprivate readonly valueStore: Map<number, V>\n\tprivate readonly index: Map<K, number>\n\tprivate indexSeed: number\n\n\tprivate readonly inverse: (value: V) => K\n\n\tpublic readonly [Symbol.toStringTag] = 'BijectiveIndexedMap'\n\n\tpublic constructor(originalMap: BijectiveIndexedMap<K, V>)\n\tpublic constructor(inverse: (value: V) => K)\n\tpublic constructor(inverseOrMap: BijectiveIndexedMap<K, V> | ((value: V) => K)) {\n\t\tif (inverseOrMap instanceof BijectiveIndexedMap) {\n\t\t\tthis.valueStore = new Map(inverseOrMap.valueStore)\n\t\t\tthis.index = new Map(inverseOrMap.index)\n\t\t\tthis.indexSeed = inverseOrMap.indexSeed\n\t\t\tthis.inverse = inverseOrMap.inverse\n\t\t} else {\n\t\t\tthis.valueStore = new Map()\n\t\t\tthis.index = new Map()\n\t\t\tthis.indexSeed = 0\n\t\t\tthis.inverse = inverseOrMap\n\t\t}\n\t}\n\n\tprivate getNewIndex() {\n\t\treturn this.indexSeed++\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.valueStore.size\n\t}\n\n\tpublic clear(): void {\n\t\tthis.valueStore.clear()\n\t\tthis.index.clear()\n\t}\n\tpublic delete(key: K): boolean {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn false\n\t\t}\n\t\tthis.valueStore.delete(index)\n\t\tthis.index.delete(key)\n\t\treturn true\n\t}\n\tpublic forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tcallback.call(thisArg, value, key, this)\n\t\t}\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.valueStore.get(index)\n\t}\n\tpublic has(key: K): boolean {\n\t\treturn this.index.has(key)\n\t}\n\tpublic set(key: K, value: V): this {\n\t\tconst existingIndex = this.index.get(key)\n\n\t\tif (existingIndex === undefined) {\n\t\t\tconst newIndex = this.getNewIndex()\n\t\t\tthis.index.set(key, newIndex)\n\t\t\tthis.valueStore.set(newIndex, value)\n\t\t} else {\n\t\t\tthis.valueStore.set(existingIndex, value)\n\t\t}\n\t\treturn this\n\t}\n\n\t// This doesn't use the inverse in order to avoid confusion.\n\t// See the description above.\n\tpublic changeKey(oldKey: K, newKey: K): this {\n\t\tconst index = this.index.get(oldKey)\n\t\tif (index === undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tthis.index.delete(oldKey)\n\t\tthis.index.set(newKey, index)\n\t\treturn this\n\t}\n\n\tpublic changeKeyOrder(newOrder: Iterable<K>) {\n\t\tfor (const key of newOrder) {\n\t\t\tconst keyIndex = this.index.get(key)\n\t\t\tif (keyIndex === undefined) {\n\t\t\t\tthrow new BindingError()\n\t\t\t}\n\t\t\tconst value = this.valueStore.get(keyIndex)!\n\n\t\t\t// This effectively removes value from wherever it was and puts it at the end.\n\t\t\t// Provided newOrder.size is the same as valueStore, by the end of this loop\n\t\t\t// the values will be in the correct order.\n\t\t\tthis.valueStore.delete(keyIndex)\n\t\t\tthis.valueStore.set(keyIndex, value)\n\t\t}\n\t}\n\n\tpublic *[Symbol.iterator](): IterableIterator<[K, V]> {\n\t\tyield* this.entries()\n\t}\n\n\tpublic *entries(): IterableIterator<[K, V]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [this.inverse(value), value]\n\t\t}\n\t}\n\n\tpublic *keys(): IterableIterator<K> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield this.inverse(value)\n\t\t}\n\t}\n\n\tpublic *values(): IterableIterator<V> {\n\t\tfor (const value of this.valueStore.values()) {\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tyield value\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BijectiveIndexedMap.js","sources":["../../../src/structures/BijectiveIndexedMap.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\n\n// Bijective as in we need to supply the inverse and also guarantee that the values are unique.\n// Provided this invariant, this should behave more or less like a regular map except it has a somewhat special\n// iteration order. Unlike a regular map, which just honors insertion order, this also provides a special method\n// changeKey. With this, we can change the key under which a value (that is already on the map) is accessible.\n// With an ordinary map, that operation would require us to delete the original [K1, V] pair and insert\n// a new one [K2, V]. That would however change the order of iteration. This main purpose of this data structure is\n// the ability to avoid that and enable the value V to preserve its original place.\nexport class BijectiveIndexedMap<K, V> implements Map<K, V> {\n\tprivate readonly valueStore: Map<number, V>\n\tprivate readonly index: Map<K, number>\n\tprivate indexSeed: number\n\n\tprivate readonly inverse: (value: V) => K\n\n\tpublic readonly [Symbol.toStringTag] = 'BijectiveIndexedMap'\n\n\tpublic constructor(originalMap: BijectiveIndexedMap<K, V>)\n\tpublic constructor(inverse: (value: V) => K)\n\tpublic constructor(inverseOrMap: BijectiveIndexedMap<K, V> | ((value: V) => K)) {\n\t\tif (inverseOrMap instanceof BijectiveIndexedMap) {\n\t\t\tthis.valueStore = new Map(inverseOrMap.valueStore)\n\t\t\tthis.index = new Map(inverseOrMap.index)\n\t\t\tthis.indexSeed = inverseOrMap.indexSeed\n\t\t\tthis.inverse = inverseOrMap.inverse\n\t\t} else {\n\t\t\tthis.valueStore = new Map()\n\t\t\tthis.index = new Map()\n\t\t\tthis.indexSeed = 0\n\t\t\tthis.inverse = inverseOrMap\n\t\t}\n\t}\n\n\tprivate getNewIndex() {\n\t\treturn this.indexSeed++\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.valueStore.size\n\t}\n\n\tpublic clear(): void {\n\t\tthis.valueStore.clear()\n\t\tthis.index.clear()\n\t}\n\tpublic delete(key: K): boolean {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn false\n\t\t}\n\t\tthis.valueStore.delete(index)\n\t\tthis.index.delete(key)\n\t\treturn true\n\t}\n\tpublic forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tcallback.call(thisArg, value, key, this)\n\t\t}\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.valueStore.get(index)\n\t}\n\tpublic has(key: K): boolean {\n\t\treturn this.index.has(key)\n\t}\n\tpublic set(key: K, value: V): this {\n\t\tconst existingIndex = this.index.get(key)\n\n\t\tif (existingIndex === undefined) {\n\t\t\tconst newIndex = this.getNewIndex()\n\t\t\tthis.index.set(key, newIndex)\n\t\t\tthis.valueStore.set(newIndex, value)\n\t\t} else {\n\t\t\tthis.valueStore.set(existingIndex, value)\n\t\t}\n\t\treturn this\n\t}\n\n\t// This doesn't use the inverse in order to avoid confusion.\n\t// See the description above.\n\tpublic changeKey(oldKey: K, newKey: K): this {\n\t\tconst index = this.index.get(oldKey)\n\t\tif (index === undefined) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tthis.index.delete(oldKey)\n\t\tthis.index.set(newKey, index)\n\t\treturn this\n\t}\n\n\tpublic changeKeyOrder(newOrder: Iterable<K>) {\n\t\tfor (const key of newOrder) {\n\t\t\tconst keyIndex = this.index.get(key)\n\t\t\tif (keyIndex === undefined) {\n\t\t\t\tthrow new BindingError()\n\t\t\t}\n\t\t\tconst value = this.valueStore.get(keyIndex)!\n\n\t\t\t// This effectively removes value from wherever it was and puts it at the end.\n\t\t\t// Provided newOrder.size is the same as valueStore, by the end of this loop\n\t\t\t// the values will be in the correct order.\n\t\t\tthis.valueStore.delete(keyIndex)\n\t\t\tthis.valueStore.set(keyIndex, value)\n\t\t}\n\t}\n\n\tpublic *[Symbol.iterator](): IterableIterator<[K, V]> {\n\t\tyield* this.entries()\n\t}\n\n\tpublic *entries(): IterableIterator<[K, V]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [this.inverse(value), value]\n\t\t}\n\t}\n\n\tpublic *keys(): IterableIterator<K> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield this.inverse(value)\n\t\t}\n\t}\n\n\tpublic *values(): IterableIterator<V> {\n\t\tfor (const value of this.valueStore.values()) {\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tyield value\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AASO,MAAM,oBAA+C;AAAA,EAWpD,YAAY,cAA6D;AAV/D;AACA;AACT;AAES;AAEA,4BAAsB;AAKtC,QAAI,wBAAwB,qBAAqB;AAChD,WAAK,aAAa,IAAI,IAAI,aAAa,UAAU;AACjD,WAAK,QAAQ,IAAI,IAAI,aAAa,KAAK;AACvC,WAAK,YAAY,aAAa;AAC9B,WAAK,UAAU,aAAa;AAAA,IAAA,OACtB;AACD,WAAA,iCAAiB;AACjB,WAAA,4BAAY;AACjB,WAAK,YAAY;AACjB,WAAK,UAAU;AAAA,IAChB;AAAA,EACD;AAAA,EAEQ,cAAc;AACrB,WAAO,KAAK;AAAA,EACb;AAAA,MAEW,OAAe;AACzB,WAAO,KAAK,WAAW;AAAA,EACxB;AAAA,EAEO,QAAc;AACpB,SAAK,WAAW;AAChB,SAAK,MAAM;EACZ;AAAA,EACO,OAAO,KAAiB;AAC9B,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IACR;AACK,SAAA,WAAW,OAAO,KAAK;AACvB,SAAA,MAAM,OAAO,GAAG;AACd,WAAA;AAAA,EACR;AAAA,EACO,QAAQ,UAAsD,SAAqB;AACzF,eAAW,CAAC,KAAK,UAAU,KAAK,WAAW;AAC1C,eAAS,KAAK,SAAS,OAAO,KAAK,IAAI;AAAA,IACxC;AAAA,EACD;AAAA,EAEO,IAAI,KAAuB;AACjC,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IACR;AACO,WAAA,KAAK,WAAW,IAAI,KAAK;AAAA,EACjC;AAAA,EACO,IAAI,KAAiB;AACpB,WAAA,KAAK,MAAM,IAAI,GAAG;AAAA,EAC1B;AAAA,EACO,IAAI,KAAQ,OAAgB;AAClC,UAAM,gBAAgB,KAAK,MAAM,IAAI,GAAG;AAExC,QAAI,kBAAkB,QAAW;AAC1B,YAAA,WAAW,KAAK;AACjB,WAAA,MAAM,IAAI,KAAK,QAAQ;AACvB,WAAA,WAAW,IAAI,UAAU,KAAK;AAAA,IAAA,OAC7B;AACD,WAAA,WAAW,IAAI,eAAe,KAAK;AAAA,IACzC;AACO,WAAA;AAAA,EACR;AAAA,EAIO,UAAU,QAAW,QAAiB;AAC5C,UAAM,QAAQ,KAAK,MAAM,IAAI,MAAM;AACnC,QAAI,UAAU,QAAW;AACxB,YAAM,IAAI,aAAa;AAAA,IACxB;AACK,SAAA,MAAM,OAAO,MAAM;AACnB,SAAA,MAAM,IAAI,QAAQ,KAAK;AACrB,WAAA;AAAA,EACR;AAAA,EAEO,eAAe,UAAuB;AAC5C,eAAW,OAAO,UAAU;AAC3B,YAAM,WAAW,KAAK,MAAM,IAAI,GAAG;AACnC,UAAI,aAAa,QAAW;AAC3B,cAAM,IAAI,aAAa;AAAA,MACxB;AACA,YAAM,QAAQ,KAAK,WAAW,IAAI,QAAQ;AAKrC,WAAA,WAAW,OAAO,QAAQ;AAC1B,WAAA,WAAW,IAAI,UAAU,KAAK;AAAA,IACpC;AAAA,EACD;AAAA,IAhGiB,aAAO,aAkGf,OAAO,aAAsC;AACrD,WAAO,KAAK;EACb;AAAA,GAEQ,UAAoC;AAChC,eAAA,SAAS,KAAK,UAAU;AAClC,YAAM,CAAC,KAAK,QAAQ,KAAK,GAAG,KAAK;AAAA,IAClC;AAAA,EACD;AAAA,GAEQ,OAA4B;AACxB,eAAA,SAAS,KAAK,UAAU;AAC5B,YAAA,KAAK,QAAQ,KAAK;AAAA,IACzB;AAAA,EACD;AAAA,GAEQ,SAA8B;AACrC,eAAW,SAAS,KAAK,WAAW,OAAA,GAAU;AAC7C,UAAI,UAAU,QAAW;AACxB;AAAA,MACD;AACM,YAAA;AAAA,IACP;AAAA,EACD;AACD;;"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
1
7
|
class LRUCache {
|
|
2
8
|
constructor(maxSize) {
|
|
9
|
+
__publicField(this, "cache", /* @__PURE__ */ new Map());
|
|
3
10
|
this.maxSize = maxSize;
|
|
4
11
|
}
|
|
5
|
-
cache = /* @__PURE__ */ new Map();
|
|
6
12
|
get(key) {
|
|
7
13
|
const value = this.cache.get(key);
|
|
8
14
|
if (value !== void 0) {
|
|
@@ -23,6 +29,5 @@ class LRUCache {
|
|
|
23
29
|
return this.cache.keys().next().value;
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
|
-
|
|
27
32
|
export { LRUCache };
|
|
28
33
|
//# sourceMappingURL=LRUCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LRUCache.js","sources":["../../../src/structures/LRUCache.ts"],"sourcesContent":["// This is heavily inspired by https://stackoverflow.com/a/46432113\nexport class LRUCache<Key, Value> {\n\tprivate readonly cache = new Map<Key, Value>()\n\n\tpublic constructor(private readonly maxSize: number) {}\n\n\tpublic get(key: Key): Value | undefined {\n\t\tconst value = this.cache.get(key)\n\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key)\n\t\t\tthis.cache.set(key, value)\n\t\t}\n\t\treturn value\n\t}\n\n\tpublic set(key: Key, value: Value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key) // Refresh this key\n\t\t} else if (this.cache.size === this.maxSize) {\n\t\t\tthis.cache.delete(this.getOldestKey()) // Evict the oldest value\n\t\t}\n\t\tthis.cache.set(key, value)\n\t}\n\n\tprivate getOldestKey(): Key {\n\t\treturn this.cache.keys().next().value\n\t}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LRUCache.js","sources":["../../../src/structures/LRUCache.ts"],"sourcesContent":["// This is heavily inspired by https://stackoverflow.com/a/46432113\nexport class LRUCache<Key, Value> {\n\tprivate readonly cache = new Map<Key, Value>()\n\n\tpublic constructor(private readonly maxSize: number) {}\n\n\tpublic get(key: Key): Value | undefined {\n\t\tconst value = this.cache.get(key)\n\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key)\n\t\t\tthis.cache.set(key, value)\n\t\t}\n\t\treturn value\n\t}\n\n\tpublic set(key: Key, value: Value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key) // Refresh this key\n\t\t} else if (this.cache.size === this.maxSize) {\n\t\t\tthis.cache.delete(this.getOldestKey()) // Evict the oldest value\n\t\t}\n\t\tthis.cache.set(key, value)\n\t}\n\n\tprivate getOldestKey(): Key {\n\t\treturn this.cache.keys().next().value\n\t}\n}\n"],"names":[],"mappings":";;;;;;AACO,MAAM,SAAqB;AAAA,EAG1B,YAA6B,SAAiB;AAFpC,qDAAY;AAEO,SAAA,UAAA;AAAA,EAAkB;AAAA,EAE/C,IAAI,KAA6B;AACvC,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACnB,WAAA,MAAM,OAAO,GAAG;AAChB,WAAA,MAAM,IAAI,KAAK,KAAK;AAAA,IAC1B;AACO,WAAA;AAAA,EACR;AAAA,EAEO,IAAI,KAAU,OAAc;AAClC,QAAI,KAAK,MAAM,IAAI,GAAG,GAAG;AACnB,WAAA,MAAM,OAAO,GAAG;AAAA,IACX,WAAA,KAAK,MAAM,SAAS,KAAK,SAAS;AAC5C,WAAK,MAAM,OAAO,KAAK,aAAc,CAAA;AAAA,IACtC;AACK,SAAA,MAAM,IAAI,KAAK,KAAK;AAAA,EAC1B;AAAA,EAEQ,eAAoB;AAC3B,WAAO,KAAK,MAAM,KAAK,EAAE,OAAO;AAAA,EACjC;AACD;;"}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
1
7
|
class WeakIdCache {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
8
|
+
constructor() {
|
|
9
|
+
__publicField(this, "cache", /* @__PURE__ */ new WeakMap());
|
|
10
|
+
__publicField(this, "seed", 0);
|
|
11
|
+
__publicField(this, "rootId", this.seedToId(this.seed++));
|
|
12
|
+
}
|
|
5
13
|
getId(key) {
|
|
6
14
|
let existing = this.cache.get(key);
|
|
7
15
|
if (existing === void 0) {
|
|
@@ -19,6 +27,5 @@ class WeakIdCache {
|
|
|
19
27
|
return seed.toFixed(0);
|
|
20
28
|
}
|
|
21
29
|
}
|
|
22
|
-
|
|
23
30
|
export { WeakIdCache };
|
|
24
31
|
//# sourceMappingURL=WeakIdCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeakIdCache.js","sources":["../../../src/structures/WeakIdCache.ts"],"sourcesContent":["export class WeakIdCache<K extends object> {\n\tprivate readonly cache = new WeakMap<K, string>()\n\tprivate seed = 0\n\tprivate readonly rootId = this.seedToId(this.seed++)\n\n\tpublic getId(key: K): string {\n\t\tlet existing = this.cache.get(key)\n\n\t\tif (existing === undefined) {\n\t\t\tthis.cache.set(key, (existing = this.seedToId(this.seed++)))\n\t\t}\n\t\treturn existing\n\t}\n\n\tpublic getOptionalKeyId(key: K | undefined): string {\n\t\tif (key === undefined) {\n\t\t\treturn this.rootId\n\t\t}\n\t\treturn this.getId(key)\n\t}\n\n\tprivate seedToId(seed: number): string {\n\t\treturn seed.toFixed(0)\n\t}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WeakIdCache.js","sources":["../../../src/structures/WeakIdCache.ts"],"sourcesContent":["export class WeakIdCache<K extends object> {\n\tprivate readonly cache = new WeakMap<K, string>()\n\tprivate seed = 0\n\tprivate readonly rootId = this.seedToId(this.seed++)\n\n\tpublic getId(key: K): string {\n\t\tlet existing = this.cache.get(key)\n\n\t\tif (existing === undefined) {\n\t\t\tthis.cache.set(key, (existing = this.seedToId(this.seed++)))\n\t\t}\n\t\treturn existing\n\t}\n\n\tpublic getOptionalKeyId(key: K | undefined): string {\n\t\tif (key === undefined) {\n\t\t\treturn this.rootId\n\t\t}\n\t\treturn this.getId(key)\n\t}\n\n\tprivate seedToId(seed: number): string {\n\t\treturn seed.toFixed(0)\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAAO,MAAM,YAA8B;AAAA,EAApC;AACW,qDAAY;AACrB,gCAAO;AACE,kCAAS,KAAK,SAAS,KAAK,MAAM;AAAA;AAAA,EAE5C,MAAM,KAAgB;AAC5B,QAAI,WAAW,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,aAAa,QAAW;AACtB,WAAA,MAAM,IAAI,KAAM,WAAW,KAAK,SAAS,KAAK,MAAM,CAAE;AAAA,IAC5D;AACO,WAAA;AAAA,EACR;AAAA,EAEO,iBAAiB,KAA4B;AACnD,QAAI,QAAQ,QAAW;AACtB,aAAO,KAAK;AAAA,IACb;AACO,WAAA,KAAK,MAAM,GAAG;AAAA,EACtB;AAAA,EAEQ,SAAS,MAAsB;AAC/B,WAAA,KAAK,QAAQ,CAAC;AAAA,EACtB;AACD;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { whereToFilter } from
|
|
2
|
-
|
|
1
|
+
import { whereToFilter } from "@contember/client";
|
|
3
2
|
const wrapFilterInHasOnes = (path, filter) => {
|
|
4
3
|
for (let i = path.length - 1; i >= 0; i--) {
|
|
5
4
|
const current = path[i];
|
|
@@ -17,6 +16,5 @@ const wrapFilterInHasOnes = (path, filter) => {
|
|
|
17
16
|
}
|
|
18
17
|
return filter;
|
|
19
18
|
};
|
|
20
|
-
|
|
21
19
|
export { wrapFilterInHasOnes };
|
|
22
20
|
//# sourceMappingURL=wrapFilterInHasOnes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapFilterInHasOnes.js","sources":["../../../src/treeParameterHelpers/wrapFilterInHasOnes.ts"],"sourcesContent":["import { whereToFilter } from '@contember/client'\nimport type { Filter, HasOneRelation } from '../treeParameters'\n\nexport const wrapFilterInHasOnes = (path: HasOneRelation[], filter: Filter): Filter => {\n\tfor (let i = path.length - 1; i >= 0; i--) {\n\t\tconst current = path[i]\n\n\t\tif (current.reducedBy === undefined) {\n\t\t\tfilter = {\n\t\t\t\t[current.field]: filter,\n\t\t\t}\n\t\t} else {\n\t\t\tfilter = {\n\t\t\t\t[current.field]: {\n\t\t\t\t\tand: [filter, whereToFilter(current.reducedBy)],\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n\treturn filter\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wrapFilterInHasOnes.js","sources":["../../../src/treeParameterHelpers/wrapFilterInHasOnes.ts"],"sourcesContent":["import { whereToFilter } from '@contember/client'\nimport type { Filter, HasOneRelation } from '../treeParameters'\n\nexport const wrapFilterInHasOnes = (path: HasOneRelation[], filter: Filter): Filter => {\n\tfor (let i = path.length - 1; i >= 0; i--) {\n\t\tconst current = path[i]\n\n\t\tif (current.reducedBy === undefined) {\n\t\t\tfilter = {\n\t\t\t\t[current.field]: filter,\n\t\t\t}\n\t\t} else {\n\t\t\tfilter = {\n\t\t\t\t[current.field]: {\n\t\t\t\t\tand: [filter, whereToFilter(current.reducedBy)],\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n\treturn filter\n}\n"],"names":[],"mappings":";AAGa,MAAA,sBAAsB,CAAC,MAAwB,WAA2B;AACtF,WAAS,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK;AAC1C,UAAM,UAAU,KAAK;AAEjB,QAAA,QAAQ,cAAc,QAAW;AAC3B,eAAA;AAAA,SACP,QAAQ,QAAQ;AAAA,MAAA;AAAA,IAClB,OACM;AACG,eAAA;AAAA,SACP,QAAQ,QAAQ;AAAA,UAChB,KAAK,CAAC,QAAQ,cAAc,QAAQ,SAAS,CAAC;AAAA,QAC/C;AAAA,MAAA;AAAA,IAEF;AAAA,EACD;AACO,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityCreationParameters.js","sources":["../../../src/treeParameters/EntityCreationParameters.ts"],"sourcesContent":["import type { SetOnCreate, SugaredSetOnCreate } from './SetOnCreate'\n\nexport const EntityCreationParametersDefaults = {\n\t// forceCreation: false,\n\tisNonbearing: false,\n} as const\n\n\n/*\nIt can be somewhat tricky to understand how these parameters actually work. These are all only relevant when *creating\na new entity*, NOT during updates.\n\nFirst, it is determined if any *bearing* field/relation has anything to be persisted. This occurs:\n- For fields if the resolved value (taking defaultValue into account) is not null\n- For relations if its children have anything to persist (TODO or if forceCreation is true.)\n\nIf at least one of the bearing fields/relations have anything to persist or in the rare case when all fields/relations\nare nonbearing, the nonbearing fields/relations are also processed using the same method as described for bearing\nfields/relations.\n\nLastly, setOnCreate comes to play. It doesn't influence whether the entity will be persisted or not but if after\nall of the above it is concluded that it will, the values from it are used.\n */\nexport interface EntityCreationParameters {\n\t// forceCreation: boolean\n\tisNonbearing: boolean\n\tsetOnCreate: SetOnCreate\n}\n\nexport interface UnsugarableEntityCreationParameters {\n\t// forceCreation?: boolean\n\tisNonbearing?: boolean\n\tsetOnCreate?: SugaredSetOnCreate\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityCreationParameters.js","sources":["../../../src/treeParameters/EntityCreationParameters.ts"],"sourcesContent":["import type { SetOnCreate, SugaredSetOnCreate } from './SetOnCreate'\n\nexport const EntityCreationParametersDefaults = {\n\t// forceCreation: false,\n\tisNonbearing: false,\n} as const\n\n\n/*\nIt can be somewhat tricky to understand how these parameters actually work. These are all only relevant when *creating\na new entity*, NOT during updates.\n\nFirst, it is determined if any *bearing* field/relation has anything to be persisted. This occurs:\n- For fields if the resolved value (taking defaultValue into account) is not null\n- For relations if its children have anything to persist (TODO or if forceCreation is true.)\n\nIf at least one of the bearing fields/relations have anything to persist or in the rare case when all fields/relations\nare nonbearing, the nonbearing fields/relations are also processed using the same method as described for bearing\nfields/relations.\n\nLastly, setOnCreate comes to play. It doesn't influence whether the entity will be persisted or not but if after\nall of the above it is concluded that it will, the values from it are used.\n */\nexport interface EntityCreationParameters {\n\t// forceCreation: boolean\n\tisNonbearing: boolean\n\tsetOnCreate: SetOnCreate\n}\n\nexport interface UnsugarableEntityCreationParameters {\n\t// forceCreation?: boolean\n\tisNonbearing?: boolean\n\tsetOnCreate?: SugaredSetOnCreate\n}\n"],"names":[],"mappings":"AAEO,MAAM,mCAAmC;AAAA,EAE/C,cAAc;AACf;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityListPreferences.js","sources":["../../../src/treeParameters/EntityListPreferences.ts"],"sourcesContent":["export const EntityListPreferencesDefaults: EntityListPreferences = {\n\tinitialEntityCount: 0,\n}\n\nexport interface EntityListPreferences {\n\tinitialEntityCount: number\n}\n\nexport interface UnsugarableEntityListPreferences {\n\tinitialEntityCount?: number\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityListPreferences.js","sources":["../../../src/treeParameters/EntityListPreferences.ts"],"sourcesContent":["export const EntityListPreferencesDefaults: EntityListPreferences = {\n\tinitialEntityCount: 0,\n}\n\nexport interface EntityListPreferences {\n\tinitialEntityCount: number\n}\n\nexport interface UnsugarableEntityListPreferences {\n\tinitialEntityCount?: number\n}\n"],"names":[],"mappings":"AAAO,MAAM,gCAAuD;AAAA,EACnE,oBAAoB;AACrB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventListenersStore.js","sources":["../../../src/treeParameters/EventListenersStore.ts"],"sourcesContent":["type GenericEventsMap<EventTypes extends string> = {\n\t[K in EventTypes]?: (...args: any[]) => void | Promise<void | any>\n}\n\nexport class EventListenersStore<EventTypes extends string, Events extends GenericEventsMap<EventTypes>> {\n\n\tconstructor(\n\t\tprivate readonly parentStoreGetter?: () => EventListenersStore<EventTypes, Events> | undefined,\n\t\tprivate listeners: Map<string, Set<Events[any]>> = new Map(),\n\t) {}\n\n\tset<Type extends EventTypes>(event: { type: Type; key?: string }, listeners: Set<Events[Type]>): void {\n\t\tthis.listeners.set(this.formatMapEntryKey(event), listeners)\n\t}\n\n\tdelete<Type extends EventTypes>(event: { type: Type; key?: string }) {\n\t\tthis.listeners.delete(this.formatMapEntryKey(event))\n\t}\n\n\tdeleteByType<Type extends EventTypes>(type: Type) {\n\t\tconst prefix = this.formatMapEntryKey({ type, key: '' })\n\t\tfor (const eventType of this.listeners.keys()) {\n\t\t\tif (eventType.startsWith(prefix)) {\n\t\t\t\tthis.listeners.delete(eventType)\n\t\t\t}\n\t\t}\n\t}\n\n\tget<Type extends EventTypes>(event: { type: Type; key?: string }): Set<Events[Type]> | undefined {\n\t\tconst ownListeners = this.listeners.get(this.formatMapEntryKey(event))\n\t\tconst parentListeners = this.parentStoreGetter?.()?.get(event)\n\t\tif (!parentListeners) {\n\t\t\treturn ownListeners\n\t\t} else if (!ownListeners) {\n\t\t\treturn parentListeners\n\t\t}\n\t\treturn new Set([...ownListeners, ...parentListeners])\n\t}\n\n\tadd<Type extends EventTypes>(event: { type: Type; key?: string }, handler: Events[Type]): () => void {\n\t\tconst key = this.formatMapEntryKey(event)\n\t\tlet eventListeners = this.addInternal(key, handler)\n\t\treturn () => eventListeners?.delete(handler)\n\t}\n\n\tcloneDeep(): EventListenersStore<EventTypes, Events> {\n\t\tconst store: EventListenersStore<EventTypes, Events> = new EventListenersStore()\n\t\tfor (const [key, value] of this.listeners.entries()) {\n\t\t\tstore.listeners.set(key, new Set(value))\n\t\t}\n\t\treturn store\n\t}\n\n\tclone(): EventListenersStore<EventTypes, Events> {\n\t\tconst store: EventListenersStore<EventTypes, Events> = new EventListenersStore()\n\t\tstore.listeners = new Map(this.listeners)\n\t\treturn store\n\t}\n\n\tappend(other: EventListenersStore<EventTypes, Events>) {\n\t\tfor (const [eventKey, otherListeners] of other.listeners) {\n\t\t\tfor (const listener of otherListeners) {\n\t\t\t\tthis.addInternal(eventKey, listener)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate formatMapEntryKey(event: { type: string; key?: string }): string {\n\t\treturn event.key ? `${event.type}_${event.key ?? ''}` : event.type\n\t}\n\n\tprivate addInternal<Type extends keyof Events>(key: string, handler: Events[Type]) {\n\t\tlet eventListeners = this.listeners.get(key)\n\t\tif (!eventListeners) {\n\t\t\teventListeners = new Set()\n\t\t\tthis.listeners.set(key, eventListeners)\n\t\t}\n\t\teventListeners.add(handler)\n\t\treturn eventListeners\n\t}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EventListenersStore.js","sources":["../../../src/treeParameters/EventListenersStore.ts"],"sourcesContent":["type GenericEventsMap<EventTypes extends string> = {\n\t[K in EventTypes]?: (...args: any[]) => void | Promise<void | any>\n}\n\nexport class EventListenersStore<EventTypes extends string, Events extends GenericEventsMap<EventTypes>> {\n\n\tconstructor(\n\t\tprivate readonly parentStoreGetter?: () => EventListenersStore<EventTypes, Events> | undefined,\n\t\tprivate listeners: Map<string, Set<Events[any]>> = new Map(),\n\t) {}\n\n\tset<Type extends EventTypes>(event: { type: Type; key?: string }, listeners: Set<Events[Type]>): void {\n\t\tthis.listeners.set(this.formatMapEntryKey(event), listeners)\n\t}\n\n\tdelete<Type extends EventTypes>(event: { type: Type; key?: string }) {\n\t\tthis.listeners.delete(this.formatMapEntryKey(event))\n\t}\n\n\tdeleteByType<Type extends EventTypes>(type: Type) {\n\t\tconst prefix = this.formatMapEntryKey({ type, key: '' })\n\t\tfor (const eventType of this.listeners.keys()) {\n\t\t\tif (eventType.startsWith(prefix)) {\n\t\t\t\tthis.listeners.delete(eventType)\n\t\t\t}\n\t\t}\n\t}\n\n\tget<Type extends EventTypes>(event: { type: Type; key?: string }): Set<Events[Type]> | undefined {\n\t\tconst ownListeners = this.listeners.get(this.formatMapEntryKey(event))\n\t\tconst parentListeners = this.parentStoreGetter?.()?.get(event)\n\t\tif (!parentListeners) {\n\t\t\treturn ownListeners\n\t\t} else if (!ownListeners) {\n\t\t\treturn parentListeners\n\t\t}\n\t\treturn new Set([...ownListeners, ...parentListeners])\n\t}\n\n\tadd<Type extends EventTypes>(event: { type: Type; key?: string }, handler: Events[Type]): () => void {\n\t\tconst key = this.formatMapEntryKey(event)\n\t\tlet eventListeners = this.addInternal(key, handler)\n\t\treturn () => eventListeners?.delete(handler)\n\t}\n\n\tcloneDeep(): EventListenersStore<EventTypes, Events> {\n\t\tconst store: EventListenersStore<EventTypes, Events> = new EventListenersStore()\n\t\tfor (const [key, value] of this.listeners.entries()) {\n\t\t\tstore.listeners.set(key, new Set(value))\n\t\t}\n\t\treturn store\n\t}\n\n\tclone(): EventListenersStore<EventTypes, Events> {\n\t\tconst store: EventListenersStore<EventTypes, Events> = new EventListenersStore()\n\t\tstore.listeners = new Map(this.listeners)\n\t\treturn store\n\t}\n\n\tappend(other: EventListenersStore<EventTypes, Events>) {\n\t\tfor (const [eventKey, otherListeners] of other.listeners) {\n\t\t\tfor (const listener of otherListeners) {\n\t\t\t\tthis.addInternal(eventKey, listener)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate formatMapEntryKey(event: { type: string; key?: string }): string {\n\t\treturn event.key ? `${event.type}_${event.key ?? ''}` : event.type\n\t}\n\n\tprivate addInternal<Type extends keyof Events>(key: string, handler: Events[Type]) {\n\t\tlet eventListeners = this.listeners.get(key)\n\t\tif (!eventListeners) {\n\t\t\teventListeners = new Set()\n\t\t\tthis.listeners.set(key, eventListeners)\n\t\t}\n\t\teventListeners.add(handler)\n\t\treturn eventListeners\n\t}\n}\n"],"names":[],"mappings":"AAIO,MAAM,oBAA4F;AAAA,EAExG,YACkB,mBACT,YAA2C,oBAAI,OACtD;AAFgB,SAAA,oBAAA;AACT,SAAA,YAAA;AAAA,EACN;AAAA,EAEH,IAA6B,OAAqC,WAAoC;AACrG,SAAK,UAAU,IAAI,KAAK,kBAAkB,KAAK,GAAG,SAAS;AAAA,EAC5D;AAAA,EAEA,OAAgC,OAAqC;AACpE,SAAK,UAAU,OAAO,KAAK,kBAAkB,KAAK,CAAC;AAAA,EACpD;AAAA,EAEA,aAAsC,MAAY;AACjD,UAAM,SAAS,KAAK,kBAAkB,EAAE,MAAM,KAAK,IAAI;AACvD,eAAW,aAAa,KAAK,UAAU,KAAA,GAAQ;AAC1C,UAAA,UAAU,WAAW,MAAM,GAAG;AAC5B,aAAA,UAAU,OAAO,SAAS;AAAA,MAChC;AAAA,IACD;AAAA,EACD;AAAA,EAEA,IAA6B,OAAoE;AAChG,UAAM,eAAe,KAAK,UAAU,IAAI,KAAK,kBAAkB,KAAK,CAAC;AACrE,UAAM,kBAAkB,KAAK,oBAAoB,GAAG,IAAI,KAAK;AAC7D,QAAI,CAAC,iBAAiB;AACd,aAAA;AAAA,IAAA,WACG,CAAC,cAAc;AAClB,aAAA;AAAA,IACR;AACA,+BAAW,IAAI,CAAC,GAAG,cAAc,GAAG,eAAe,CAAC;AAAA,EACrD;AAAA,EAEA,IAA6B,OAAqC,SAAmC;AAC9F,UAAA,MAAM,KAAK,kBAAkB,KAAK;AACxC,QAAI,iBAAiB,KAAK,YAAY,KAAK,OAAO;AAC3C,WAAA,MAAM,gBAAgB,OAAO,OAAO;AAAA,EAC5C;AAAA,EAEA,YAAqD;AAC9C,UAAA,QAAiD,IAAI;AAC3D,eAAW,CAAC,KAAK,UAAU,KAAK,UAAU,WAAW;AACpD,YAAM,UAAU,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC;AAAA,IACxC;AACO,WAAA;AAAA,EACR;AAAA,EAEA,QAAiD;AAC1C,UAAA,QAAiD,IAAI;AAC3D,UAAM,YAAY,IAAI,IAAI,KAAK,SAAS;AACjC,WAAA;AAAA,EACR;AAAA,EAEA,OAAO,OAAgD;AACtD,eAAW,CAAC,UAAU,mBAAmB,MAAM,WAAW;AACzD,iBAAW,YAAY,gBAAgB;AACjC,aAAA,YAAY,UAAU,QAAQ;AAAA,MACpC;AAAA,IACD;AAAA,EACD;AAAA,EAEQ,kBAAkB,OAA+C;AACjE,WAAA,MAAM,MAAM,GAAG,MAAM,QAAQ,MAAM,OAAO,OAAO,MAAM;AAAA,EAC/D;AAAA,EAEQ,YAAuC,KAAa,SAAuB;AAClF,QAAI,iBAAiB,KAAK,UAAU,IAAI,GAAG;AAC3C,QAAI,CAAC,gBAAgB;AACpB,2CAAqB;AAChB,WAAA,UAAU,IAAI,KAAK,cAAc;AAAA,IACvC;AACA,mBAAe,IAAI,OAAO;AACnB,WAAA;AAAA,EACR;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeafField.js","sources":["../../../src/treeParameters/LeafField.ts"],"sourcesContent":["import type { FieldEventListeners, UnsugarableFieldEventListeners } from './FieldEventListeners'\nimport type { FieldValue, OptionallyVariableFieldValue } from './primitives'\n\n// These are specific to leaf fields. Common but required parameters are in AnyField.\n\nexport const LeafFieldDefaults = {\n\tisNonbearing: false,\n} as const\n\nexport interface LeafField extends FieldEventListeners {\n\tisNonbearing: boolean\n\tdefaultValue: FieldValue | undefined\n}\n\nexport interface UnsugarableLeafField extends UnsugarableFieldEventListeners {\n\tisNonbearing?: boolean\n\tdefaultValue?: OptionallyVariableFieldValue\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LeafField.js","sources":["../../../src/treeParameters/LeafField.ts"],"sourcesContent":["import type { FieldEventListeners, UnsugarableFieldEventListeners } from './FieldEventListeners'\nimport type { FieldValue, OptionallyVariableFieldValue } from './primitives'\n\n// These are specific to leaf fields. Common but required parameters are in AnyField.\n\nexport const LeafFieldDefaults = {\n\tisNonbearing: false,\n} as const\n\nexport interface LeafField extends FieldEventListeners {\n\tisNonbearing: boolean\n\tdefaultValue: FieldValue | undefined\n}\n\nexport interface UnsugarableLeafField extends UnsugarableFieldEventListeners {\n\tisNonbearing?: boolean\n\tdefaultValue?: OptionallyVariableFieldValue\n}\n"],"names":[],"mappings":"AAKO,MAAM,oBAAoB;AAAA,EAChC,cAAc;AACf;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QualifiedEntityParameters.js","sources":["../../../src/treeParameters/QualifiedEntityParameters.ts"],"sourcesContent":["import type { Alias, EntityName, ExpectedQualifiedEntityMutation } from './primitives'\n\nexport const QualifiedEntityParametersDefaults = {\n\texpectedMutation: 'anyMutation',\n} as const\n\nexport interface QualifiedEntityParameters {\n\talias: Set<Alias> | undefined\n\tentityName: EntityName\n\texpectedMutation: ExpectedQualifiedEntityMutation\n}\n\nexport interface SugarableQualifiedEntityParameters {\n\tentityName: EntityName\n}\n\nexport interface UnsugarableQualifiedEntityParameters {\n\talias?: Alias | Set<Alias>\n\texpectedMutation?: ExpectedQualifiedEntityMutation\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QualifiedEntityParameters.js","sources":["../../../src/treeParameters/QualifiedEntityParameters.ts"],"sourcesContent":["import type { Alias, EntityName, ExpectedQualifiedEntityMutation } from './primitives'\n\nexport const QualifiedEntityParametersDefaults = {\n\texpectedMutation: 'anyMutation',\n} as const\n\nexport interface QualifiedEntityParameters {\n\talias: Set<Alias> | undefined\n\tentityName: EntityName\n\texpectedMutation: ExpectedQualifiedEntityMutation\n}\n\nexport interface SugarableQualifiedEntityParameters {\n\tentityName: EntityName\n}\n\nexport interface UnsugarableQualifiedEntityParameters {\n\talias?: Alias | Set<Alias>\n\texpectedMutation?: ExpectedQualifiedEntityMutation\n}\n"],"names":[],"mappings":"AAEO,MAAM,oCAAoC;AAAA,EAChD,kBAAkB;AACnB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Relation.js","sources":["../../../src/treeParameters/Relation.ts"],"sourcesContent":["import type { AnyField, SugarableAnyField } from './AnyField'\nimport type { EntityCreationParameters, UnsugarableEntityCreationParameters } from './EntityCreationParameters'\nimport type { ExpectedRelationMutation } from './primitives'\n\nexport const RelationDefaults = {\n\texpectedMutation: 'anyMutation',\n} as const\n\nexport interface Relation extends AnyField, EntityCreationParameters {\n\texpectedMutation: ExpectedRelationMutation\n}\n\nexport interface SugarableRelation extends SugarableAnyField {}\n\nexport interface UnsugarableRelation extends UnsugarableEntityCreationParameters {\n\texpectedMutation?: ExpectedRelationMutation\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Relation.js","sources":["../../../src/treeParameters/Relation.ts"],"sourcesContent":["import type { AnyField, SugarableAnyField } from './AnyField'\nimport type { EntityCreationParameters, UnsugarableEntityCreationParameters } from './EntityCreationParameters'\nimport type { ExpectedRelationMutation } from './primitives'\n\nexport const RelationDefaults = {\n\texpectedMutation: 'anyMutation',\n} as const\n\nexport interface Relation extends AnyField, EntityCreationParameters {\n\texpectedMutation: ExpectedRelationMutation\n}\n\nexport interface SugarableRelation extends SugarableAnyField {}\n\nexport interface UnsugarableRelation extends UnsugarableEntityCreationParameters {\n\texpectedMutation?: ExpectedRelationMutation\n}\n"],"names":[],"mappings":"AAIO,MAAM,mBAAmB;AAAA,EAC/B,kBAAkB;AACnB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hashing.js","sources":["../../../src/utils/Hashing.ts"],"sourcesContent":["import type {\n\tFilter,\n\tHasManyRelation,\n\tHasOneRelation,\n\tOrderBy,\n\tQualifiedEntityList,\n\tQualifiedSingleEntity,\n\tUnconstrainedQualifiedEntityList,\n\tUnconstrainedQualifiedSingleEntity,\n\tUniqueWhere,\n} from '../treeParameters'\n\n// TODO update hashing so that for offset, 0 == undefined\nexport class Hashing {\n\tpublic static hashHasOneRelation(relation: HasOneRelation): number {\n\t\tconst where: Array<Filter | UniqueWhere | string | undefined> = [\n\t\t\t'upToOne',\n\t\t\trelation.field,\n\t\t\trelation.filter,\n\t\t\trelation.reducedBy,\n\t\t]\n\n\t\treturn Hashing.hashArray(where)\n\t}\n\n\tpublic static hashHasManyRelation(relation: HasManyRelation): number {\n\t\tconst where: Array<Filter | UniqueWhere | OrderBy | string | number | undefined> = [\n\t\t\t'possiblyMany',\n\t\t\trelation.field,\n\t\t\trelation.filter,\n\t\t\t'offset' in relation ? relation.offset : undefined,\n\t\t\t'limit' in relation ? relation.limit : undefined,\n\t\t\t'orderBy' in relation ? relation.orderBy : undefined,\n\t\t]\n\n\t\treturn Hashing.hashArray(where)\n\t}\n\n\tpublic static hashEntityListSubTreeParameters(\n\t\tparameters: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t): number {\n\t\tif (parameters.isCreating) {\n\t\t\treturn Hashing.hashArray([parameters.isCreating, parameters.entityName])\n\t\t}\n\t\treturn Hashing.hashArray([\n\t\t\tparameters.isCreating,\n\t\t\tparameters.entityName,\n\t\t\tparameters.filter,\n\t\t\tparameters.orderBy,\n\t\t\tparameters.offset,\n\t\t\tparameters.limit,\n\t\t])\n\t}\n\n\tpublic static hashEntitySubTreeParameters(\n\t\tparameters: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t): number {\n\t\tif (parameters.isCreating) {\n\t\t\treturn Hashing.hashArray([parameters.isCreating, parameters.entityName])\n\t\t}\n\t\treturn Hashing.hashArray([parameters.isCreating, parameters.where, parameters.entityName, parameters.filter])\n\t}\n\n\tprivate static hashArray(array: any[]): number {\n\t\tconst json = array.map(item => JSON.stringify(item)).join('_')\n\t\treturn Hashing.hash(json)\n\t}\n\n\t// Taken from Java\n\tpublic static hash(str: string): number {\n\t\tlet hash = 0\n\t\tif (str.length === 0) {\n\t\t\treturn hash\n\t\t}\n\t\tfor (let i = 0; i < str.length; i++) {\n\t\t\thash = (hash << 5) - hash + str.charCodeAt(i)\n\t\t\thash = hash & hash // Convert to 32bit integer\n\t\t}\n\t\treturn Math.abs(hash)\n\t}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Hashing.js","sources":["../../../src/utils/Hashing.ts"],"sourcesContent":["import type {\n\tFilter,\n\tHasManyRelation,\n\tHasOneRelation,\n\tOrderBy,\n\tQualifiedEntityList,\n\tQualifiedSingleEntity,\n\tUnconstrainedQualifiedEntityList,\n\tUnconstrainedQualifiedSingleEntity,\n\tUniqueWhere,\n} from '../treeParameters'\n\n// TODO update hashing so that for offset, 0 == undefined\nexport class Hashing {\n\tpublic static hashHasOneRelation(relation: HasOneRelation): number {\n\t\tconst where: Array<Filter | UniqueWhere | string | undefined> = [\n\t\t\t'upToOne',\n\t\t\trelation.field,\n\t\t\trelation.filter,\n\t\t\trelation.reducedBy,\n\t\t]\n\n\t\treturn Hashing.hashArray(where)\n\t}\n\n\tpublic static hashHasManyRelation(relation: HasManyRelation): number {\n\t\tconst where: Array<Filter | UniqueWhere | OrderBy | string | number | undefined> = [\n\t\t\t'possiblyMany',\n\t\t\trelation.field,\n\t\t\trelation.filter,\n\t\t\t'offset' in relation ? relation.offset : undefined,\n\t\t\t'limit' in relation ? relation.limit : undefined,\n\t\t\t'orderBy' in relation ? relation.orderBy : undefined,\n\t\t]\n\n\t\treturn Hashing.hashArray(where)\n\t}\n\n\tpublic static hashEntityListSubTreeParameters(\n\t\tparameters: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t): number {\n\t\tif (parameters.isCreating) {\n\t\t\treturn Hashing.hashArray([parameters.isCreating, parameters.entityName])\n\t\t}\n\t\treturn Hashing.hashArray([\n\t\t\tparameters.isCreating,\n\t\t\tparameters.entityName,\n\t\t\tparameters.filter,\n\t\t\tparameters.orderBy,\n\t\t\tparameters.offset,\n\t\t\tparameters.limit,\n\t\t])\n\t}\n\n\tpublic static hashEntitySubTreeParameters(\n\t\tparameters: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t): number {\n\t\tif (parameters.isCreating) {\n\t\t\treturn Hashing.hashArray([parameters.isCreating, parameters.entityName])\n\t\t}\n\t\treturn Hashing.hashArray([parameters.isCreating, parameters.where, parameters.entityName, parameters.filter])\n\t}\n\n\tprivate static hashArray(array: any[]): number {\n\t\tconst json = array.map(item => JSON.stringify(item)).join('_')\n\t\treturn Hashing.hash(json)\n\t}\n\n\t// Taken from Java\n\tpublic static hash(str: string): number {\n\t\tlet hash = 0\n\t\tif (str.length === 0) {\n\t\t\treturn hash\n\t\t}\n\t\tfor (let i = 0; i < str.length; i++) {\n\t\t\thash = (hash << 5) - hash + str.charCodeAt(i)\n\t\t\thash = hash & hash // Convert to 32bit integer\n\t\t}\n\t\treturn Math.abs(hash)\n\t}\n}\n"],"names":[],"mappings":"AAaO,MAAM,QAAQ;AAAA,SACN,mBAAmB,UAAkC;AAClE,UAAM,QAA0D;AAAA,MAC/D;AAAA,MACA,SAAS;AAAA,MACT,SAAS;AAAA,MACT,SAAS;AAAA,IAAA;AAGH,WAAA,QAAQ,UAAU,KAAK;AAAA,EAC/B;AAAA,SAEc,oBAAoB,UAAmC;AACpE,UAAM,QAA6E;AAAA,MAClF;AAAA,MACA,SAAS;AAAA,MACT,SAAS;AAAA,MACT,YAAY,WAAW,SAAS,SAAS;AAAA,MACzC,WAAW,WAAW,SAAS,QAAQ;AAAA,MACvC,aAAa,WAAW,SAAS,UAAU;AAAA,IAAA;AAGrC,WAAA,QAAQ,UAAU,KAAK;AAAA,EAC/B;AAAA,SAEc,gCACb,YACS;AACT,QAAI,WAAW,YAAY;AAC1B,aAAO,QAAQ,UAAU,CAAC,WAAW,YAAY,WAAW,UAAU,CAAC;AAAA,IACxE;AACA,WAAO,QAAQ,UAAU;AAAA,MACxB,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,IAAA,CACX;AAAA,EACF;AAAA,SAEc,4BACb,YACS;AACT,QAAI,WAAW,YAAY;AAC1B,aAAO,QAAQ,UAAU,CAAC,WAAW,YAAY,WAAW,UAAU,CAAC;AAAA,IACxE;AACO,WAAA,QAAQ,UAAU,CAAC,WAAW,YAAY,WAAW,OAAO,WAAW,YAAY,WAAW,MAAM,CAAC;AAAA,EAC7G;AAAA,SAEe,UAAU,OAAsB;AACxC,UAAA,OAAO,MAAM,IAAI,CAAQ,SAAA,KAAK,UAAU,IAAI,CAAC,EAAE,KAAK,GAAG;AACtD,WAAA,QAAQ,KAAK,IAAI;AAAA,EACzB;AAAA,SAGc,KAAK,KAAqB;AACvC,QAAI,OAAO;AACP,QAAA,IAAI,WAAW,GAAG;AACd,aAAA;AAAA,IACR;AACA,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACpC,aAAgB,SAAA,KAAK,OAAO,IAAI,WAAW,CAAC;AAC5C,aAAO,OAAO;AAAA,IACf;AACO,WAAA,KAAK,IAAI,IAAI;AAAA,EACrB;AACD;;"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { BindingError } from
|
|
2
|
-
|
|
1
|
+
import { BindingError } from "../BindingError.js";
|
|
3
2
|
function assert(arg, message) {
|
|
4
3
|
if (!arg) {
|
|
5
4
|
throw new BindingError(`Assertion fail!${message ? `
|
|
6
5
|
${message}` : ""}`);
|
|
7
6
|
}
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
export { assert };
|
|
11
9
|
//# sourceMappingURL=assert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.js","sources":["../../../src/utils/assert.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\n\nexport function assert(arg: boolean, message?: string): asserts arg {\n\tif (!arg) {\n\t\tthrow new BindingError(`Assertion fail!${message ? `\\n${message}` : ''}`)\n\t}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assert.js","sources":["../../../src/utils/assert.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\n\nexport function assert(arg: boolean, message?: string): asserts arg {\n\tif (!arg) {\n\t\tthrow new BindingError(`Assertion fail!${message ? `\\n${message}` : ''}`)\n\t}\n}\n"],"names":[],"mappings":";AAEO,gBAAgB,KAAc,SAA+B;AACnE,MAAI,CAAC,KAAK;AACH,UAAA,IAAI,aAAa,kBAAkB,UAAU;AAAA,EAAK,YAAY,IAAI;AAAA,EACzE;AACD;;"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { BindingError } from
|
|
2
|
-
|
|
1
|
+
import { BindingError } from "../BindingError.js";
|
|
3
2
|
function assertNever(_) {
|
|
4
|
-
throw new BindingError(`FATAL ERROR. This should absolutely never have happened. Yet, despite all efforts, here we are.Please find solace in having a good laugh about the whole situation. You have just witnessed true harshness of software development. Please report this bug.`);
|
|
3
|
+
throw new BindingError(`FATAL ERROR. This should absolutely never have happened. Yet, despite all efforts, here we are. Please find solace in having a good laugh about the whole situation. You have just witnessed true harshness of software development. Please report this bug.`);
|
|
5
4
|
}
|
|
6
|
-
|
|
7
5
|
export { assertNever };
|
|
8
6
|
//# sourceMappingURL=assertNever.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertNever.js","sources":["../../../src/utils/assertNever.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\n\nexport function assertNever(_: never): never {\n\tthrow new BindingError(\n\t\t`FATAL ERROR. This should absolutely never have happened. Yet, despite all efforts, here we are
|
|
1
|
+
{"version":3,"file":"assertNever.js","sources":["../../../src/utils/assertNever.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\n\nexport function assertNever(_: never): never {\n\tthrow new BindingError(\n\t\t`FATAL ERROR. This should absolutely never have happened. Yet, despite all efforts, here we are. ` +\n\t\t\t`Please find solace in having a good laugh about the whole situation. ` +\n\t\t\t`You have just witnessed true harshness of software development. ` +\n\t\t\t`Please report this bug.`,\n\t)\n}\n"],"names":[],"mappings":";AAEO,qBAAqB,GAAiB;AACtC,QAAA,IAAI,aACT,8PAID;AACD;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const generateEnumerabilityPreventingEntropy = (length = 5) => {
|
|
2
2
|
return (Math.random() * Math.pow(10, length)).toFixed(0).padStart(length, "0");
|
|
3
3
|
};
|
|
4
|
-
|
|
5
4
|
export { generateEnumerabilityPreventingEntropy };
|
|
6
5
|
//# sourceMappingURL=generateEnumerabilityPreventingEntropy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateEnumerabilityPreventingEntropy.js","sources":["../../../src/utils/generateEnumerabilityPreventingEntropy.ts"],"sourcesContent":["export const generateEnumerabilityPreventingEntropy = (length: number = 5): string => {\n\treturn (Math.random() * Math.pow(10, length)).toFixed(0).padStart(length, '0')\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateEnumerabilityPreventingEntropy.js","sources":["../../../src/utils/generateEnumerabilityPreventingEntropy.ts"],"sourcesContent":["export const generateEnumerabilityPreventingEntropy = (length: number = 5): string => {\n\treturn (Math.random() * Math.pow(10, length)).toFixed(0).padStart(length, '0')\n}\n"],"names":[],"mappings":"AAAa,MAAA,yCAAyC,CAAC,SAAiB,MAAc;AACrF,SAAa,MAAA,OAAW,IAAA,KAAK,IAAI,IAAI,MAAM,GAAG,QAAQ,CAAC,EAAE,SAAS,QAAQ,GAAG;AAC9E;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isEmptyObject.js","sources":["../../../src/utils/isEmptyObject.ts"],"sourcesContent":["export const isEmptyObject = (arg: object): boolean => {\n\t// This is faster than Object.keys(arg).length === 0 && arg.constructor === Object\n\tfor (const key in arg) {\n\t\tif (arg.hasOwnProperty(key)) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isEmptyObject.js","sources":["../../../src/utils/isEmptyObject.ts"],"sourcesContent":["export const isEmptyObject = (arg: object): boolean => {\n\t// This is faster than Object.keys(arg).length === 0 && arg.constructor === Object\n\tfor (const key in arg) {\n\t\tif (arg.hasOwnProperty(key)) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"],"names":[],"mappings":"AAAa,MAAA,gBAAgB,CAAC,QAAyB;AAEtD,aAAW,OAAO,KAAK;AAClB,QAAA,IAAI,eAAe,GAAG,GAAG;AACrB,aAAA;AAAA,IACR;AAAA,EACD;AACO,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ucfirst.js","sources":["../../../src/utils/ucfirst.ts"],"sourcesContent":["export const ucfirst = (string: string) => `${string.charAt(0).toUpperCase()}${string.substring(1)}`\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ucfirst.js","sources":["../../../src/utils/ucfirst.ts"],"sourcesContent":["export const ucfirst = (string: string) => `${string.charAt(0).toUpperCase()}${string.substring(1)}`\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,CAAC,WAAmB,GAAG,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,UAAU,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindingError.js","sources":["../../src/BindingError.ts"],"sourcesContent":["export class BindingError extends Error {}\n\nexport const throwBindingError = (message: string): never => {\n\tthrow new BindingError(message)\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BindingError.js","sources":["../../src/BindingError.ts"],"sourcesContent":["export class BindingError extends Error {}\n\nexport const throwBindingError = (message: string): never => {\n\tthrow new BindingError(message)\n}\n"],"names":[],"mappings":"AAAO,MAAM,qBAAqB,MAAM;AAAC;AAE5B,MAAA,oBAAoB,CAAC,YAA2B;AACtD,QAAA,IAAI,aAAa,OAAO;AAC/B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorProvider.js","sources":["../../../src/accessorPropagation/AccessorProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { EntityAccessor } from '../accessors'\nimport { EntityKeyContext } from './EntityKeyContext'\nimport { EnvironmentContext } from './EnvironmentContext'\n\nexport interface EntityProviderProps {\n\taccessor: EntityAccessor\n\tchildren: ReactNode\n}\n\nexport function AccessorProvider(props: EntityProviderProps) {\n\treturn (\n\t\t<EntityKeyContext.Provider value={props.accessor.key}>\n\t\t\t<EnvironmentContext.Provider value={props.accessor.environment}>{props.children}</EnvironmentContext.Provider>\n\t\t</EntityKeyContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AccessorProvider.js","sources":["../../../src/accessorPropagation/AccessorProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { EntityAccessor } from '../accessors'\nimport { EntityKeyContext } from './EntityKeyContext'\nimport { EnvironmentContext } from './EnvironmentContext'\n\nexport interface EntityProviderProps {\n\taccessor: EntityAccessor\n\tchildren: ReactNode\n}\n\nexport function AccessorProvider(props: EntityProviderProps) {\n\treturn (\n\t\t<EntityKeyContext.Provider value={props.accessor.key}>\n\t\t\t<EnvironmentContext.Provider value={props.accessor.environment}>{props.children}</EnvironmentContext.Provider>\n\t\t</EntityKeyContext.Provider>\n\t)\n}\n"],"names":["_jsx"],"mappings":";;;AAUO,0BAA0B,OAA4B;AAE3D,SAAAA,8BAAC,iBAAiB,UAAjB;AAAA,IAA0B,OAAO,MAAM,SAAS;AAAA,EAAA,GAChDA,8BAAC,mBAAmB,UAAnB;AAAA,IAA4B,OAAO,MAAM,SAAS;AAAA,EAAA,GAAc,MAAM,QAAS,CACjF;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindingOperationsContext.js","sources":["../../../src/accessorPropagation/BindingOperationsContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport type { BindingOperations } from '../accessors'\nimport { BindingError } from '../BindingError'\n\nconst getRejecter = (operation: string) => () => {\n\tthrow new BindingError(\n\t\t`Trying to ${operation} but data binding is unavailable. You likely used a bound component outside ` +\n\t\t\t`<DataBindingProvider /> or it tried to reach its accessor whilst the tree was in an non-interactive state ` +\n\t\t\t`(e.g. still loading).`,\n\t)\n}\n\nexport const defaultBindingOperations = Object.freeze<BindingOperations>({\n\tget contentClient() {\n\t\treturn getRejecter('retrieve the content api client')()\n\t},\n\tget systemClient() {\n\t\treturn getRejecter('retrieve the system api client')()\n\t},\n\tget tenantClient() {\n\t\treturn getRejecter('retrieve the tenant api client')()\n\t},\n\tgetEntityListSubTree: getRejecter('retrieve an entity list sub tree'),\n\tgetEntitySubTree: getRejecter('retrieve a single entity sub tree'),\n\tgetEntityByKey: getRejecter('retrieve an entity by key'),\n\tgetTreeFilters: getRejecter('retrieve tree filters'),\n\tbatchDeferredUpdates: getRejecter('batch deferred updates'),\n\textendTree: getRejecter('extendTree'),\n\tpersist: getRejecter('persist'),\n})\n\nexport const BindingOperationsContext = createContext<BindingOperations>(defaultBindingOperations)\n"],"names":[],"mappings":";;AAIA,MAAM,cAAc,CAAC,cAAsB,MAAM;
|
|
1
|
+
{"version":3,"file":"BindingOperationsContext.js","sources":["../../../src/accessorPropagation/BindingOperationsContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport type { BindingOperations } from '../accessors'\nimport { BindingError } from '../BindingError'\n\nconst getRejecter = (operation: string) => () => {\n\tthrow new BindingError(\n\t\t`Trying to ${operation} but data binding is unavailable. You likely used a bound component outside ` +\n\t\t\t`<DataBindingProvider /> or it tried to reach its accessor whilst the tree was in an non-interactive state ` +\n\t\t\t`(e.g. still loading).`,\n\t)\n}\n\nexport const defaultBindingOperations = Object.freeze<BindingOperations>({\n\tget contentClient() {\n\t\treturn getRejecter('retrieve the content api client')()\n\t},\n\tget systemClient() {\n\t\treturn getRejecter('retrieve the system api client')()\n\t},\n\tget tenantClient() {\n\t\treturn getRejecter('retrieve the tenant api client')()\n\t},\n\tgetEntityListSubTree: getRejecter('retrieve an entity list sub tree'),\n\tgetEntitySubTree: getRejecter('retrieve a single entity sub tree'),\n\tgetEntityByKey: getRejecter('retrieve an entity by key'),\n\tgetTreeFilters: getRejecter('retrieve tree filters'),\n\tbatchDeferredUpdates: getRejecter('batch deferred updates'),\n\textendTree: getRejecter('extendTree'),\n\tpersist: getRejecter('persist'),\n})\n\nexport const BindingOperationsContext = createContext<BindingOperations>(defaultBindingOperations)\n"],"names":[],"mappings":";;AAIA,MAAM,cAAc,CAAC,cAAsB,MAAM;AAC1C,QAAA,IAAI,aACT,aAAa,sNAGd;AACD;AAEa,MAAA,2BAA2B,OAAO,OAA0B;AAAA,MACpE,gBAAgB;AACZ,WAAA,YAAY,iCAAiC;EACrD;AAAA,MACI,eAAe;AACX,WAAA,YAAY,gCAAgC;EACpD;AAAA,MACI,eAAe;AACX,WAAA,YAAY,gCAAgC;EACpD;AAAA,EACA,sBAAsB,YAAY,kCAAkC;AAAA,EACpE,kBAAkB,YAAY,mCAAmC;AAAA,EACjE,gBAAgB,YAAY,2BAA2B;AAAA,EACvD,gBAAgB,YAAY,uBAAuB;AAAA,EACnD,sBAAsB,YAAY,wBAAwB;AAAA,EAC1D,YAAY,YAAY,YAAY;AAAA,EACpC,SAAS,YAAY,SAAS;AAC/B,CAAC;AAEY,MAAA,2BAA2B,cAAiC,wBAAwB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindingOperationsProvider.js","sources":["../../../src/accessorPropagation/BindingOperationsProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { BindingOperations } from '../accessors'\nimport { BindingOperationsContext, defaultBindingOperations } from './BindingOperationsContext'\n\nexport interface BindingOperationsProviderProps {\n\tbindingOperations: BindingOperations | undefined\n\tchildren: ReactNode\n}\n\nexport function BindingOperationsProvider(props: BindingOperationsProviderProps) {\n\treturn (\n\t\t<BindingOperationsContext.Provider value={props.bindingOperations || defaultBindingOperations}>\n\t\t\t{props.children}\n\t\t</BindingOperationsContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"BindingOperationsProvider.js","sources":["../../../src/accessorPropagation/BindingOperationsProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { BindingOperations } from '../accessors'\nimport { BindingOperationsContext, defaultBindingOperations } from './BindingOperationsContext'\n\nexport interface BindingOperationsProviderProps {\n\tbindingOperations: BindingOperations | undefined\n\tchildren: ReactNode\n}\n\nexport function BindingOperationsProvider(props: BindingOperationsProviderProps) {\n\treturn (\n\t\t<BindingOperationsContext.Provider value={props.bindingOperations || defaultBindingOperations}>\n\t\t\t{props.children}\n\t\t</BindingOperationsContext.Provider>\n\t)\n}\n"],"names":["_jsx"],"mappings":";;AASO,mCAAmC,OAAuC;AAE/E,SAAAA,8BAAC,yBAAyB,UAAzB;AAAA,IAAkC,OAAO,MAAM,qBAAqB;AAAA,EAAA,GACnE,MAAM,QACR;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityKeyContext.js","sources":["../../../src/accessorPropagation/EntityKeyContext.ts"],"sourcesContent":["import { createContext } from 'react'\n\nexport const EntityKeyContext = createContext<undefined | string>(undefined)\nEntityKeyContext.displayName = 'EntityKeyContext'\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"EntityKeyContext.js","sources":["../../../src/accessorPropagation/EntityKeyContext.ts"],"sourcesContent":["import { createContext } from 'react'\n\nexport const EntityKeyContext = createContext<undefined | string>(undefined)\nEntityKeyContext.displayName = 'EntityKeyContext'\n"],"names":[],"mappings":";AAEa,MAAA,mBAAmB,cAAkC,MAAS;AAC3E,iBAAiB,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityKeyProvider.js","sources":["../../../src/accessorPropagation/EntityKeyProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport interface EntityKeyProviderProps {\n\tentityKey: string\n\tchildren: ReactNode\n}\n\nexport function EntityKeyProvider(props: EntityKeyProviderProps) {\n\treturn <EntityKeyContext.Provider value={props.entityKey}>{props.children}</EntityKeyContext.Provider>\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"EntityKeyProvider.js","sources":["../../../src/accessorPropagation/EntityKeyProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport interface EntityKeyProviderProps {\n\tentityKey: string\n\tchildren: ReactNode\n}\n\nexport function EntityKeyProvider(props: EntityKeyProviderProps) {\n\treturn <EntityKeyContext.Provider value={props.entityKey}>{props.children}</EntityKeyContext.Provider>\n}\n"],"names":["_jsx"],"mappings":";;AAQO,2BAA2B,OAA+B;AACzD,SAAAA,8BAAC,iBAAiB,UAAjB;AAAA,IAA0B,OAAO,MAAM;AAAA,EAAA,GAAY,MAAM,QAAS;AAC3E;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentContext.js","sources":["../../../src/accessorPropagation/EnvironmentContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport { Environment } from '../dao'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"EnvironmentContext.js","sources":["../../../src/accessorPropagation/EnvironmentContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport { Environment } from '../dao'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n"],"names":[],"mappings":";;AAGO,MAAM,qBAAqB,cAA2B,YAAY,QAAQ;AACjF,mBAAmB,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRootIdContext.js","sources":["../../../src/accessorPropagation/TreeRootIdContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport type { TreeRootId } from '../treeParameters'\n\nexport const TreeRootIdContext = createContext<undefined | TreeRootId>(undefined)\nTreeRootIdContext.displayName = 'TreeRootIdContext'\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TreeRootIdContext.js","sources":["../../../src/accessorPropagation/TreeRootIdContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport type { TreeRootId } from '../treeParameters'\n\nexport const TreeRootIdContext = createContext<undefined | TreeRootId>(undefined)\nTreeRootIdContext.displayName = 'TreeRootIdContext'\n"],"names":[],"mappings":";AAGa,MAAA,oBAAoB,cAAsC,MAAS;AAChF,kBAAkB,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRootIdProvider.js","sources":["../../../src/accessorPropagation/TreeRootIdProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { TreeRootId } from '../treeParameters'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport interface TreeRootIdProviderProps {\n\ttreeRootId: TreeRootId | undefined\n\tchildren: ReactNode\n}\n\nexport function TreeRootIdProvider(props: TreeRootIdProviderProps) {\n\treturn <TreeRootIdContext.Provider value={props.treeRootId}>{props.children}</TreeRootIdContext.Provider>\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"TreeRootIdProvider.js","sources":["../../../src/accessorPropagation/TreeRootIdProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { TreeRootId } from '../treeParameters'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport interface TreeRootIdProviderProps {\n\ttreeRootId: TreeRootId | undefined\n\tchildren: ReactNode\n}\n\nexport function TreeRootIdProvider(props: TreeRootIdProviderProps) {\n\treturn <TreeRootIdContext.Provider value={props.treeRootId}>{props.children}</TreeRootIdContext.Provider>\n}\n"],"names":["_jsx"],"mappings":";;AASO,4BAA4B,OAAgC;AAC3D,SAAAA,8BAAC,kBAAkB,UAAlB;AAAA,IAA2B,OAAO,MAAM;AAAA,EAAA,GAAa,MAAM,QAAS;AAC7E;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccessorUpdateSubscription.js","sources":["../../../src/accessorPropagation/useAccessorUpdateSubscription.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { EntityAccessor, EntityListAccessor, FieldAccessor } from '../accessors'\nimport type { FieldValue } from '../treeParameters'\n\nexport type ForceAccessorUpdate = () => void\n\n/**\n * It is VERY IMPORTANT for the parameter to be referentially stable!\n */\nfunction useAccessorUpdateSubscription<Value extends FieldValue = FieldValue>(\n\tgetFieldAccessor: () => FieldAccessor<Value>,\n): FieldAccessor<Value>\nfunction useAccessorUpdateSubscription(getEntityAccessor: () => EntityAccessor): EntityAccessor\nfunction useAccessorUpdateSubscription(getListAccessor: () => EntityListAccessor): EntityListAccessor\nfunction useAccessorUpdateSubscription(\n\tgetAccessor: () => EntityListAccessor | EntityAccessor,\n): EntityListAccessor | EntityAccessor\nfunction useAccessorUpdateSubscription<Value extends FieldValue = FieldValue>(\n\tgetFieldAccessor: () => FieldAccessor<Value>,\n\twithForceUpdate: true,\n): [FieldAccessor<Value>, ForceAccessorUpdate]\nfunction useAccessorUpdateSubscription(\n\tgetEntityAccessor: () => EntityAccessor,\n\twithForceUpdate: true,\n): [EntityAccessor, ForceAccessorUpdate]\nfunction useAccessorUpdateSubscription(\n\tgetListAccessor: () => EntityListAccessor,\n\twithForceUpdate: true,\n): [EntityListAccessor, ForceAccessorUpdate]\nfunction useAccessorUpdateSubscription(\n\tgetAccessor: () => EntityListAccessor | EntityAccessor,\n\twithForceUpdate: true,\n): [EntityListAccessor | EntityAccessor, ForceAccessorUpdate]\nfunction useAccessorUpdateSubscription<\n\tA extends FieldAccessor<Value> | EntityListAccessor | EntityAccessor,\n\tValue extends FieldValue = FieldValue,\n>(getAccessor: () => A, withForceUpdate?: true): A | [A, ForceAccessorUpdate] {\n\t// This is *HEAVILY* adopted from https://github.com/facebook/react/blob/master/packages/use-subscription/src/useSubscription.js\n\tconst [state, setState] = useState<{\n\t\taccessor: A\n\t\tgetAccessor: () => A\n\t}>(() => ({\n\t\taccessor: getAccessor(),\n\t\tgetAccessor,\n\t}))\n\n\tuseConstantValueInvariant(withForceUpdate, 'useAccessorUpdateSubscription: cannot change the withForceUpdate value!')\n\n\tlet accessor = state.accessor\n\n\tif (state.getAccessor !== getAccessor) {\n\t\tsetState({\n\t\t\taccessor: getAccessor(),\n\t\t\tgetAccessor,\n\t\t})\n\t\taccessor = getAccessor()\n\t}\n\n\tlet forceUpdate: ForceAccessorUpdate | undefined = undefined\n\tif (withForceUpdate) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tforceUpdate = useCallback(() => {\n\t\t\tsetState({\n\t\t\t\taccessor: getAccessor(),\n\t\t\t\tgetAccessor,\n\t\t\t})\n\t\t}, [getAccessor])\n\t}\n\n\tuseEffect(() => {\n\t\tlet isStillSubscribed = true\n\n\t\tconst unsubscribe = (\n\t\t\tgetAccessor().addEventListener as (\n\t\t\t\teventType: { type: 'update' },\n\t\t\t\thandler: (newAccessor: FieldAccessor<Value> | EntityListAccessor | EntityAccessor) => void,\n\t\t\t) => () => void\n\t\t)({ type: 'update' }, newAccessor => {\n\t\t\tif (!isStillSubscribed) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tsetState(prevState => {\n\t\t\t\tif (prevState.getAccessor !== getAccessor || prevState.accessor === newAccessor) {\n\t\t\t\t\treturn prevState\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\taccessor: newAccessor as A,\n\t\t\t\t\tgetAccessor,\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\n\t\treturn () => {\n\t\t\tisStillSubscribed = false\n\t\t\tunsubscribe()\n\t\t}\n\t}, [getAccessor])\n\n\tif (withForceUpdate && forceUpdate) {\n\t\treturn [accessor, forceUpdate]\n\t}\n\treturn accessor\n}\nexport { useAccessorUpdateSubscription }\n"],"names":[],"mappings":";;AAkCA,uCAGE,aAAsB,iBAAsD;
|
|
1
|
+
{"version":3,"file":"useAccessorUpdateSubscription.js","sources":["../../../src/accessorPropagation/useAccessorUpdateSubscription.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { EntityAccessor, EntityListAccessor, FieldAccessor } from '../accessors'\nimport type { FieldValue } from '../treeParameters'\n\nexport type ForceAccessorUpdate = () => void\n\n/**\n * It is VERY IMPORTANT for the parameter to be referentially stable!\n */\nfunction useAccessorUpdateSubscription<Value extends FieldValue = FieldValue>(\n\tgetFieldAccessor: () => FieldAccessor<Value>,\n): FieldAccessor<Value>\nfunction useAccessorUpdateSubscription(getEntityAccessor: () => EntityAccessor): EntityAccessor\nfunction useAccessorUpdateSubscription(getListAccessor: () => EntityListAccessor): EntityListAccessor\nfunction useAccessorUpdateSubscription(\n\tgetAccessor: () => EntityListAccessor | EntityAccessor,\n): EntityListAccessor | EntityAccessor\nfunction useAccessorUpdateSubscription<Value extends FieldValue = FieldValue>(\n\tgetFieldAccessor: () => FieldAccessor<Value>,\n\twithForceUpdate: true,\n): [FieldAccessor<Value>, ForceAccessorUpdate]\nfunction useAccessorUpdateSubscription(\n\tgetEntityAccessor: () => EntityAccessor,\n\twithForceUpdate: true,\n): [EntityAccessor, ForceAccessorUpdate]\nfunction useAccessorUpdateSubscription(\n\tgetListAccessor: () => EntityListAccessor,\n\twithForceUpdate: true,\n): [EntityListAccessor, ForceAccessorUpdate]\nfunction useAccessorUpdateSubscription(\n\tgetAccessor: () => EntityListAccessor | EntityAccessor,\n\twithForceUpdate: true,\n): [EntityListAccessor | EntityAccessor, ForceAccessorUpdate]\nfunction useAccessorUpdateSubscription<\n\tA extends FieldAccessor<Value> | EntityListAccessor | EntityAccessor,\n\tValue extends FieldValue = FieldValue,\n>(getAccessor: () => A, withForceUpdate?: true): A | [A, ForceAccessorUpdate] {\n\t// This is *HEAVILY* adopted from https://github.com/facebook/react/blob/master/packages/use-subscription/src/useSubscription.js\n\tconst [state, setState] = useState<{\n\t\taccessor: A\n\t\tgetAccessor: () => A\n\t}>(() => ({\n\t\taccessor: getAccessor(),\n\t\tgetAccessor,\n\t}))\n\n\tuseConstantValueInvariant(withForceUpdate, 'useAccessorUpdateSubscription: cannot change the withForceUpdate value!')\n\n\tlet accessor = state.accessor\n\n\tif (state.getAccessor !== getAccessor) {\n\t\tsetState({\n\t\t\taccessor: getAccessor(),\n\t\t\tgetAccessor,\n\t\t})\n\t\taccessor = getAccessor()\n\t}\n\n\tlet forceUpdate: ForceAccessorUpdate | undefined = undefined\n\tif (withForceUpdate) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tforceUpdate = useCallback(() => {\n\t\t\tsetState({\n\t\t\t\taccessor: getAccessor(),\n\t\t\t\tgetAccessor,\n\t\t\t})\n\t\t}, [getAccessor])\n\t}\n\n\tuseEffect(() => {\n\t\tlet isStillSubscribed = true\n\n\t\tconst unsubscribe = (\n\t\t\tgetAccessor().addEventListener as (\n\t\t\t\teventType: { type: 'update' },\n\t\t\t\thandler: (newAccessor: FieldAccessor<Value> | EntityListAccessor | EntityAccessor) => void,\n\t\t\t) => () => void\n\t\t)({ type: 'update' }, newAccessor => {\n\t\t\tif (!isStillSubscribed) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tsetState(prevState => {\n\t\t\t\tif (prevState.getAccessor !== getAccessor || prevState.accessor === newAccessor) {\n\t\t\t\t\treturn prevState\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\taccessor: newAccessor as A,\n\t\t\t\t\tgetAccessor,\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\n\t\treturn () => {\n\t\t\tisStillSubscribed = false\n\t\t\tunsubscribe()\n\t\t}\n\t}, [getAccessor])\n\n\tif (withForceUpdate && forceUpdate) {\n\t\treturn [accessor, forceUpdate]\n\t}\n\treturn accessor\n}\nexport { useAccessorUpdateSubscription }\n"],"names":[],"mappings":";;AAkCA,uCAGE,aAAsB,iBAAsD;AAE7E,QAAM,CAAC,OAAO,YAAY,SAGvB,MAAO;AAAA,IACT,UAAU,YAAY;AAAA,IACtB;AAAA,EACC,EAAA;AAEF,4BAA0B,iBAAiB,yEAAyE;AAEpH,MAAI,WAAW,MAAM;AAEjB,MAAA,MAAM,gBAAgB,aAAa;AAC7B,aAAA;AAAA,MACR,UAAU,YAAY;AAAA,MACtB;AAAA,IAAA,CACA;AACD,eAAW,YAAY;AAAA,EACxB;AAEA,MAAI,cAA+C;AACnD,MAAI,iBAAiB;AAEpB,kBAAc,YAAY,MAAM;AACtB,eAAA;AAAA,QACR,UAAU,YAAY;AAAA,QACtB;AAAA,MAAA,CACA;AAAA,IAAA,GACC,CAAC,WAAW,CAAC;AAAA,EACjB;AAEA,YAAU,MAAM;AACf,QAAI,oBAAoB;AAElB,UAAA,cACL,cAAc,iBAIb,EAAE,MAAM,SAAA,GAAY,CAAe,gBAAA;AACpC,UAAI,CAAC,mBAAmB;AACvB;AAAA,MACD;AAEA,eAAS,CAAa,cAAA;AACrB,YAAI,UAAU,gBAAgB,eAAe,UAAU,aAAa,aAAa;AACzE,iBAAA;AAAA,QACR;AAEO,eAAA;AAAA,UACN,UAAU;AAAA,UACV;AAAA,QAAA;AAAA,MACD,CACA;AAAA,IAAA,CACD;AAED,WAAO,MAAM;AACQ,0BAAA;AACR;IAAA;AAAA,EACb,GACE,CAAC,WAAW,CAAC;AAEhB,MAAI,mBAAmB,aAAa;AAC5B,WAAA,CAAC,UAAU,WAAW;AAAA,EAC9B;AACO,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBindingOperations.js","sources":["../../../src/accessorPropagation/useBindingOperations.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { BindingOperations } from '../accessors'\nimport { BindingOperationsContext } from './BindingOperationsContext'\n\nexport const useBindingOperations = (): BindingOperations => useContext(BindingOperationsContext)\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"useBindingOperations.js","sources":["../../../src/accessorPropagation/useBindingOperations.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { BindingOperations } from '../accessors'\nimport { BindingOperationsContext } from './BindingOperationsContext'\n\nexport const useBindingOperations = (): BindingOperations => useContext(BindingOperationsContext)\n"],"names":[],"mappings":";;AAIa,MAAA,uBAAuB,MAAyB,WAAW,wBAAwB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeEntityList.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '../treeParameters'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList,\n): RelativeEntityList\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeEntityList | undefined = undefined\n\tlet hasList: boolean\n\n\tif (sugaredRelativeEntityList === undefined) {\n\t\thasList = false\n\t} else if (typeof sugaredRelativeEntityList === 'string') {\n\t\thasList = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeEntityList,\n\t\t}\n\t} else {\n\t\thasList = true\n\t\tnormalizedSugared = sugaredRelativeEntityList\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasList\n\t\t\t\t? QueryLanguage.desugarRelativeEntityList(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tnormalizedSugared?.field,\n\t\t\tnormalizedSugared?.setOnCreate,\n\t\t\tnormalizedSugared?.isNonbearing,\n\t\t\tnormalizedSugared?.offset,\n\t\t\tnormalizedSugared?.limit,\n\t\t\tnormalizedSugared?.orderBy,\n\t\t\thasList,\n\t\t\tenvironment,\n\t\t],\n\t)\n}\n\nexport { useDesugaredRelativeEntityList }\n"],"names":[],"mappings":";;;AAoBA,wCACC,2BACiC;
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeEntityList.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '../treeParameters'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList,\n): RelativeEntityList\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeEntityList | undefined = undefined\n\tlet hasList: boolean\n\n\tif (sugaredRelativeEntityList === undefined) {\n\t\thasList = false\n\t} else if (typeof sugaredRelativeEntityList === 'string') {\n\t\thasList = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeEntityList,\n\t\t}\n\t} else {\n\t\thasList = true\n\t\tnormalizedSugared = sugaredRelativeEntityList\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasList\n\t\t\t\t? QueryLanguage.desugarRelativeEntityList(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tnormalizedSugared?.field,\n\t\t\tnormalizedSugared?.setOnCreate,\n\t\t\tnormalizedSugared?.isNonbearing,\n\t\t\tnormalizedSugared?.offset,\n\t\t\tnormalizedSugared?.limit,\n\t\t\tnormalizedSugared?.orderBy,\n\t\t\thasList,\n\t\t\tenvironment,\n\t\t],\n\t)\n}\n\nexport { useDesugaredRelativeEntityList }\n"],"names":[],"mappings":";;;AAoBA,wCACC,2BACiC;AACjC,QAAM,cAAc;AAEpB,MAAI,oBAA2D;AAC3D,MAAA;AAEJ,MAAI,8BAA8B,QAAW;AAClC,cAAA;AAAA,EAAA,WACA,OAAO,8BAA8B,UAAU;AAC/C,cAAA;AACU,wBAAA;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EACR,OACM;AACI,cAAA;AACU,wBAAA;AAAA,EACrB;AAEA,SAAO,QACN,MACC,UACG,cAAc,0BACd;AAAA,IACC,OAAO,kBAAmB;AAAA,IAC1B,aAAa,mBAAmB;AAAA,IAChC,cAAc,mBAAmB;AAAA,IACjC,QAAQ,mBAAmB;AAAA,IAC3B,OAAO,mBAAmB;AAAA,IAC1B,SAAS,mBAAmB;AAAA,EAAA,GAE7B,WACA,IACA,QAEJ;AAAA,IACC,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB;AAAA,IACA;AAAA,EAAA,CAEF;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleEntity.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '../treeParameters'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity,\n): RelativeSingleEntity\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleEntity | undefined = undefined\n\tlet hasEntity: boolean\n\n\tif (sugaredRelativeSingleEntity === undefined) {\n\t\thasEntity = false\n\t} else if (typeof sugaredRelativeSingleEntity === 'string') {\n\t\thasEntity = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleEntity,\n\t\t}\n\t} else {\n\t\thasEntity = true\n\t\tnormalizedSugared = sugaredRelativeSingleEntity\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasEntity\n\t\t\t\t? QueryLanguage.desugarRelativeSingleEntity(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity],\n\t)\n}\n\nexport { useDesugaredRelativeSingleEntity }\n"],"names":[],"mappings":";;;AAoBA,0CACC,6BACmC;
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleEntity.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '../treeParameters'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity,\n): RelativeSingleEntity\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleEntity | undefined = undefined\n\tlet hasEntity: boolean\n\n\tif (sugaredRelativeSingleEntity === undefined) {\n\t\thasEntity = false\n\t} else if (typeof sugaredRelativeSingleEntity === 'string') {\n\t\thasEntity = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleEntity,\n\t\t}\n\t} else {\n\t\thasEntity = true\n\t\tnormalizedSugared = sugaredRelativeSingleEntity\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasEntity\n\t\t\t\t? QueryLanguage.desugarRelativeSingleEntity(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity],\n\t)\n}\n\nexport { useDesugaredRelativeSingleEntity }\n"],"names":[],"mappings":";;;AAoBA,0CACC,6BACmC;AACnC,QAAM,cAAc;AAEpB,MAAI,oBAA6D;AAC7D,MAAA;AAEJ,MAAI,gCAAgC,QAAW;AAClC,gBAAA;AAAA,EAAA,WACF,OAAO,gCAAgC,UAAU;AAC/C,gBAAA;AACQ,wBAAA;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EACR,OACM;AACM,gBAAA;AACQ,wBAAA;AAAA,EACrB;AAEA,SAAO,QACN,MACC,YACG,cAAc,4BACd;AAAA,IACC,OAAO,kBAAmB;AAAA,IAC1B,cAAc,mBAAmB;AAAA,IACjC,aAAa,mBAAmB;AAAA,EAEjC,GAAA,WACA,IACA,QAEJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,aAAa,aAAa,SAAS,CACnH;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleField.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '../treeParameters'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): RelativeSingleField\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleField | undefined = undefined\n\tlet hasField: boolean\n\n\tif (sugaredRelativeSingleField === undefined) {\n\t\thasField = false\n\t} else if (typeof sugaredRelativeSingleField === 'string') {\n\t\thasField = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleField,\n\t\t}\n\t} else {\n\t\thasField = true\n\t\tnormalizedSugared = sugaredRelativeSingleField\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasField\n\t\t\t\t? QueryLanguage.desugarRelativeSingleField(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField],\n\t)\n}\n\nexport { useDesugaredRelativeSingleField }\n"],"names":[],"mappings":";;;AAoBA,yCACC,4BACkC;
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleField.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '../treeParameters'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): RelativeSingleField\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleField | undefined = undefined\n\tlet hasField: boolean\n\n\tif (sugaredRelativeSingleField === undefined) {\n\t\thasField = false\n\t} else if (typeof sugaredRelativeSingleField === 'string') {\n\t\thasField = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleField,\n\t\t}\n\t} else {\n\t\thasField = true\n\t\tnormalizedSugared = sugaredRelativeSingleField\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasField\n\t\t\t\t? QueryLanguage.desugarRelativeSingleField(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField],\n\t)\n}\n\nexport { useDesugaredRelativeSingleField }\n"],"names":[],"mappings":";;;AAoBA,yCACC,4BACkC;AAClC,QAAM,cAAc;AAEpB,MAAI,oBAA4D;AAC5D,MAAA;AAEJ,MAAI,+BAA+B,QAAW;AAClC,eAAA;AAAA,EAAA,WACD,OAAO,+BAA+B,UAAU;AAC/C,eAAA;AACS,wBAAA;AAAA,MACnB,OAAO;AAAA,IAAA;AAAA,EACR,OACM;AACK,eAAA;AACS,wBAAA;AAAA,EACrB;AAEA,SAAO,QACN,MACC,WACG,cAAc,2BACd;AAAA,IACC,OAAO,kBAAmB;AAAA,IAC1B,cAAc,mBAAmB;AAAA,IACjC,cAAc,mBAAmB;AAAA,EAElC,GAAA,WACA,IACA,QAEJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,cAAc,aAAa,QAAQ,CACnH;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntity.js","sources":["../../../src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeSingleEntity } from '../treeParameters'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity'\n\nfunction useEntity(): EntityAccessor\nfunction useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor\nfunction useEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): EntityAccessor | undefined\nfunction useEntity(...entity: [] | [string | SugaredRelativeSingleEntity | undefined]): EntityAccessor | undefined {\n\tuseConstantValueInvariant(entity.length, 'useEntity: cannot alternate between providing and omitting the argument.')\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\n\tif (entity.length === 0) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst getEntityAccessor = useCallback(() => getEntityByKey(entityKey), [entityKey, getEntityByKey])\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useAccessorUpdateSubscription(getEntityAccessor)\n\t}\n\tconst sugaredRelativeSingleEntity = entity[0]\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst relativeSingleEntity = useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity)\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst getEntity = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getRelativeSingleEntity(relativeSingleEntity!)\n\t}, [entityKey, getEntityByKey, relativeSingleEntity])\n\n\tif (relativeSingleEntity) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleEntity.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entity, forceUpdate] = useAccessorUpdateSubscription(getEntity, true)\n\n\t\tif (relativeSingleEntity.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeSingleEntity.hasOneRelationPath[0].field, forceUpdate)\n\t\t}\n\n\t\treturn entity\n\t}\n\treturn undefined\n}\n\nexport { useEntity }\n"],"names":[],"mappings":";;;;;;;AAcA,sBAAsB,QAA6F;
|
|
1
|
+
{"version":3,"file":"useEntity.js","sources":["../../../src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeSingleEntity } from '../treeParameters'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity'\n\nfunction useEntity(): EntityAccessor\nfunction useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor\nfunction useEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): EntityAccessor | undefined\nfunction useEntity(...entity: [] | [string | SugaredRelativeSingleEntity | undefined]): EntityAccessor | undefined {\n\tuseConstantValueInvariant(entity.length, 'useEntity: cannot alternate between providing and omitting the argument.')\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\n\tif (entity.length === 0) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst getEntityAccessor = useCallback(() => getEntityByKey(entityKey), [entityKey, getEntityByKey])\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useAccessorUpdateSubscription(getEntityAccessor)\n\t}\n\tconst sugaredRelativeSingleEntity = entity[0]\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst relativeSingleEntity = useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity)\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst getEntity = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getRelativeSingleEntity(relativeSingleEntity!)\n\t}, [entityKey, getEntityByKey, relativeSingleEntity])\n\n\tif (relativeSingleEntity) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleEntity.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entity, forceUpdate] = useAccessorUpdateSubscription(getEntity, true)\n\n\t\tif (relativeSingleEntity.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeSingleEntity.hasOneRelationPath[0].field, forceUpdate)\n\t\t}\n\n\t\treturn entity\n\t}\n\treturn undefined\n}\n\nexport { useEntity }\n"],"names":[],"mappings":";;;;;;;AAcA,sBAAsB,QAA6F;AACxF,4BAAA,OAAO,QAAQ,0EAA0E;AAEnH,QAAM,YAAY;AAClB,QAAM,iBAAiB;AAEnB,MAAA,OAAO,WAAW,GAAG;AAElB,UAAA,oBAAoB,YAAY,MAAM,eAAe,SAAS,GAAG,CAAC,WAAW,cAAc,CAAC;AAElG,WAAO,8BAA8B,iBAAiB;AAAA,EACvD;AACA,QAAM,8BAA8B,OAAO;AAGrC,QAAA,uBAAuB,iCAAiC,2BAA2B;AAEnF,QAAA,YAAY,YAAY,MAAM;AAC7B,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,wBAAwB,oBAAqB;AAAA,EACzD,GAAA,CAAC,WAAW,gBAAgB,oBAAoB,CAAC;AAEpD,MAAI,sBAAsB;AAGxB,+BAAA,qBAAqB,oBACrB,sDACD;AAEA,UAAM,CAAC,SAAQ,eAAe,8BAA8B,WAAW,IAAI;AAEvE,QAAA,qBAAqB,mBAAmB,QAAQ;AAEnD,4BAAsB,qBAAqB,mBAAmB,GAAG,OAAO,WAAW;AAAA,IACpF;AAEO,WAAA;AAAA,EACR;AACO,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityKey.js","sources":["../../../src/accessorPropagation/useEntityKey.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { BindingError } from '../BindingError'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useEntityKey = (): string => {\n\tconst entityKey = useContext(EntityKeyContext)\n\n\tif (entityKey === undefined) {\n\t\tthrow new BindingError(\n\t\t\t`Trying to use a data bound component outside a correct parent. You likely forgot to use <DataBindingProvider /> ` +\n\t\t\t\t`or a SubTree.`,\n\t\t)\n\t}\n\treturn entityKey\n}\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"useEntityKey.js","sources":["../../../src/accessorPropagation/useEntityKey.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { BindingError } from '../BindingError'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useEntityKey = (): string => {\n\tconst entityKey = useContext(EntityKeyContext)\n\n\tif (entityKey === undefined) {\n\t\tthrow new BindingError(\n\t\t\t`Trying to use a data bound component outside a correct parent. You likely forgot to use <DataBindingProvider /> ` +\n\t\t\t\t`or a SubTree.`,\n\t\t)\n\t}\n\treturn entityKey\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,eAAe,MAAc;AACnC,QAAA,YAAY,WAAW,gBAAgB;AAE7C,MAAI,cAAc,QAAW;AACtB,UAAA,IAAI,aACT,+HAED;AAAA,EACD;AACO,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityList.js","sources":["../../../src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { EntityListAccessor } from '../accessors'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '../treeParameters'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getRelativeEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entityList, forceUpdate] = useAccessorUpdateSubscription(getEntityList, true)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, forceUpdate)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":[],"mappings":";;;;;;;AAaA,uBACC,2BACiC;
|
|
1
|
+
{"version":3,"file":"useEntityList.js","sources":["../../../src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { EntityListAccessor } from '../accessors'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '../treeParameters'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getRelativeEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entityList, forceUpdate] = useAccessorUpdateSubscription(getEntityList, true)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, forceUpdate)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":[],"mappings":";;;;;;;AAaA,uBACC,2BACiC;AAC3B,QAAA,qBAAqB,+BAA+B,yBAAyB;AAElF,4BAAA,CAAC,CAAC,oBACF,8EACD;AAEA,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACjB,QAAA,gBAAgB,YAAY,MAAM;AACjC,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,sBAAsB,kBAAmB;AAAA,EACrD,GAAA,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AAGtB,+BAAA,mBAAmB,oBACnB,sDACD;AAEA,UAAM,CAAC,YAAY,eAAe,8BAA8B,eAAe,IAAI;AAE/E,QAAA,mBAAmB,mBAAmB,QAAQ;AAEjD,4BAAsB,mBAAmB,mBAAmB,GAAG,OAAO,WAAW;AAAA,IAClF;AAEO,WAAA;AAAA,EACR;AACO,SAAA;AACR;;"}
|