@contember/react-binding 2.0.0-alpha.15 → 2.0.0-alpha.17
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/index.cjs +2 -9
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +1 -8
- package/dist/development/index.js.map +1 -1
- package/dist/development/src/accessorPropagation/AccessorProvider.cjs +1 -1
- package/dist/development/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/AccessorProvider.js +1 -1
- package/dist/development/src/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/development/src/accessorPropagation/BindingOperationsContext.cjs +2 -1
- package/dist/development/src/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/BindingOperationsContext.js +2 -1
- package/dist/development/src/accessorPropagation/BindingOperationsContext.js.map +1 -1
- package/dist/development/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/EntityKeyContext.js.map +1 -1
- package/dist/development/src/accessorPropagation/EntityKeyProvider.cjs +1 -1
- package/dist/development/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/EntityKeyProvider.js +1 -1
- package/dist/development/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.cjs +14 -37
- package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.js +15 -38
- package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntity.cjs +4 -4
- package/dist/development/src/accessorPropagation/useEntity.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntity.js +4 -4
- package/dist/development/src/accessorPropagation/useEntity.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityKey.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityKey.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityList.cjs +3 -3
- package/dist/development/src/accessorPropagation/useEntityList.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityList.js +3 -3
- package/dist/development/src/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTree.cjs +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTree.js +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTree.cjs +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTree.js +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useField.cjs +3 -3
- package/dist/development/src/accessorPropagation/useField.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useField.js +3 -3
- package/dist/development/src/accessorPropagation/useField.js.map +1 -1
- package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs +2 -2
- package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
- package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js +2 -2
- package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/development/src/accessorSorting/addEntityAtIndex.cjs +1 -1
- package/dist/development/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
- package/dist/development/src/accessorSorting/addEntityAtIndex.js +1 -1
- package/dist/development/src/accessorSorting/addEntityAtIndex.js.map +1 -1
- package/dist/development/src/accessorSorting/repairEntitiesOrder.cjs +1 -1
- package/dist/development/src/accessorSorting/repairEntitiesOrder.cjs.map +1 -1
- package/dist/development/src/accessorSorting/repairEntitiesOrder.js +1 -1
- package/dist/development/src/accessorSorting/repairEntitiesOrder.js.map +1 -1
- package/dist/development/src/accessorSorting/sortEntities.cjs +2 -2
- package/dist/development/src/accessorSorting/sortEntities.cjs.map +1 -1
- package/dist/development/src/accessorSorting/sortEntities.js +2 -2
- package/dist/development/src/accessorSorting/sortEntities.js.map +1 -1
- package/dist/development/src/accessorTree/AccessorTree.cjs +16 -6
- package/dist/development/src/accessorTree/AccessorTree.cjs.map +1 -1
- package/dist/development/src/accessorTree/AccessorTree.js +16 -6
- package/dist/development/src/accessorTree/AccessorTree.js.map +1 -1
- package/dist/development/src/accessorTree/useDataBinding.cjs +23 -36
- package/dist/development/src/accessorTree/useDataBinding.cjs.map +1 -1
- package/dist/development/src/accessorTree/useDataBinding.js +26 -39
- package/dist/development/src/accessorTree/useDataBinding.js.map +1 -1
- package/dist/development/src/accessorTree/useEnvironmentWithSchema.cjs +31 -0
- package/dist/development/src/accessorTree/useEnvironmentWithSchema.cjs.map +1 -0
- package/dist/development/src/accessorTree/useEnvironmentWithSchema.js +31 -0
- package/dist/development/src/accessorTree/useEnvironmentWithSchema.js.map +1 -0
- package/dist/development/src/coreComponents/Component.cjs.map +1 -1
- package/dist/development/src/coreComponents/Component.js.map +1 -1
- package/dist/development/src/coreComponents/DataBindingProvider.cjs +4 -14
- package/dist/development/src/coreComponents/DataBindingProvider.cjs.map +1 -1
- package/dist/development/src/coreComponents/DataBindingProvider.js +4 -14
- package/dist/development/src/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/development/src/coreComponents/EntityListSubTree.cjs +5 -14
- package/dist/development/src/coreComponents/EntityListSubTree.cjs.map +1 -1
- package/dist/development/src/coreComponents/EntityListSubTree.js +5 -14
- package/dist/development/src/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/development/src/coreComponents/EntitySubTree.cjs +7 -16
- package/dist/development/src/coreComponents/EntitySubTree.cjs.map +1 -1
- package/dist/development/src/coreComponents/EntitySubTree.js +7 -16
- package/dist/development/src/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/development/src/entityEvents/useDerivedField.cjs +3 -3
- package/dist/development/src/entityEvents/useDerivedField.cjs.map +1 -1
- package/dist/development/src/entityEvents/useDerivedField.js +3 -3
- package/dist/development/src/entityEvents/useDerivedField.js.map +1 -1
- package/dist/development/src/helperComponents/DeferredSubTrees.cjs +2 -3
- package/dist/development/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
- package/dist/development/src/helperComponents/DeferredSubTrees.js +3 -4
- package/dist/development/src/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/development/src/helperComponents/FieldView.cjs +1 -1
- package/dist/development/src/helperComponents/FieldView.cjs.map +1 -1
- package/dist/development/src/helperComponents/FieldView.js +1 -1
- package/dist/development/src/helperComponents/FieldView.js.map +1 -1
- package/dist/development/src/markers/IncrementalMarkerBuilder.cjs +56 -0
- package/dist/development/src/markers/IncrementalMarkerBuilder.cjs.map +1 -0
- package/dist/development/src/markers/IncrementalMarkerBuilder.js +56 -0
- package/dist/development/src/markers/IncrementalMarkerBuilder.js.map +1 -0
- package/dist/development/src/markers/MarkerStaticAnalyzer.cjs +110 -0
- package/dist/development/src/markers/MarkerStaticAnalyzer.cjs.map +1 -0
- package/dist/development/src/markers/MarkerStaticAnalyzer.js +110 -0
- package/dist/development/src/markers/MarkerStaticAnalyzer.js.map +1 -0
- package/dist/development/src/markers/MarkerTreeGenerator.cjs +52 -0
- package/dist/development/src/markers/MarkerTreeGenerator.cjs.map +1 -0
- package/dist/development/src/markers/MarkerTreeGenerator.js +52 -0
- package/dist/development/src/markers/MarkerTreeGenerator.js.map +1 -0
- package/dist/production/index.cjs +2 -9
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +1 -8
- package/dist/production/index.js.map +1 -1
- package/dist/production/src/accessorPropagation/AccessorProvider.cjs +1 -1
- package/dist/production/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/AccessorProvider.js +1 -1
- package/dist/production/src/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/production/src/accessorPropagation/BindingOperationsContext.cjs +2 -1
- package/dist/production/src/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/BindingOperationsContext.js +2 -1
- package/dist/production/src/accessorPropagation/BindingOperationsContext.js.map +1 -1
- package/dist/production/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/EntityKeyContext.js.map +1 -1
- package/dist/production/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.cjs +14 -37
- package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.js +15 -38
- package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntity.cjs +4 -4
- package/dist/production/src/accessorPropagation/useEntity.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntity.js +4 -4
- package/dist/production/src/accessorPropagation/useEntity.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityKey.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityKey.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityList.cjs +3 -3
- package/dist/production/src/accessorPropagation/useEntityList.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityList.js +3 -3
- package/dist/production/src/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTree.cjs +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTree.js +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTree.cjs +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTree.js +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useField.cjs +3 -3
- package/dist/production/src/accessorPropagation/useField.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useField.js +3 -3
- package/dist/production/src/accessorPropagation/useField.js.map +1 -1
- package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs +2 -2
- package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
- package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js +2 -2
- package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/production/src/accessorSorting/addEntityAtIndex.cjs +1 -1
- package/dist/production/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
- package/dist/production/src/accessorSorting/addEntityAtIndex.js +1 -1
- package/dist/production/src/accessorSorting/addEntityAtIndex.js.map +1 -1
- package/dist/production/src/accessorSorting/repairEntitiesOrder.cjs +1 -1
- package/dist/production/src/accessorSorting/repairEntitiesOrder.cjs.map +1 -1
- package/dist/production/src/accessorSorting/repairEntitiesOrder.js +1 -1
- package/dist/production/src/accessorSorting/repairEntitiesOrder.js.map +1 -1
- package/dist/production/src/accessorSorting/sortEntities.cjs +2 -2
- package/dist/production/src/accessorSorting/sortEntities.cjs.map +1 -1
- package/dist/production/src/accessorSorting/sortEntities.js +2 -2
- package/dist/production/src/accessorSorting/sortEntities.js.map +1 -1
- package/dist/production/src/accessorTree/AccessorTree.cjs +3 -1
- package/dist/production/src/accessorTree/AccessorTree.cjs.map +1 -1
- package/dist/production/src/accessorTree/AccessorTree.js +3 -1
- package/dist/production/src/accessorTree/AccessorTree.js.map +1 -1
- package/dist/production/src/accessorTree/useDataBinding.cjs +23 -36
- package/dist/production/src/accessorTree/useDataBinding.cjs.map +1 -1
- package/dist/production/src/accessorTree/useDataBinding.js +26 -39
- package/dist/production/src/accessorTree/useDataBinding.js.map +1 -1
- package/dist/production/src/accessorTree/useEnvironmentWithSchema.cjs +31 -0
- package/dist/production/src/accessorTree/useEnvironmentWithSchema.cjs.map +1 -0
- package/dist/production/src/accessorTree/useEnvironmentWithSchema.js +31 -0
- package/dist/production/src/accessorTree/useEnvironmentWithSchema.js.map +1 -0
- package/dist/production/src/coreComponents/Component.cjs.map +1 -1
- package/dist/production/src/coreComponents/Component.js.map +1 -1
- package/dist/production/src/coreComponents/DataBindingProvider.cjs +3 -5
- package/dist/production/src/coreComponents/DataBindingProvider.cjs.map +1 -1
- package/dist/production/src/coreComponents/DataBindingProvider.js +3 -5
- package/dist/production/src/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/production/src/coreComponents/EntityListSubTree.cjs +2 -11
- package/dist/production/src/coreComponents/EntityListSubTree.cjs.map +1 -1
- package/dist/production/src/coreComponents/EntityListSubTree.js +2 -11
- package/dist/production/src/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/production/src/coreComponents/EntitySubTree.cjs +2 -11
- package/dist/production/src/coreComponents/EntitySubTree.cjs.map +1 -1
- package/dist/production/src/coreComponents/EntitySubTree.js +2 -11
- package/dist/production/src/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/production/src/entityEvents/useDerivedField.cjs +3 -3
- package/dist/production/src/entityEvents/useDerivedField.cjs.map +1 -1
- package/dist/production/src/entityEvents/useDerivedField.js +3 -3
- package/dist/production/src/entityEvents/useDerivedField.js.map +1 -1
- package/dist/production/src/helperComponents/DeferredSubTrees.cjs +2 -3
- package/dist/production/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
- package/dist/production/src/helperComponents/DeferredSubTrees.js +3 -4
- package/dist/production/src/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/production/src/helperComponents/FieldView.cjs +1 -1
- package/dist/production/src/helperComponents/FieldView.cjs.map +1 -1
- package/dist/production/src/helperComponents/FieldView.js +1 -1
- package/dist/production/src/helperComponents/FieldView.js.map +1 -1
- package/dist/production/src/markers/IncrementalMarkerBuilder.cjs +56 -0
- package/dist/production/src/markers/IncrementalMarkerBuilder.cjs.map +1 -0
- package/dist/production/src/markers/IncrementalMarkerBuilder.js +56 -0
- package/dist/production/src/markers/IncrementalMarkerBuilder.js.map +1 -0
- package/dist/production/src/markers/MarkerStaticAnalyzer.cjs +110 -0
- package/dist/production/src/markers/MarkerStaticAnalyzer.cjs.map +1 -0
- package/dist/production/src/markers/MarkerStaticAnalyzer.js +110 -0
- package/dist/production/src/markers/MarkerStaticAnalyzer.js.map +1 -0
- package/dist/production/src/markers/MarkerTreeGenerator.cjs +52 -0
- package/dist/production/src/markers/MarkerTreeGenerator.cjs.map +1 -0
- package/dist/production/src/markers/MarkerTreeGenerator.js +52 -0
- package/dist/production/src/markers/MarkerTreeGenerator.js.map +1 -0
- package/dist/types/accessorPropagation/BindingOperationsContext.d.ts +1 -1
- package/dist/types/accessorPropagation/BindingOperationsContext.d.ts.map +1 -1
- package/dist/types/accessorPropagation/EntityKeyContext.d.ts +2 -1
- package/dist/types/accessorPropagation/EntityKeyContext.d.ts.map +1 -1
- package/dist/types/accessorPropagation/EntityKeyProvider.d.ts +2 -1
- package/dist/types/accessorPropagation/EntityKeyProvider.d.ts.map +1 -1
- package/dist/types/accessorPropagation/EnvironmentContext.d.ts +2 -2
- package/dist/types/accessorPropagation/EnvironmentContext.d.ts.map +1 -1
- package/dist/types/accessorPropagation/TreeRootIdContext.d.ts +1 -1
- package/dist/types/accessorPropagation/TreeRootIdContext.d.ts.map +1 -1
- package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts +7 -12
- package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts.map +1 -1
- package/dist/types/accessorPropagation/useEntityKey.d.ts +2 -1
- package/dist/types/accessorPropagation/useEntityKey.d.ts.map +1 -1
- package/dist/types/accessorPropagation/useEntitySubTree.d.ts +1 -2
- package/dist/types/accessorPropagation/useEntitySubTree.d.ts.map +1 -1
- package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts +1 -1
- package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts.map +1 -1
- package/dist/types/accessorSorting/index.d.ts +0 -2
- package/dist/types/accessorSorting/index.d.ts.map +1 -1
- package/dist/types/accessorTree/AccessorTree.d.ts.map +1 -1
- package/dist/types/accessorTree/AccessorTreeState.d.ts +1 -4
- package/dist/types/accessorTree/AccessorTreeState.d.ts.map +1 -1
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +1 -1
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +1 -1
- package/dist/types/accessorTree/AccessorTreeStateOptions.d.ts +0 -2
- package/dist/types/accessorTree/AccessorTreeStateOptions.d.ts.map +1 -1
- package/dist/types/accessorTree/DirtinessContext.d.ts +1 -1
- package/dist/types/accessorTree/DirtinessContext.d.ts.map +1 -1
- package/dist/types/accessorTree/MutationStateContext.d.ts +1 -1
- package/dist/types/accessorTree/MutationStateContext.d.ts.map +1 -1
- package/dist/types/accessorTree/index.d.ts +0 -1
- package/dist/types/accessorTree/index.d.ts.map +1 -1
- package/dist/types/accessorTree/useDataBinding.d.ts +6 -2
- package/dist/types/accessorTree/useDataBinding.d.ts.map +1 -1
- package/dist/types/accessorTree/useEnvironmentWithSchema.d.ts +3 -0
- package/dist/types/accessorTree/useEnvironmentWithSchema.d.ts.map +1 -0
- package/dist/types/coreComponents/Component.d.ts +1 -1
- package/dist/types/coreComponents/Component.d.ts.map +1 -1
- package/dist/types/coreComponents/DataBindingProvider.d.ts +8 -8
- package/dist/types/coreComponents/DataBindingProvider.d.ts.map +1 -1
- package/dist/types/coreComponents/Entity.d.ts +1 -1
- package/dist/types/coreComponents/Entity.d.ts.map +1 -1
- package/dist/types/coreComponents/EntityListSubTree.d.ts +1 -1
- package/dist/types/coreComponents/EntityListSubTree.d.ts.map +1 -1
- package/dist/types/coreComponents/EntitySubTree.d.ts +1 -1
- package/dist/types/coreComponents/EntitySubTree.d.ts.map +1 -1
- package/dist/types/coreComponents/ParentEntity.d.ts +1 -1
- package/dist/types/coreComponents/ParentEntity.d.ts.map +1 -1
- package/dist/types/coreComponents/index.d.ts +0 -1
- package/dist/types/coreComponents/index.d.ts.map +1 -1
- package/dist/types/helperComponents/DeferredSubTrees.d.ts +1 -1
- package/dist/types/helperComponents/DeferredSubTrees.d.ts.map +1 -1
- package/dist/types/helperComponents/If.d.ts +1 -1
- package/dist/types/helperComponents/If.d.ts.map +1 -1
- package/dist/types/helperComponents/LabelMiddleware.d.ts +1 -1
- package/dist/types/helperComponents/LabelMiddleware.d.ts.map +1 -1
- package/dist/types/helperComponents/StaticRender.d.ts +1 -1
- package/dist/types/helperComponents/StaticRender.d.ts.map +1 -1
- package/dist/types/helperComponents/Variable.d.ts +1 -1
- package/dist/types/helperComponents/Variable.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/markers/IncrementalMarkerBuilder.d.ts +5 -0
- package/dist/types/markers/IncrementalMarkerBuilder.d.ts.map +1 -0
- package/dist/types/{coreComponents → markers}/MarkerProvider.d.ts +1 -2
- package/dist/types/markers/MarkerProvider.d.ts.map +1 -0
- package/dist/types/markers/MarkerStaticAnalyzer.d.ts +14 -0
- package/dist/types/markers/MarkerStaticAnalyzer.d.ts.map +1 -0
- package/dist/types/markers/MarkerTreeGenerator.d.ts +10 -0
- package/dist/types/markers/MarkerTreeGenerator.d.ts.map +1 -0
- package/dist/types/markers/index.d.ts +3 -0
- package/dist/types/markers/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/src/accessorPropagation/AccessorProvider.tsx +1 -1
- package/src/accessorPropagation/BindingOperationsContext.ts +1 -0
- package/src/accessorPropagation/EntityKeyContext.ts +2 -1
- package/src/accessorPropagation/EntityKeyProvider.tsx +2 -1
- package/src/accessorPropagation/useAccessorUpdateSubscription.ts +19 -87
- package/src/accessorPropagation/useEntity.ts +4 -4
- package/src/accessorPropagation/useEntityKey.ts +2 -2
- package/src/accessorPropagation/useEntityList.ts +3 -3
- package/src/accessorPropagation/useEntityListSubTree.ts +1 -1
- package/src/accessorPropagation/useEntitySubTree.ts +3 -4
- package/src/accessorPropagation/useField.ts +3 -3
- package/src/accessorSorting/SetOrderFieldOnCreate.tsx +2 -2
- package/src/accessorSorting/addEntityAtIndex.ts +1 -1
- package/src/accessorSorting/index.ts +0 -2
- package/src/accessorSorting/repairEntitiesOrder.ts +1 -1
- package/src/accessorSorting/sortEntities.ts +2 -2
- package/src/accessorTree/AccessorTree.tsx +17 -12
- package/src/accessorTree/AccessorTreeState.ts +1 -4
- package/src/accessorTree/AccessorTreeStateOptions.ts +0 -2
- package/src/accessorTree/index.ts +0 -1
- package/src/accessorTree/useDataBinding.ts +35 -44
- package/src/accessorTree/useEnvironmentWithSchema.ts +31 -0
- package/src/coreComponents/Component.tsx +2 -2
- package/src/coreComponents/DataBindingProvider.tsx +22 -35
- package/src/coreComponents/EntityListSubTree.tsx +4 -18
- package/src/coreComponents/EntitySubTree.tsx +5 -20
- package/src/coreComponents/index.ts +0 -1
- package/src/entityEvents/useDerivedField.ts +3 -3
- package/src/helperComponents/DeferredSubTrees.tsx +1 -5
- package/src/helperComponents/FieldView.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/markers/IncrementalMarkerBuilder.ts +60 -0
- package/src/{coreComponents → markers}/MarkerProvider.ts +2 -2
- package/src/markers/MarkerStaticAnalyzer.ts +132 -0
- package/src/markers/MarkerTreeGenerator.ts +72 -0
- package/src/markers/index.ts +2 -0
- package/src/tsconfig.json +2 -1
- package/src/typings/react-fix.d.ts +12 -0
- package/tests/cases/unit/model/markerTreeGenerator.spec.tsx +44 -9
- package/tests/lib/bindingFactory.ts +1 -1
- package/dist/development/src/MarkerTreeGenerator.cjs +0 -89
- package/dist/development/src/MarkerTreeGenerator.cjs.map +0 -1
- package/dist/development/src/MarkerTreeGenerator.js +0 -89
- package/dist/development/src/MarkerTreeGenerator.js.map +0 -1
- package/dist/development/src/accessorSorting/errors.cjs +0 -10
- package/dist/development/src/accessorSorting/errors.cjs.map +0 -1
- package/dist/development/src/accessorSorting/errors.js +0 -10
- package/dist/development/src/accessorSorting/errors.js.map +0 -1
- package/dist/development/src/accessorSorting/moveEntity.cjs +0 -42
- package/dist/development/src/accessorSorting/moveEntity.cjs.map +0 -1
- package/dist/development/src/accessorSorting/moveEntity.js +0 -42
- package/dist/development/src/accessorSorting/moveEntity.js.map +0 -1
- package/dist/development/src/accessorSorting/useSortedEntities.cjs +0 -80
- package/dist/development/src/accessorSorting/useSortedEntities.cjs.map +0 -1
- package/dist/development/src/accessorSorting/useSortedEntities.js +0 -80
- package/dist/development/src/accessorSorting/useSortedEntities.js.map +0 -1
- package/dist/development/src/accessorTree/accessorTreeStateReducer.cjs +0 -34
- package/dist/development/src/accessorTree/accessorTreeStateReducer.cjs.map +0 -1
- package/dist/development/src/accessorTree/accessorTreeStateReducer.js +0 -34
- package/dist/development/src/accessorTree/accessorTreeStateReducer.js.map +0 -1
- package/dist/development/src/core/IncrementalMarkerBuilder.cjs +0 -63
- package/dist/development/src/core/IncrementalMarkerBuilder.cjs.map +0 -1
- package/dist/development/src/core/IncrementalMarkerBuilder.js +0 -63
- package/dist/development/src/core/IncrementalMarkerBuilder.js.map +0 -1
- package/dist/production/src/MarkerTreeGenerator.cjs +0 -89
- package/dist/production/src/MarkerTreeGenerator.cjs.map +0 -1
- package/dist/production/src/MarkerTreeGenerator.js +0 -89
- package/dist/production/src/MarkerTreeGenerator.js.map +0 -1
- package/dist/production/src/accessorSorting/errors.cjs +0 -10
- package/dist/production/src/accessorSorting/errors.cjs.map +0 -1
- package/dist/production/src/accessorSorting/errors.js +0 -10
- package/dist/production/src/accessorSorting/errors.js.map +0 -1
- package/dist/production/src/accessorSorting/moveEntity.cjs +0 -42
- package/dist/production/src/accessorSorting/moveEntity.cjs.map +0 -1
- package/dist/production/src/accessorSorting/moveEntity.js +0 -42
- package/dist/production/src/accessorSorting/moveEntity.js.map +0 -1
- package/dist/production/src/accessorSorting/useSortedEntities.cjs +0 -80
- package/dist/production/src/accessorSorting/useSortedEntities.cjs.map +0 -1
- package/dist/production/src/accessorSorting/useSortedEntities.js +0 -80
- package/dist/production/src/accessorSorting/useSortedEntities.js.map +0 -1
- package/dist/production/src/accessorTree/accessorTreeStateReducer.cjs +0 -34
- package/dist/production/src/accessorTree/accessorTreeStateReducer.cjs.map +0 -1
- package/dist/production/src/accessorTree/accessorTreeStateReducer.js +0 -34
- package/dist/production/src/accessorTree/accessorTreeStateReducer.js.map +0 -1
- package/dist/production/src/core/IncrementalMarkerBuilder.cjs +0 -63
- package/dist/production/src/core/IncrementalMarkerBuilder.cjs.map +0 -1
- package/dist/production/src/core/IncrementalMarkerBuilder.js +0 -63
- package/dist/production/src/core/IncrementalMarkerBuilder.js.map +0 -1
- package/dist/types/MarkerTreeGenerator.d.ts +0 -14
- package/dist/types/MarkerTreeGenerator.d.ts.map +0 -1
- package/dist/types/accessorSorting/errors.d.ts +0 -3
- package/dist/types/accessorSorting/errors.d.ts.map +0 -1
- package/dist/types/accessorSorting/moveEntity.d.ts +0 -4
- package/dist/types/accessorSorting/moveEntity.d.ts.map +0 -1
- package/dist/types/accessorSorting/useSortedEntities.d.ts +0 -5
- package/dist/types/accessorSorting/useSortedEntities.d.ts.map +0 -1
- package/dist/types/accessorTree/accessorTreeStateReducer.d.ts +0 -4
- package/dist/types/accessorTree/accessorTreeStateReducer.d.ts.map +0 -1
- package/dist/types/core/IncrementalMarkerBuilder.d.ts +0 -7
- package/dist/types/core/IncrementalMarkerBuilder.d.ts.map +0 -1
- package/dist/types/coreComponents/MarkerProvider.d.ts.map +0 -1
- package/src/MarkerTreeGenerator.ts +0 -121
- package/src/accessorSorting/errors.ts +0 -9
- package/src/accessorSorting/moveEntity.ts +0 -65
- package/src/accessorSorting/useSortedEntities.ts +0 -102
- package/src/accessorTree/accessorTreeStateReducer.ts +0 -36
- package/src/core/IncrementalMarkerBuilder.ts +0 -64
|
@@ -15,16 +15,16 @@ function useEntityList(sugaredRelativeEntityList) {
|
|
|
15
15
|
const getEntityByKey = useGetEntityByKey();
|
|
16
16
|
const getEntityList = useCallback(() => {
|
|
17
17
|
const parent = getEntityByKey(entityKey);
|
|
18
|
-
return parent.
|
|
18
|
+
return parent.getEntityList(relativeEntityList);
|
|
19
19
|
}, [entityKey, getEntityByKey, relativeEntityList]);
|
|
20
20
|
if (relativeEntityList) {
|
|
21
21
|
useConstantLengthInvariant(
|
|
22
22
|
relativeEntityList.hasOneRelationPath,
|
|
23
23
|
"Cannot change the length of the hasOneRelation path!"
|
|
24
24
|
);
|
|
25
|
-
const [entityList,
|
|
25
|
+
const [entityList, { update }] = useAccessorUpdateSubscription(getEntityList);
|
|
26
26
|
if (relativeEntityList.hasOneRelationPath.length) {
|
|
27
|
-
useOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field,
|
|
27
|
+
useOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update);
|
|
28
28
|
}
|
|
29
29
|
return entityList;
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.
|
|
1
|
+
{"version":3,"file":"useEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\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, { update }] = useAccessorUpdateSubscription(getEntityList)\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, update)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":[],"mappings":";;;;;;;AAaA,SAAS,cACR,2BACiC;AAC3B,QAAA,qBAAqB,+BAA+B,yBAAyB;AACnF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACjB,QAAA,gBAAgB,YAAY,MAAM;AACjC,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,cAAc,kBAAmB;AAAA,EAC7C,GAAA,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AAEvB;AAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IAAA;AAGD,UAAM,CAAC,YAAY,EAAE,OAAQ,CAAA,IAAI,8BAA8B,aAAa;AAExE,QAAA,mBAAmB,mBAAmB,QAAQ;AAEjD,4BAAsB,mBAAmB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC7E;AAEO,WAAA;AAAA,EACR;AACO,SAAA;AACR;"}
|
|
@@ -13,7 +13,7 @@ const useEntityListSubTree = (qualifiedEntityList, ...treeId) => {
|
|
|
13
13
|
() => getSubTree(parameters, ...hasTreeId ? [treeIdVal] : []),
|
|
14
14
|
[getSubTree, hasTreeId, parameters, treeIdVal]
|
|
15
15
|
);
|
|
16
|
-
return useAccessorUpdateSubscription.useAccessorUpdateSubscription(getAccessor);
|
|
16
|
+
return useAccessorUpdateSubscription.useAccessorUpdateSubscription(getAccessor)[0];
|
|
17
17
|
};
|
|
18
18
|
exports.useEntityListSubTree = useEntityListSubTree;
|
|
19
19
|
//# sourceMappingURL=useEntityListSubTree.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)\n}\n"],"names":["useGetEntityListSubTree","useEntityListSubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAaA,wBAAAA;AACb,QAAA,aAAaC,8DAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAA;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;
|
|
1
|
+
{"version":3,"file":"useEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntityListSubTree","useEntityListSubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAaA,wBAAAA;AACb,QAAA,aAAaC,8DAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAA;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAOvC,SAAAC,4DAA8B,WAAW,EAAE,CAAC;AACpD;;"}
|
|
@@ -11,7 +11,7 @@ const useEntityListSubTree = (qualifiedEntityList, ...treeId) => {
|
|
|
11
11
|
() => getSubTree(parameters, ...hasTreeId ? [treeIdVal] : []),
|
|
12
12
|
[getSubTree, hasTreeId, parameters, treeIdVal]
|
|
13
13
|
);
|
|
14
|
-
return useAccessorUpdateSubscription(getAccessor);
|
|
14
|
+
return useAccessorUpdateSubscription(getAccessor)[0];
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
17
|
useEntityListSubTree
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAa;AACb,QAAA,aAAa,+BAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;
|
|
1
|
+
{"version":3,"file":"useEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAa;AACb,QAAA,aAAa,+BAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAOvC,SAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
|
|
@@ -13,7 +13,7 @@ const useEntitySubTree = (qualifiedSingleEntity, ...treeId) => {
|
|
|
13
13
|
() => getSubTree(parameters, ...hasTreeId ? [treeIdVal] : []),
|
|
14
14
|
[getSubTree, hasTreeId, parameters, treeIdVal]
|
|
15
15
|
);
|
|
16
|
-
return useAccessorUpdateSubscription.useAccessorUpdateSubscription(getAccessor);
|
|
16
|
+
return useAccessorUpdateSubscription.useAccessorUpdateSubscription(getAccessor)[0];
|
|
17
17
|
};
|
|
18
18
|
exports.useEntitySubTree = useEntitySubTree;
|
|
19
19
|
//# sourceMappingURL=useEntitySubTree.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntitySubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport
|
|
1
|
+
{"version":3,"file":"useEntitySubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { Alias, EntityAccessor, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\nimport { TreeRootId } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\n\nexport const useEntitySubTree = (\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityAccessor => {\n\tconst getSubTree = useGetEntitySubTree()\n\tconst parameters = useEntitySubTreeParameters(qualifiedSingleEntity)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntitySubTree: cannot use hasOneRelationPath!`)\n\t// }\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntitySubTree","useEntitySubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAOa,MAAA,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAaA,oBAAAA;AACb,QAAA,aAAaC,sDAA2B,qBAAqB;AAC7D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAA;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAMvC,SAAAC,4DAA8B,WAAW,EAAE,CAAC;AACpD;;"}
|
|
@@ -11,7 +11,7 @@ const useEntitySubTree = (qualifiedSingleEntity, ...treeId) => {
|
|
|
11
11
|
() => getSubTree(parameters, ...hasTreeId ? [treeIdVal] : []),
|
|
12
12
|
[getSubTree, hasTreeId, parameters, treeIdVal]
|
|
13
13
|
);
|
|
14
|
-
return useAccessorUpdateSubscription(getAccessor);
|
|
14
|
+
return useAccessorUpdateSubscription(getAccessor)[0];
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
17
|
useEntitySubTree
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntitySubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport
|
|
1
|
+
{"version":3,"file":"useEntitySubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { Alias, EntityAccessor, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\nimport { TreeRootId } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\n\nexport const useEntitySubTree = (\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityAccessor => {\n\tconst getSubTree = useGetEntitySubTree()\n\tconst parameters = useEntitySubTreeParameters(qualifiedSingleEntity)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntitySubTree: cannot use hasOneRelationPath!`)\n\t// }\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAOa,MAAA,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAa;AACb,QAAA,aAAa,2BAA2B,qBAAqB;AAC7D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAMvC,SAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
|
|
@@ -17,16 +17,16 @@ function useField(sugaredRelativeSingleField) {
|
|
|
17
17
|
const getEntityByKey = useGetEntityByKey.useGetEntityByKey();
|
|
18
18
|
const getField = React.useCallback(() => {
|
|
19
19
|
const parent = getEntityByKey(entityKey);
|
|
20
|
-
return parent.
|
|
20
|
+
return parent.getField(relativeSingleField);
|
|
21
21
|
}, [entityKey, getEntityByKey, relativeSingleField]);
|
|
22
22
|
if (relativeSingleField) {
|
|
23
23
|
reactUtils.useConstantLengthInvariant(
|
|
24
24
|
relativeSingleField.hasOneRelationPath,
|
|
25
25
|
"Cannot change the length of the hasOneRelation path!"
|
|
26
26
|
);
|
|
27
|
-
const [field,
|
|
27
|
+
const [field, { update }] = useAccessorUpdateSubscription.useAccessorUpdateSubscription(getField);
|
|
28
28
|
if (relativeSingleField.hasOneRelationPath.length) {
|
|
29
|
-
useOnConnectionUpdate.useOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field,
|
|
29
|
+
useOnConnectionUpdate.useOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field, update);
|
|
30
30
|
}
|
|
31
31
|
return field;
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useField.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useField.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { FieldAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { FieldValue, SugaredRelativeSingleField } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField'\n\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): FieldAccessor<Value>\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined {\n\tconst relativeSingleField = useDesugaredRelativeSingleField(sugaredRelativeSingleField)\n\tuseConstantValueInvariant(\n\t\t!!relativeSingleField,\n\t\t'useField: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getField = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.
|
|
1
|
+
{"version":3,"file":"useField.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useField.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { FieldAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { FieldValue, SugaredRelativeSingleField } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField'\n\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): FieldAccessor<Value>\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined {\n\tconst relativeSingleField = useDesugaredRelativeSingleField(sugaredRelativeSingleField)\n\tuseConstantValueInvariant(\n\t\t!!relativeSingleField,\n\t\t'useField: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getField = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getField<Value>(relativeSingleField!)\n\t}, [entityKey, getEntityByKey, relativeSingleField])\n\n\tif (relativeSingleField) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleField.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 [field, { update }] = useAccessorUpdateSubscription(getField)\n\n\t\tif (relativeSingleField.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn field\n\t}\n\treturn undefined\n}\n\nexport { useField }\n"],"names":["useDesugaredRelativeSingleField","useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useConstantLengthInvariant","useAccessorUpdateSubscription","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAeA,SAAS,SACR,4BACmC;AAC7B,QAAA,sBAAsBA,gEAAgC,0BAA0B;AACtFC,aAAA;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAYC,aAAAA;AAClB,QAAM,iBAAiBC,kBAAAA;AACjB,QAAA,WAAWC,MAAAA,YAAY,MAAM;AAC5B,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,SAAgB,mBAAoB;AAAA,EAChD,GAAA,CAAC,WAAW,gBAAgB,mBAAmB,CAAC;AAEnD,MAAI,qBAAqB;AAExBC,eAAA;AAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,IAAA;AAGD,UAAM,CAAC,OAAO,EAAE,OAAQ,CAAA,IAAIC,8BAAAA,8BAA8B,QAAQ;AAE9D,QAAA,oBAAoB,mBAAmB,QAAQ;AAElDC,4BAAA,sBAAsB,oBAAoB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC9E;AAEO,WAAA;AAAA,EACR;AACO,SAAA;AACR;;"}
|
|
@@ -15,16 +15,16 @@ function useField(sugaredRelativeSingleField) {
|
|
|
15
15
|
const getEntityByKey = useGetEntityByKey();
|
|
16
16
|
const getField = useCallback(() => {
|
|
17
17
|
const parent = getEntityByKey(entityKey);
|
|
18
|
-
return parent.
|
|
18
|
+
return parent.getField(relativeSingleField);
|
|
19
19
|
}, [entityKey, getEntityByKey, relativeSingleField]);
|
|
20
20
|
if (relativeSingleField) {
|
|
21
21
|
useConstantLengthInvariant(
|
|
22
22
|
relativeSingleField.hasOneRelationPath,
|
|
23
23
|
"Cannot change the length of the hasOneRelation path!"
|
|
24
24
|
);
|
|
25
|
-
const [field,
|
|
25
|
+
const [field, { update }] = useAccessorUpdateSubscription(getField);
|
|
26
26
|
if (relativeSingleField.hasOneRelationPath.length) {
|
|
27
|
-
useOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field,
|
|
27
|
+
useOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field, update);
|
|
28
28
|
}
|
|
29
29
|
return field;
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useField.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useField.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { FieldAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { FieldValue, SugaredRelativeSingleField } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField'\n\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): FieldAccessor<Value>\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined {\n\tconst relativeSingleField = useDesugaredRelativeSingleField(sugaredRelativeSingleField)\n\tuseConstantValueInvariant(\n\t\t!!relativeSingleField,\n\t\t'useField: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getField = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.
|
|
1
|
+
{"version":3,"file":"useField.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useField.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { FieldAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { FieldValue, SugaredRelativeSingleField } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField'\n\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): FieldAccessor<Value>\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined {\n\tconst relativeSingleField = useDesugaredRelativeSingleField(sugaredRelativeSingleField)\n\tuseConstantValueInvariant(\n\t\t!!relativeSingleField,\n\t\t'useField: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getField = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getField<Value>(relativeSingleField!)\n\t}, [entityKey, getEntityByKey, relativeSingleField])\n\n\tif (relativeSingleField) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleField.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 [field, { update }] = useAccessorUpdateSubscription(getField)\n\n\t\tif (relativeSingleField.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn field\n\t}\n\treturn undefined\n}\n\nexport { useField }\n"],"names":[],"mappings":";;;;;;;AAeA,SAAS,SACR,4BACmC;AAC7B,QAAA,sBAAsB,gCAAgC,0BAA0B;AACtF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACjB,QAAA,WAAW,YAAY,MAAM;AAC5B,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,SAAgB,mBAAoB;AAAA,EAChD,GAAA,CAAC,WAAW,gBAAgB,mBAAmB,CAAC;AAEnD,MAAI,qBAAqB;AAExB;AAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,IAAA;AAGD,UAAM,CAAC,OAAO,EAAE,OAAQ,CAAA,IAAI,8BAA8B,QAAQ;AAE9D,QAAA,oBAAoB,mBAAmB,QAAQ;AAElD,4BAAsB,oBAAoB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC9E;AAEO,WAAA;AAAA,EACR;AACO,SAAA;AACR;"}
|
|
@@ -38,8 +38,8 @@ const SetOrderFieldOnCreate = Component.Component(
|
|
|
38
38
|
onBeforePersist: (getAccessor, bindingOperations) => {
|
|
39
39
|
const listSubTree = bindingOperations.getEntityListSubTree(qel);
|
|
40
40
|
const entities = Array.from(listSubTree);
|
|
41
|
-
const newOrderFieldValue2 = !entities.length ? 0 : (entities[0].
|
|
42
|
-
getAccessor().
|
|
41
|
+
const newOrderFieldValue2 = !entities.length ? 0 : (entities[0].getField(desugaredOrderField).value ?? 0) + 1;
|
|
42
|
+
getAccessor().getField(desugaredOrderField).updateValue(newOrderFieldValue2);
|
|
43
43
|
},
|
|
44
44
|
children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(SugaredField.SugaredField, { field: orderField }, void 0, false, {
|
|
45
45
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetOrderFieldOnCreate.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx"],"sourcesContent":["import type { Input } from '@contember/client'\nimport type {\n\tSugaredOrderBy,\n\tSugaredQualifiedEntityList,\n\tSugaredRelativeSingleField,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n} from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents'\nimport { SugaredField } from '../helperComponents'\nimport { addEntityAtIndex } from './addEntityAtIndex'\n\nexport interface SetOrderFieldOnCreateOwnProps {\n\torderField: SugaredRelativeSingleField | string\n\tnewOrderFieldValue?: number\n}\n\nexport interface SetOrderFieldOnCreateProps\n\textends SetOrderFieldOnCreateOwnProps,\n\tPick<SugaredUnconstrainedQualifiedSingleEntity, 'entity'> {}\n\nexport const SetOrderFieldOnCreate = Component<SetOrderFieldOnCreateProps>(\n\t() => null,\n\t({ orderField, newOrderFieldValue, entity }, environment) => {\n\t\tconst desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment)\n\t\tconst getOrderBy = (order: 'asc' | 'desc'): SugaredOrderBy => [\n\t\t\tdesugaredOrderField.hasOneRelationPath\n\t\t\t\t.map(relation => relation.field)\n\t\t\t\t.reduceRight(\n\t\t\t\t\t(accumulator, currentValue) => ({\n\t\t\t\t\t\t[currentValue]: accumulator,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\t[desugaredOrderField.field]: order,\n\t\t\t\t\t} as Input.OrderBy<`${Input.OrderDirection}`>,\n\t\t\t\t),\n\t\t]\n\n\t\tif (newOrderFieldValue === undefined) {\n\t\t\tconst qel: SugaredQualifiedEntityList = {\n\t\t\t\tentities: entity,\n\t\t\t\texpectedMutation: 'none',\n\t\t\t\tlimit: 1,\n\t\t\t\torderBy: getOrderBy('desc'),\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={entity}\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t\tconst listSubTree = bindingOperations.getEntityListSubTree(qel)\n\t\t\t\t\t\t\tconst entities = Array.from(listSubTree)\n\t\t\t\t\t\t\tconst newOrderFieldValue = !entities.length\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: (entities[0].
|
|
1
|
+
{"version":3,"file":"SetOrderFieldOnCreate.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx"],"sourcesContent":["import type { Input } from '@contember/client'\nimport type {\n\tSugaredOrderBy,\n\tSugaredQualifiedEntityList,\n\tSugaredRelativeSingleField,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n} from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents'\nimport { SugaredField } from '../helperComponents'\nimport { addEntityAtIndex } from './addEntityAtIndex'\n\nexport interface SetOrderFieldOnCreateOwnProps {\n\torderField: SugaredRelativeSingleField | string\n\tnewOrderFieldValue?: number\n}\n\nexport interface SetOrderFieldOnCreateProps\n\textends SetOrderFieldOnCreateOwnProps,\n\tPick<SugaredUnconstrainedQualifiedSingleEntity, 'entity'> {}\n\nexport const SetOrderFieldOnCreate = Component<SetOrderFieldOnCreateProps>(\n\t() => null,\n\t({ orderField, newOrderFieldValue, entity }, environment) => {\n\t\tconst desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment)\n\t\tconst getOrderBy = (order: 'asc' | 'desc'): SugaredOrderBy => [\n\t\t\tdesugaredOrderField.hasOneRelationPath\n\t\t\t\t.map(relation => relation.field)\n\t\t\t\t.reduceRight(\n\t\t\t\t\t(accumulator, currentValue) => ({\n\t\t\t\t\t\t[currentValue]: accumulator,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\t[desugaredOrderField.field]: order,\n\t\t\t\t\t} as Input.OrderBy<`${Input.OrderDirection}`>,\n\t\t\t\t),\n\t\t]\n\n\t\tif (newOrderFieldValue === undefined) {\n\t\t\tconst qel: SugaredQualifiedEntityList = {\n\t\t\t\tentities: entity,\n\t\t\t\texpectedMutation: 'none',\n\t\t\t\tlimit: 1,\n\t\t\t\torderBy: getOrderBy('desc'),\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={entity}\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t\tconst listSubTree = bindingOperations.getEntityListSubTree(qel)\n\t\t\t\t\t\t\tconst entities = Array.from(listSubTree)\n\t\t\t\t\t\t\tconst newOrderFieldValue = !entities.length\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: (entities[0].getField<number>(desugaredOrderField).value ?? 0) + 1\n\t\t\t\t\t\t\tgetAccessor().getField<number>(desugaredOrderField).updateValue(newOrderFieldValue)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntitySubTree>\n\t\t\t\t\t<EntityListSubTree {...qel}>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntityListSubTree>\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Field field={desugaredOrderField} defaultValue={newOrderFieldValue} isNonbearing />\n\t\t\t\t<EntityListSubTree\n\t\t\t\t\tentities={entity}\n\t\t\t\t\texpectedMutation=\"anyMutation\"\n\t\t\t\t\torderBy={getOrderBy('asc')}\n\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t// We're creating a new entity which adjusts the numbering of the other ones if applicable\n\t\t\t\t\t\t// and then deleting it again which leaves a hole for newOrderFieldValue that is set above.\n\t\t\t\t\t\tlet newEntityKey: string | undefined = undefined\n\t\t\t\t\t\taddEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, getNewEntity => {\n\t\t\t\t\t\t\tnewEntityKey = getNewEntity().key\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewEntityKey && bindingOperations.getEntityByKey(newEntityKey).deleteEntity()\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t</EntityListSubTree>\n\t\t\t</>\n\t\t)\n\t},\n\t'SetOrderFieldOnCreate',\n)\n"],"names":["Component","QueryLanguage","jsxDEV","Fragment","EntitySubTree","newOrderFieldValue","SugaredField","this","EntityListSubTree","Field","addEntityAtIndex"],"mappings":"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"}
|
|
@@ -36,8 +36,8 @@ const SetOrderFieldOnCreate = Component(
|
|
|
36
36
|
onBeforePersist: (getAccessor, bindingOperations) => {
|
|
37
37
|
const listSubTree = bindingOperations.getEntityListSubTree(qel);
|
|
38
38
|
const entities = Array.from(listSubTree);
|
|
39
|
-
const newOrderFieldValue2 = !entities.length ? 0 : (entities[0].
|
|
40
|
-
getAccessor().
|
|
39
|
+
const newOrderFieldValue2 = !entities.length ? 0 : (entities[0].getField(desugaredOrderField).value ?? 0) + 1;
|
|
40
|
+
getAccessor().getField(desugaredOrderField).updateValue(newOrderFieldValue2);
|
|
41
41
|
},
|
|
42
42
|
children: /* @__PURE__ */ jsxDEV(SugaredField, { field: orderField }, void 0, false, {
|
|
43
43
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetOrderFieldOnCreate.js","sources":["../../../../../packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx"],"sourcesContent":["import type { Input } from '@contember/client'\nimport type {\n\tSugaredOrderBy,\n\tSugaredQualifiedEntityList,\n\tSugaredRelativeSingleField,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n} from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents'\nimport { SugaredField } from '../helperComponents'\nimport { addEntityAtIndex } from './addEntityAtIndex'\n\nexport interface SetOrderFieldOnCreateOwnProps {\n\torderField: SugaredRelativeSingleField | string\n\tnewOrderFieldValue?: number\n}\n\nexport interface SetOrderFieldOnCreateProps\n\textends SetOrderFieldOnCreateOwnProps,\n\tPick<SugaredUnconstrainedQualifiedSingleEntity, 'entity'> {}\n\nexport const SetOrderFieldOnCreate = Component<SetOrderFieldOnCreateProps>(\n\t() => null,\n\t({ orderField, newOrderFieldValue, entity }, environment) => {\n\t\tconst desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment)\n\t\tconst getOrderBy = (order: 'asc' | 'desc'): SugaredOrderBy => [\n\t\t\tdesugaredOrderField.hasOneRelationPath\n\t\t\t\t.map(relation => relation.field)\n\t\t\t\t.reduceRight(\n\t\t\t\t\t(accumulator, currentValue) => ({\n\t\t\t\t\t\t[currentValue]: accumulator,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\t[desugaredOrderField.field]: order,\n\t\t\t\t\t} as Input.OrderBy<`${Input.OrderDirection}`>,\n\t\t\t\t),\n\t\t]\n\n\t\tif (newOrderFieldValue === undefined) {\n\t\t\tconst qel: SugaredQualifiedEntityList = {\n\t\t\t\tentities: entity,\n\t\t\t\texpectedMutation: 'none',\n\t\t\t\tlimit: 1,\n\t\t\t\torderBy: getOrderBy('desc'),\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={entity}\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t\tconst listSubTree = bindingOperations.getEntityListSubTree(qel)\n\t\t\t\t\t\t\tconst entities = Array.from(listSubTree)\n\t\t\t\t\t\t\tconst newOrderFieldValue = !entities.length\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: (entities[0].
|
|
1
|
+
{"version":3,"file":"SetOrderFieldOnCreate.js","sources":["../../../../../packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx"],"sourcesContent":["import type { Input } from '@contember/client'\nimport type {\n\tSugaredOrderBy,\n\tSugaredQualifiedEntityList,\n\tSugaredRelativeSingleField,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n} from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents'\nimport { SugaredField } from '../helperComponents'\nimport { addEntityAtIndex } from './addEntityAtIndex'\n\nexport interface SetOrderFieldOnCreateOwnProps {\n\torderField: SugaredRelativeSingleField | string\n\tnewOrderFieldValue?: number\n}\n\nexport interface SetOrderFieldOnCreateProps\n\textends SetOrderFieldOnCreateOwnProps,\n\tPick<SugaredUnconstrainedQualifiedSingleEntity, 'entity'> {}\n\nexport const SetOrderFieldOnCreate = Component<SetOrderFieldOnCreateProps>(\n\t() => null,\n\t({ orderField, newOrderFieldValue, entity }, environment) => {\n\t\tconst desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment)\n\t\tconst getOrderBy = (order: 'asc' | 'desc'): SugaredOrderBy => [\n\t\t\tdesugaredOrderField.hasOneRelationPath\n\t\t\t\t.map(relation => relation.field)\n\t\t\t\t.reduceRight(\n\t\t\t\t\t(accumulator, currentValue) => ({\n\t\t\t\t\t\t[currentValue]: accumulator,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\t[desugaredOrderField.field]: order,\n\t\t\t\t\t} as Input.OrderBy<`${Input.OrderDirection}`>,\n\t\t\t\t),\n\t\t]\n\n\t\tif (newOrderFieldValue === undefined) {\n\t\t\tconst qel: SugaredQualifiedEntityList = {\n\t\t\t\tentities: entity,\n\t\t\t\texpectedMutation: 'none',\n\t\t\t\tlimit: 1,\n\t\t\t\torderBy: getOrderBy('desc'),\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={entity}\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t\tconst listSubTree = bindingOperations.getEntityListSubTree(qel)\n\t\t\t\t\t\t\tconst entities = Array.from(listSubTree)\n\t\t\t\t\t\t\tconst newOrderFieldValue = !entities.length\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: (entities[0].getField<number>(desugaredOrderField).value ?? 0) + 1\n\t\t\t\t\t\t\tgetAccessor().getField<number>(desugaredOrderField).updateValue(newOrderFieldValue)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntitySubTree>\n\t\t\t\t\t<EntityListSubTree {...qel}>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntityListSubTree>\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Field field={desugaredOrderField} defaultValue={newOrderFieldValue} isNonbearing />\n\t\t\t\t<EntityListSubTree\n\t\t\t\t\tentities={entity}\n\t\t\t\t\texpectedMutation=\"anyMutation\"\n\t\t\t\t\torderBy={getOrderBy('asc')}\n\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t// We're creating a new entity which adjusts the numbering of the other ones if applicable\n\t\t\t\t\t\t// and then deleting it again which leaves a hole for newOrderFieldValue that is set above.\n\t\t\t\t\t\tlet newEntityKey: string | undefined = undefined\n\t\t\t\t\t\taddEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, getNewEntity => {\n\t\t\t\t\t\t\tnewEntityKey = getNewEntity().key\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewEntityKey && bindingOperations.getEntityByKey(newEntityKey).deleteEntity()\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t</EntityListSubTree>\n\t\t\t</>\n\t\t)\n\t},\n\t'SetOrderFieldOnCreate',\n)\n"],"names":["newOrderFieldValue","this"],"mappings":"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"}
|
|
@@ -6,7 +6,7 @@ const addEntityAtIndex = (entityList, sortableByField, index, preprocess) => {
|
|
|
6
6
|
const sortedEntities = sortEntities.sortEntities(Array.from(entityList), sortableByField);
|
|
7
7
|
entityList.createNewEntity((getNewlyAdded, options) => {
|
|
8
8
|
let newlyAdded = getNewlyAdded();
|
|
9
|
-
const sortableField = newlyAdded.
|
|
9
|
+
const sortableField = newlyAdded.getField(sortableByField);
|
|
10
10
|
sortableField.updateValue(index);
|
|
11
11
|
newlyAdded = getNewlyAdded();
|
|
12
12
|
sortedEntities.splice(index, 0, newlyAdded);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addEntityAtIndex.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/addEntityAtIndex.ts"],"sourcesContent":["import { repairEntitiesOrder } from './repairEntitiesOrder'\nimport { sortEntities } from './sortEntities'\nimport { EntityAccessor, EntityListAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const addEntityAtIndex = (\n\tentityList: EntityListAccessor,\n\tsortableByField: RelativeSingleField,\n\tindex: number,\n\tpreprocess?: EntityAccessor.BatchUpdatesHandler,\n) => {\n\tconst sortedEntities = sortEntities(Array.from(entityList), sortableByField)\n\n\tentityList.createNewEntity((getNewlyAdded, options) => {\n\t\tlet newlyAdded = getNewlyAdded()\n\n\t\tconst sortableField = newlyAdded.
|
|
1
|
+
{"version":3,"file":"addEntityAtIndex.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/addEntityAtIndex.ts"],"sourcesContent":["import { repairEntitiesOrder } from './repairEntitiesOrder'\nimport { sortEntities } from './sortEntities'\nimport { EntityAccessor, EntityListAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const addEntityAtIndex = (\n\tentityList: EntityListAccessor,\n\tsortableByField: RelativeSingleField,\n\tindex: number,\n\tpreprocess?: EntityAccessor.BatchUpdatesHandler,\n) => {\n\tconst sortedEntities = sortEntities(Array.from(entityList), sortableByField)\n\n\tentityList.createNewEntity((getNewlyAdded, options) => {\n\t\tlet newlyAdded = getNewlyAdded()\n\n\t\tconst sortableField = newlyAdded.getField<number>(sortableByField)\n\n\t\tsortableField.updateValue(index)\n\t\tnewlyAdded = getNewlyAdded()\n\n\t\tsortedEntities.splice(index, 0, newlyAdded)\n\t\trepairEntitiesOrder(sortableByField, sortedEntities)\n\n\t\tpreprocess?.(getNewlyAdded, options)\n\t})\n}\n"],"names":["sortEntities","repairEntitiesOrder"],"mappings":";;;;AAIO,MAAM,mBAAmB,CAC/B,YACA,iBACA,OACA,eACI;AACJ,QAAM,iBAAiBA,aAAAA,aAAa,MAAM,KAAK,UAAU,GAAG,eAAe;AAEhE,aAAA,gBAAgB,CAAC,eAAe,YAAY;AACtD,QAAI,aAAa;AAEX,UAAA,gBAAgB,WAAW,SAAiB,eAAe;AAEjE,kBAAc,YAAY,KAAK;AAC/B,iBAAa,cAAc;AAEZ,mBAAA,OAAO,OAAO,GAAG,UAAU;AAC1CC,4CAAoB,iBAAiB,cAAc;AAEnD,iBAAa,eAAe,OAAO;AAAA,EAAA,CACnC;AACF;;"}
|
|
@@ -4,7 +4,7 @@ const addEntityAtIndex = (entityList, sortableByField, index, preprocess) => {
|
|
|
4
4
|
const sortedEntities = sortEntities(Array.from(entityList), sortableByField);
|
|
5
5
|
entityList.createNewEntity((getNewlyAdded, options) => {
|
|
6
6
|
let newlyAdded = getNewlyAdded();
|
|
7
|
-
const sortableField = newlyAdded.
|
|
7
|
+
const sortableField = newlyAdded.getField(sortableByField);
|
|
8
8
|
sortableField.updateValue(index);
|
|
9
9
|
newlyAdded = getNewlyAdded();
|
|
10
10
|
sortedEntities.splice(index, 0, newlyAdded);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addEntityAtIndex.js","sources":["../../../../../packages/react-binding/src/accessorSorting/addEntityAtIndex.ts"],"sourcesContent":["import { repairEntitiesOrder } from './repairEntitiesOrder'\nimport { sortEntities } from './sortEntities'\nimport { EntityAccessor, EntityListAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const addEntityAtIndex = (\n\tentityList: EntityListAccessor,\n\tsortableByField: RelativeSingleField,\n\tindex: number,\n\tpreprocess?: EntityAccessor.BatchUpdatesHandler,\n) => {\n\tconst sortedEntities = sortEntities(Array.from(entityList), sortableByField)\n\n\tentityList.createNewEntity((getNewlyAdded, options) => {\n\t\tlet newlyAdded = getNewlyAdded()\n\n\t\tconst sortableField = newlyAdded.
|
|
1
|
+
{"version":3,"file":"addEntityAtIndex.js","sources":["../../../../../packages/react-binding/src/accessorSorting/addEntityAtIndex.ts"],"sourcesContent":["import { repairEntitiesOrder } from './repairEntitiesOrder'\nimport { sortEntities } from './sortEntities'\nimport { EntityAccessor, EntityListAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const addEntityAtIndex = (\n\tentityList: EntityListAccessor,\n\tsortableByField: RelativeSingleField,\n\tindex: number,\n\tpreprocess?: EntityAccessor.BatchUpdatesHandler,\n) => {\n\tconst sortedEntities = sortEntities(Array.from(entityList), sortableByField)\n\n\tentityList.createNewEntity((getNewlyAdded, options) => {\n\t\tlet newlyAdded = getNewlyAdded()\n\n\t\tconst sortableField = newlyAdded.getField<number>(sortableByField)\n\n\t\tsortableField.updateValue(index)\n\t\tnewlyAdded = getNewlyAdded()\n\n\t\tsortedEntities.splice(index, 0, newlyAdded)\n\t\trepairEntitiesOrder(sortableByField, sortedEntities)\n\n\t\tpreprocess?.(getNewlyAdded, options)\n\t})\n}\n"],"names":[],"mappings":";;AAIO,MAAM,mBAAmB,CAC/B,YACA,iBACA,OACA,eACI;AACJ,QAAM,iBAAiB,aAAa,MAAM,KAAK,UAAU,GAAG,eAAe;AAEhE,aAAA,gBAAgB,CAAC,eAAe,YAAY;AACtD,QAAI,aAAa;AAEX,UAAA,gBAAgB,WAAW,SAAiB,eAAe;AAEjE,kBAAc,YAAY,KAAK;AAC/B,iBAAa,cAAc;AAEZ,mBAAA,OAAO,OAAO,GAAG,UAAU;AAC1C,wBAAoB,iBAAiB,cAAc;AAEnD,iBAAa,eAAe,OAAO;AAAA,EAAA,CACnC;AACF;"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const repairEntitiesOrder = (sortableByField, sortedEntities) => {
|
|
4
4
|
for (let i = 0, len = sortedEntities.length; i < len; i++) {
|
|
5
5
|
const entity = sortedEntities[i];
|
|
6
|
-
const orderField = entity.
|
|
6
|
+
const orderField = entity.getField(sortableByField);
|
|
7
7
|
if (orderField.value !== i) {
|
|
8
8
|
orderField.updateValue(i);
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repairEntitiesOrder.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/repairEntitiesOrder.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const repairEntitiesOrder = (sortableByField: RelativeSingleField, sortedEntities: EntityAccessor[]) => {\n\tfor (let i = 0, len = sortedEntities.length; i < len; i++) {\n\t\tconst entity = sortedEntities[i]\n\t\tconst orderField = entity.
|
|
1
|
+
{"version":3,"file":"repairEntitiesOrder.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/repairEntitiesOrder.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const repairEntitiesOrder = (sortableByField: RelativeSingleField, sortedEntities: EntityAccessor[]) => {\n\tfor (let i = 0, len = sortedEntities.length; i < len; i++) {\n\t\tconst entity = sortedEntities[i]\n\t\tconst orderField = entity.getField(sortableByField)\n\n\t\tif (orderField.value !== i) {\n\t\t\t// TODO ideally, this condition should just be `orderField.value === null`\n\t\t\t// We should generally try to touch the indexes less\n\t\t\torderField.updateValue(i)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAEa,MAAA,sBAAsB,CAAC,iBAAsC,mBAAqC;AAC9G,WAAS,IAAI,GAAG,MAAM,eAAe,QAAQ,IAAI,KAAK,KAAK;AACpD,UAAA,SAAS,eAAe,CAAC;AACzB,UAAA,aAAa,OAAO,SAAS,eAAe;AAE9C,QAAA,WAAW,UAAU,GAAG;AAG3B,iBAAW,YAAY,CAAC;AAAA,IACzB;AAAA,EACD;AACD;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const repairEntitiesOrder = (sortableByField, sortedEntities) => {
|
|
2
2
|
for (let i = 0, len = sortedEntities.length; i < len; i++) {
|
|
3
3
|
const entity = sortedEntities[i];
|
|
4
|
-
const orderField = entity.
|
|
4
|
+
const orderField = entity.getField(sortableByField);
|
|
5
5
|
if (orderField.value !== i) {
|
|
6
6
|
orderField.updateValue(i);
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repairEntitiesOrder.js","sources":["../../../../../packages/react-binding/src/accessorSorting/repairEntitiesOrder.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const repairEntitiesOrder = (sortableByField: RelativeSingleField, sortedEntities: EntityAccessor[]) => {\n\tfor (let i = 0, len = sortedEntities.length; i < len; i++) {\n\t\tconst entity = sortedEntities[i]\n\t\tconst orderField = entity.
|
|
1
|
+
{"version":3,"file":"repairEntitiesOrder.js","sources":["../../../../../packages/react-binding/src/accessorSorting/repairEntitiesOrder.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const repairEntitiesOrder = (sortableByField: RelativeSingleField, sortedEntities: EntityAccessor[]) => {\n\tfor (let i = 0, len = sortedEntities.length; i < len; i++) {\n\t\tconst entity = sortedEntities[i]\n\t\tconst orderField = entity.getField(sortableByField)\n\n\t\tif (orderField.value !== i) {\n\t\t\t// TODO ideally, this condition should just be `orderField.value === null`\n\t\t\t// We should generally try to touch the indexes less\n\t\t\torderField.updateValue(i)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAEa,MAAA,sBAAsB,CAAC,iBAAsC,mBAAqC;AAC9G,WAAS,IAAI,GAAG,MAAM,eAAe,QAAQ,IAAI,KAAK,KAAK;AACpD,UAAA,SAAS,eAAe,CAAC;AACzB,UAAA,aAAa,OAAO,SAAS,eAAe;AAE9C,QAAA,WAAW,UAAU,GAAG;AAG3B,iBAAW,YAAY,CAAC;AAAA,IACzB;AAAA,EACD;AACD;"}
|
|
@@ -5,8 +5,8 @@ const sortEntities = (entities, sortByField) => {
|
|
|
5
5
|
return entities;
|
|
6
6
|
}
|
|
7
7
|
return entities.sort((a, b) => {
|
|
8
|
-
const aField = a.
|
|
9
|
-
const bField = b.
|
|
8
|
+
const aField = a.getField(sortByField);
|
|
9
|
+
const bField = b.getField(sortByField);
|
|
10
10
|
return (aField.value ?? Number.MAX_SAFE_INTEGER) - (bField.value ?? Number.MAX_SAFE_INTEGER);
|
|
11
11
|
});
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortEntities.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/sortEntities.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const sortEntities = (\n\tentities: EntityAccessor[],\n\tsortByField: RelativeSingleField | undefined,\n): EntityAccessor[] => {\n\tif (!sortByField) {\n\t\treturn entities\n\t}\n\treturn entities.sort((a, b) => {\n\t\tconst aField = a.
|
|
1
|
+
{"version":3,"file":"sortEntities.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/sortEntities.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const sortEntities = (\n\tentities: EntityAccessor[],\n\tsortByField: RelativeSingleField | undefined,\n): EntityAccessor[] => {\n\tif (!sortByField) {\n\t\treturn entities\n\t}\n\treturn entities.sort((a, b) => {\n\t\tconst aField = a.getField<number>(sortByField)\n\t\tconst bField = b.getField<number>(sortByField)\n\n\t\treturn (aField.value ?? Number.MAX_SAFE_INTEGER) - (bField.value ?? Number.MAX_SAFE_INTEGER)\n\t})\n}\n"],"names":[],"mappings":";;AAEa,MAAA,eAAe,CAC3B,UACA,gBACsB;AACtB,MAAI,CAAC,aAAa;AACV,WAAA;AAAA,EACR;AACA,SAAO,SAAS,KAAK,CAAC,GAAG,MAAM;AACxB,UAAA,SAAS,EAAE,SAAiB,WAAW;AACvC,UAAA,SAAS,EAAE,SAAiB,WAAW;AAE7C,YAAQ,OAAO,SAAS,OAAO,qBAAqB,OAAO,SAAS,OAAO;AAAA,EAAA,CAC3E;AACF;;"}
|
|
@@ -3,8 +3,8 @@ const sortEntities = (entities, sortByField) => {
|
|
|
3
3
|
return entities;
|
|
4
4
|
}
|
|
5
5
|
return entities.sort((a, b) => {
|
|
6
|
-
const aField = a.
|
|
7
|
-
const bField = b.
|
|
6
|
+
const aField = a.getField(sortByField);
|
|
7
|
+
const bField = b.getField(sortByField);
|
|
8
8
|
return (aField.value ?? Number.MAX_SAFE_INTEGER) - (bField.value ?? Number.MAX_SAFE_INTEGER);
|
|
9
9
|
});
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortEntities.js","sources":["../../../../../packages/react-binding/src/accessorSorting/sortEntities.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const sortEntities = (\n\tentities: EntityAccessor[],\n\tsortByField: RelativeSingleField | undefined,\n): EntityAccessor[] => {\n\tif (!sortByField) {\n\t\treturn entities\n\t}\n\treturn entities.sort((a, b) => {\n\t\tconst aField = a.
|
|
1
|
+
{"version":3,"file":"sortEntities.js","sources":["../../../../../packages/react-binding/src/accessorSorting/sortEntities.ts"],"sourcesContent":["import { EntityAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const sortEntities = (\n\tentities: EntityAccessor[],\n\tsortByField: RelativeSingleField | undefined,\n): EntityAccessor[] => {\n\tif (!sortByField) {\n\t\treturn entities\n\t}\n\treturn entities.sort((a, b) => {\n\t\tconst aField = a.getField<number>(sortByField)\n\t\tconst bField = b.getField<number>(sortByField)\n\n\t\treturn (aField.value ?? Number.MAX_SAFE_INTEGER) - (bField.value ?? Number.MAX_SAFE_INTEGER)\n\t})\n}\n"],"names":[],"mappings":"AAEa,MAAA,eAAe,CAC3B,UACA,gBACsB;AACtB,MAAI,CAAC,aAAa;AACV,WAAA;AAAA,EACR;AACA,SAAO,SAAS,KAAK,CAAC,GAAG,MAAM;AACxB,UAAA,SAAS,EAAE,SAAiB,WAAW;AACvC,UAAA,SAAS,EAAE,SAAiB,WAAW;AAE7C,YAAQ,OAAO,SAAS,OAAO,qBAAqB,OAAO,SAAS,OAAO;AAAA,EAAA,CAC3E;AACF;"}
|
|
@@ -4,33 +4,43 @@ const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
|
4
4
|
const AccessorTreeStateContext = require("./AccessorTreeStateContext.cjs");
|
|
5
5
|
const DirtinessContext = require("./DirtinessContext.cjs");
|
|
6
6
|
const MutationStateContext = require("./MutationStateContext.cjs");
|
|
7
|
+
const EntityKeyContext = require("../accessorPropagation/EntityKeyContext.cjs");
|
|
7
8
|
const EnvironmentContext = require("../accessorPropagation/EnvironmentContext.cjs");
|
|
8
9
|
const BindingOperationsProvider = require("../accessorPropagation/BindingOperationsProvider.cjs");
|
|
10
|
+
const TreeRootIdProvider = require("../accessorPropagation/TreeRootIdProvider.cjs");
|
|
9
11
|
const AccessorTree = ({ state, children }) => {
|
|
10
12
|
const stateData = state.name === "initialized" ? state.data : {
|
|
11
13
|
hasUnpersistedChanges: false,
|
|
12
14
|
isMutating: false,
|
|
13
15
|
bindingOperations: void 0
|
|
14
16
|
};
|
|
15
|
-
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(EnvironmentContext.EnvironmentContext.Provider, { value: state.environment, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(AccessorTreeStateContext.AccessorTreeStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(DirtinessContext.DirtinessContext.Provider, { value: stateData.hasUnpersistedChanges, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(MutationStateContext.MutationStateContext.Provider, { value: stateData.isMutating, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(BindingOperationsProvider.BindingOperationsProvider, { bindingOperations: stateData.bindingOperations, children }, void 0, false, {
|
|
17
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(TreeRootIdProvider.TreeRootIdProvider, { treeRootId: void 0, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(EntityKeyContext.EntityKeyContext.Provider, { value: void 0, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(EnvironmentContext.EnvironmentContext.Provider, { value: state.environment, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(AccessorTreeStateContext.AccessorTreeStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(DirtinessContext.DirtinessContext.Provider, { value: stateData.hasUnpersistedChanges, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(MutationStateContext.MutationStateContext.Provider, { value: stateData.isMutating, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(BindingOperationsProvider.BindingOperationsProvider, { bindingOperations: stateData.bindingOperations, children }, void 0, false, {
|
|
16
18
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
17
|
-
lineNumber:
|
|
19
|
+
lineNumber: 30,
|
|
20
|
+
columnNumber: 9
|
|
21
|
+
}, void 0) }, void 0, false, {
|
|
22
|
+
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
23
|
+
lineNumber: 29,
|
|
24
|
+
columnNumber: 8
|
|
25
|
+
}, void 0) }, void 0, false, {
|
|
26
|
+
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
27
|
+
lineNumber: 28,
|
|
18
28
|
columnNumber: 7
|
|
19
29
|
}, void 0) }, void 0, false, {
|
|
20
30
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
21
|
-
lineNumber:
|
|
31
|
+
lineNumber: 27,
|
|
22
32
|
columnNumber: 6
|
|
23
33
|
}, void 0) }, void 0, false, {
|
|
24
34
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
25
|
-
lineNumber:
|
|
35
|
+
lineNumber: 26,
|
|
26
36
|
columnNumber: 5
|
|
27
37
|
}, void 0) }, void 0, false, {
|
|
28
38
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
29
|
-
lineNumber:
|
|
39
|
+
lineNumber: 25,
|
|
30
40
|
columnNumber: 4
|
|
31
41
|
}, void 0) }, void 0, false, {
|
|
32
42
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
33
|
-
lineNumber:
|
|
43
|
+
lineNumber: 24,
|
|
34
44
|
columnNumber: 3
|
|
35
45
|
}, void 0);
|
|
36
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorTree.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTree.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { BindingOperationsProvider, EnvironmentContext } from '../accessorPropagation'\nimport type { AccessorTreeState } from './AccessorTreeState'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext'\nimport { DirtinessContext } from './DirtinessContext'\nimport { MutationStateContext } from './MutationStateContext'\n\nexport interface AccessorTreeProps {\n\tstate: AccessorTreeState\n\tchildren: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const AccessorTree = ({ state, children }: AccessorTreeProps) => {\n\tconst stateData = state.name === 'initialized' ? state.data : {\n\t\thasUnpersistedChanges: false,\n\t\tisMutating: false,\n\t\tbindingOperations: undefined,\n\t}\n\treturn (\n\t\t<EnvironmentContext.Provider value={state.environment}>\n\t\t\t<AccessorTreeStateContext.Provider value={state}>\n\t\t\t\t<DirtinessContext.Provider value={stateData.hasUnpersistedChanges}>\n\t\t\t\t\t<MutationStateContext.Provider value={stateData.isMutating}>\n\t\t\t\t\t\t<BindingOperationsProvider bindingOperations={stateData.bindingOperations}>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</BindingOperationsProvider>\n\t\t\t\t\t</MutationStateContext.Provider>\n\t\t\t\t</DirtinessContext.Provider>\n\t\t\t</AccessorTreeStateContext.Provider>\n\t\t</EnvironmentContext.Provider>\n\t)\n}\n\nAccessorTree.displayName = 'AccessorTree'\n"],"names":["jsxDEV","EnvironmentContext","AccessorTreeStateContext","DirtinessContext","MutationStateContext","BindingOperationsProvider","this"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccessorTree.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTree.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { BindingOperationsProvider, EnvironmentContext, TreeRootIdProvider } from '../accessorPropagation'\nimport type { AccessorTreeState } from './AccessorTreeState'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext'\nimport { DirtinessContext } from './DirtinessContext'\nimport { MutationStateContext } from './MutationStateContext'\nimport { EntityKeyContext } from '../accessorPropagation/EntityKeyContext'\n\nexport interface AccessorTreeProps {\n\tstate: AccessorTreeState\n\tchildren: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const AccessorTree = ({ state, children }: AccessorTreeProps) => {\n\tconst stateData = state.name === 'initialized' ? state.data : {\n\t\thasUnpersistedChanges: false,\n\t\tisMutating: false,\n\t\tbindingOperations: undefined,\n\t}\n\treturn (\n\t\t<TreeRootIdProvider treeRootId={undefined}>\n\t\t\t<EntityKeyContext.Provider value={undefined}>\n\t\t\t\t<EnvironmentContext.Provider value={state.environment}>\n\t\t\t\t\t<AccessorTreeStateContext.Provider value={state}>\n\t\t\t\t\t\t<DirtinessContext.Provider value={stateData.hasUnpersistedChanges}>\n\t\t\t\t\t\t\t<MutationStateContext.Provider value={stateData.isMutating}>\n\t\t\t\t\t\t\t\t<BindingOperationsProvider bindingOperations={stateData.bindingOperations}>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</BindingOperationsProvider>\n\t\t\t\t\t\t\t</MutationStateContext.Provider>\n\t\t\t\t\t\t</DirtinessContext.Provider>\n\t\t\t\t\t</AccessorTreeStateContext.Provider>\n\t\t\t\t</EnvironmentContext.Provider>\n\t\t\t</EntityKeyContext.Provider>\n\t\t</TreeRootIdProvider>\n\t)\n}\n\nAccessorTree.displayName = 'AccessorTree'\n"],"names":["TreeRootIdProvider","jsxDEV","EntityKeyContext","EnvironmentContext","AccessorTreeStateContext","DirtinessContext","MutationStateContext","BindingOperationsProvider","this"],"mappings":";;;;;;;;;;AAgBO,MAAM,eAAe,CAAC,EAAE,OAAO,eAAkC;AACvE,QAAM,YAAY,MAAM,SAAS,gBAAgB,MAAM,OAAO;AAAA,IAC7D,uBAAuB;AAAA,IACvB,YAAY;AAAA,IACZ,mBAAmB;AAAA,EAAA;AAEpB,8CACEA,mBAAAA,oBAAmB,EAAA,YAAY,QAC/B,UAACC,8BAAAA,OAAAC,iBAAA,iBAAiB,UAAjB,EAA0B,OAAO,QACjC,UAACD,qCAAAE,mBAAAA,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,aACzC,UAAAF,8BAAA,OAACG,kDAAyB,UAAzB,EAAkC,OAAO,OACzC,+CAACC,kCAAiB,UAAjB,EAA0B,OAAO,UAAU,uBAC3C,UAACJ,8BAAAA,OAAAK,qBAAA,qBAAqB,UAArB,EAA8B,OAAO,UAAU,YAC/C,UAAAL,8BAAA,OAACM,uDAA0B,mBAAmB,UAAU,mBACtD,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA,EAPD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAQA,EATD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAUA,EAXD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAYA,EAbD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAcA,GAAAA,MAAA;AAEF;AAEA,aAAa,cAAc;;"}
|
|
@@ -2,33 +2,43 @@ import { jsxDEV } from "react/jsx-dev-runtime";
|
|
|
2
2
|
import { AccessorTreeStateContext } from "./AccessorTreeStateContext.js";
|
|
3
3
|
import { DirtinessContext } from "./DirtinessContext.js";
|
|
4
4
|
import { MutationStateContext } from "./MutationStateContext.js";
|
|
5
|
+
import { EntityKeyContext } from "../accessorPropagation/EntityKeyContext.js";
|
|
5
6
|
import { EnvironmentContext } from "../accessorPropagation/EnvironmentContext.js";
|
|
6
7
|
import { BindingOperationsProvider } from "../accessorPropagation/BindingOperationsProvider.js";
|
|
8
|
+
import { TreeRootIdProvider } from "../accessorPropagation/TreeRootIdProvider.js";
|
|
7
9
|
const AccessorTree = ({ state, children }) => {
|
|
8
10
|
const stateData = state.name === "initialized" ? state.data : {
|
|
9
11
|
hasUnpersistedChanges: false,
|
|
10
12
|
isMutating: false,
|
|
11
13
|
bindingOperations: void 0
|
|
12
14
|
};
|
|
13
|
-
return /* @__PURE__ */ jsxDEV(EnvironmentContext.Provider, { value: state.environment, children: /* @__PURE__ */ jsxDEV(AccessorTreeStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxDEV(DirtinessContext.Provider, { value: stateData.hasUnpersistedChanges, children: /* @__PURE__ */ jsxDEV(MutationStateContext.Provider, { value: stateData.isMutating, children: /* @__PURE__ */ jsxDEV(BindingOperationsProvider, { bindingOperations: stateData.bindingOperations, children }, void 0, false, {
|
|
15
|
+
return /* @__PURE__ */ jsxDEV(TreeRootIdProvider, { treeRootId: void 0, children: /* @__PURE__ */ jsxDEV(EntityKeyContext.Provider, { value: void 0, children: /* @__PURE__ */ jsxDEV(EnvironmentContext.Provider, { value: state.environment, children: /* @__PURE__ */ jsxDEV(AccessorTreeStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxDEV(DirtinessContext.Provider, { value: stateData.hasUnpersistedChanges, children: /* @__PURE__ */ jsxDEV(MutationStateContext.Provider, { value: stateData.isMutating, children: /* @__PURE__ */ jsxDEV(BindingOperationsProvider, { bindingOperations: stateData.bindingOperations, children }, void 0, false, {
|
|
14
16
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
15
|
-
lineNumber:
|
|
17
|
+
lineNumber: 30,
|
|
18
|
+
columnNumber: 9
|
|
19
|
+
}, void 0) }, void 0, false, {
|
|
20
|
+
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
21
|
+
lineNumber: 29,
|
|
22
|
+
columnNumber: 8
|
|
23
|
+
}, void 0) }, void 0, false, {
|
|
24
|
+
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
25
|
+
lineNumber: 28,
|
|
16
26
|
columnNumber: 7
|
|
17
27
|
}, void 0) }, void 0, false, {
|
|
18
28
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
19
|
-
lineNumber:
|
|
29
|
+
lineNumber: 27,
|
|
20
30
|
columnNumber: 6
|
|
21
31
|
}, void 0) }, void 0, false, {
|
|
22
32
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
23
|
-
lineNumber:
|
|
33
|
+
lineNumber: 26,
|
|
24
34
|
columnNumber: 5
|
|
25
35
|
}, void 0) }, void 0, false, {
|
|
26
36
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
27
|
-
lineNumber:
|
|
37
|
+
lineNumber: 25,
|
|
28
38
|
columnNumber: 4
|
|
29
39
|
}, void 0) }, void 0, false, {
|
|
30
40
|
fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorTree/AccessorTree.tsx",
|
|
31
|
-
lineNumber:
|
|
41
|
+
lineNumber: 24,
|
|
32
42
|
columnNumber: 3
|
|
33
43
|
}, void 0);
|
|
34
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorTree.js","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTree.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { BindingOperationsProvider, EnvironmentContext } from '../accessorPropagation'\nimport type { AccessorTreeState } from './AccessorTreeState'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext'\nimport { DirtinessContext } from './DirtinessContext'\nimport { MutationStateContext } from './MutationStateContext'\n\nexport interface AccessorTreeProps {\n\tstate: AccessorTreeState\n\tchildren: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const AccessorTree = ({ state, children }: AccessorTreeProps) => {\n\tconst stateData = state.name === 'initialized' ? state.data : {\n\t\thasUnpersistedChanges: false,\n\t\tisMutating: false,\n\t\tbindingOperations: undefined,\n\t}\n\treturn (\n\t\t<EnvironmentContext.Provider value={state.environment}>\n\t\t\t<AccessorTreeStateContext.Provider value={state}>\n\t\t\t\t<DirtinessContext.Provider value={stateData.hasUnpersistedChanges}>\n\t\t\t\t\t<MutationStateContext.Provider value={stateData.isMutating}>\n\t\t\t\t\t\t<BindingOperationsProvider bindingOperations={stateData.bindingOperations}>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</BindingOperationsProvider>\n\t\t\t\t\t</MutationStateContext.Provider>\n\t\t\t\t</DirtinessContext.Provider>\n\t\t\t</AccessorTreeStateContext.Provider>\n\t\t</EnvironmentContext.Provider>\n\t)\n}\n\nAccessorTree.displayName = 'AccessorTree'\n"],"names":["this"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccessorTree.js","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTree.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { BindingOperationsProvider, EnvironmentContext, TreeRootIdProvider } from '../accessorPropagation'\nimport type { AccessorTreeState } from './AccessorTreeState'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext'\nimport { DirtinessContext } from './DirtinessContext'\nimport { MutationStateContext } from './MutationStateContext'\nimport { EntityKeyContext } from '../accessorPropagation/EntityKeyContext'\n\nexport interface AccessorTreeProps {\n\tstate: AccessorTreeState\n\tchildren: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const AccessorTree = ({ state, children }: AccessorTreeProps) => {\n\tconst stateData = state.name === 'initialized' ? state.data : {\n\t\thasUnpersistedChanges: false,\n\t\tisMutating: false,\n\t\tbindingOperations: undefined,\n\t}\n\treturn (\n\t\t<TreeRootIdProvider treeRootId={undefined}>\n\t\t\t<EntityKeyContext.Provider value={undefined}>\n\t\t\t\t<EnvironmentContext.Provider value={state.environment}>\n\t\t\t\t\t<AccessorTreeStateContext.Provider value={state}>\n\t\t\t\t\t\t<DirtinessContext.Provider value={stateData.hasUnpersistedChanges}>\n\t\t\t\t\t\t\t<MutationStateContext.Provider value={stateData.isMutating}>\n\t\t\t\t\t\t\t\t<BindingOperationsProvider bindingOperations={stateData.bindingOperations}>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</BindingOperationsProvider>\n\t\t\t\t\t\t\t</MutationStateContext.Provider>\n\t\t\t\t\t\t</DirtinessContext.Provider>\n\t\t\t\t\t</AccessorTreeStateContext.Provider>\n\t\t\t\t</EnvironmentContext.Provider>\n\t\t\t</EntityKeyContext.Provider>\n\t\t</TreeRootIdProvider>\n\t)\n}\n\nAccessorTree.displayName = 'AccessorTree'\n"],"names":["this"],"mappings":";;;;;;;;AAgBO,MAAM,eAAe,CAAC,EAAE,OAAO,eAAkC;AACvE,QAAM,YAAY,MAAM,SAAS,gBAAgB,MAAM,OAAO;AAAA,IAC7D,uBAAuB;AAAA,IACvB,YAAY;AAAA,IACZ,mBAAmB;AAAA,EAAA;AAEpB,gCACE,oBAAmB,EAAA,YAAY,QAC/B,UAAC,uBAAA,iBAAiB,UAAjB,EAA0B,OAAO,QACjC,UAAC,uBAAA,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,aACzC,UAAA,uBAAC,yBAAyB,UAAzB,EAAkC,OAAO,OACzC,iCAAC,iBAAiB,UAAjB,EAA0B,OAAO,UAAU,uBAC3C,UAAC,uBAAA,qBAAqB,UAArB,EAA8B,OAAO,UAAU,YAC/C,UAAA,uBAAC,6BAA0B,mBAAmB,UAAU,mBACtD,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA,EAPD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAQA,EATD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAUA,EAXD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAYA,EAbD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAcA,GAAAA,MAAA;AAEF;AAEA,aAAa,cAAc;"}
|