@contember/react-binding 2.1.0-alpha.9 → 2.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (558) hide show
  1. package/CLAUDE.md +57 -0
  2. package/dist/development/index.cjs +99 -99
  3. package/dist/development/index.js +48 -48
  4. package/dist/development/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
  5. package/dist/development/src/accessorPropagation/AccessorProvider.js.map +1 -1
  6. package/dist/development/src/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
  7. package/dist/development/src/accessorPropagation/BindingOperationsContext.js.map +1 -1
  8. package/dist/development/src/accessorPropagation/BindingOperationsProvider.cjs.map +1 -1
  9. package/dist/development/src/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  10. package/dist/development/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
  11. package/dist/development/src/accessorPropagation/EntityKeyContext.js.map +1 -1
  12. package/dist/development/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
  13. package/dist/development/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
  14. package/dist/development/src/accessorPropagation/EnvironmentContext.cjs +0 -1
  15. package/dist/development/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
  16. package/dist/development/src/accessorPropagation/EnvironmentContext.js +1 -2
  17. package/dist/development/src/accessorPropagation/EnvironmentContext.js.map +1 -1
  18. package/dist/development/src/accessorPropagation/TreeRootIdContext.cjs.map +1 -1
  19. package/dist/development/src/accessorPropagation/TreeRootIdContext.js.map +1 -1
  20. package/dist/development/src/accessorPropagation/TreeRootIdProvider.cjs.map +1 -1
  21. package/dist/development/src/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  22. package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.cjs.map +1 -1
  23. package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
  24. package/dist/development/src/accessorPropagation/useBindingOperations.cjs.map +1 -1
  25. package/dist/development/src/accessorPropagation/useBindingOperations.js.map +1 -1
  26. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.cjs +1 -2
  27. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
  28. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.js +1 -2
  29. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
  30. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs +1 -2
  31. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
  32. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.js +1 -2
  33. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
  34. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.cjs +1 -2
  35. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
  36. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.js +1 -2
  37. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
  38. package/dist/development/src/accessorPropagation/useEntity.cjs.map +1 -1
  39. package/dist/development/src/accessorPropagation/useEntity.js.map +1 -1
  40. package/dist/development/src/accessorPropagation/useEntityKey.cjs.map +1 -1
  41. package/dist/development/src/accessorPropagation/useEntityKey.js.map +1 -1
  42. package/dist/development/src/accessorPropagation/useEntityList.cjs.map +1 -1
  43. package/dist/development/src/accessorPropagation/useEntityList.js.map +1 -1
  44. package/dist/development/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
  45. package/dist/development/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
  46. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs +1 -1
  47. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
  48. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js +1 -1
  49. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
  50. package/dist/development/src/accessorPropagation/useEntityListSubTreeParameters.cjs.map +1 -1
  51. package/dist/development/src/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
  52. package/dist/development/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
  53. package/dist/development/src/accessorPropagation/useEntitySubTree.js.map +1 -1
  54. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs +1 -1
  55. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
  56. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js +1 -1
  57. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
  58. package/dist/development/src/accessorPropagation/useEntitySubTreeParameters.cjs.map +1 -1
  59. package/dist/development/src/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
  60. package/dist/development/src/accessorPropagation/useExtendTree.cjs +1 -4
  61. package/dist/development/src/accessorPropagation/useExtendTree.cjs.map +1 -1
  62. package/dist/development/src/accessorPropagation/useExtendTree.js +1 -4
  63. package/dist/development/src/accessorPropagation/useExtendTree.js.map +1 -1
  64. package/dist/development/src/accessorPropagation/useField.cjs.map +1 -1
  65. package/dist/development/src/accessorPropagation/useField.js.map +1 -1
  66. package/dist/development/src/accessorPropagation/useGetEntityByKey.cjs.map +1 -1
  67. package/dist/development/src/accessorPropagation/useGetEntityByKey.js.map +1 -1
  68. package/dist/development/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
  69. package/dist/development/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
  70. package/dist/development/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
  71. package/dist/development/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
  72. package/dist/development/src/accessorPropagation/useHasEntity.cjs.map +1 -1
  73. package/dist/development/src/accessorPropagation/useHasEntity.js.map +1 -1
  74. package/dist/development/src/accessorPropagation/usePersist.cjs.map +1 -1
  75. package/dist/development/src/accessorPropagation/usePersist.js.map +1 -1
  76. package/dist/development/src/accessorPropagation/useTreeRootId.cjs.map +1 -1
  77. package/dist/development/src/accessorPropagation/useTreeRootId.js.map +1 -1
  78. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs +10 -10
  79. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
  80. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js +10 -10
  81. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  82. package/dist/development/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
  83. package/dist/development/src/accessorSorting/addEntityAtIndex.js.map +1 -1
  84. package/dist/development/src/accessorSorting/repairEntitiesOrder.cjs.map +1 -1
  85. package/dist/development/src/accessorSorting/repairEntitiesOrder.js.map +1 -1
  86. package/dist/development/src/accessorSorting/sortEntities.cjs.map +1 -1
  87. package/dist/development/src/accessorSorting/sortEntities.js.map +1 -1
  88. package/dist/development/src/accessorTree/AccessorTree.cjs.map +1 -1
  89. package/dist/development/src/accessorTree/AccessorTree.js.map +1 -1
  90. package/dist/development/src/accessorTree/AccessorTreeStateContext.cjs.map +1 -1
  91. package/dist/development/src/accessorTree/AccessorTreeStateContext.js.map +1 -1
  92. package/dist/development/src/accessorTree/DirtinessContext.cjs.map +1 -1
  93. package/dist/development/src/accessorTree/DirtinessContext.js.map +1 -1
  94. package/dist/development/src/accessorTree/MutationStateContext.cjs.map +1 -1
  95. package/dist/development/src/accessorTree/MutationStateContext.js.map +1 -1
  96. package/dist/development/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
  97. package/dist/development/src/accessorTree/useAccessorTreeState.js.map +1 -1
  98. package/dist/development/src/accessorTree/useDataBinding.cjs +17 -13
  99. package/dist/development/src/accessorTree/useDataBinding.cjs.map +1 -1
  100. package/dist/development/src/accessorTree/useDataBinding.js +19 -15
  101. package/dist/development/src/accessorTree/useDataBinding.js.map +1 -1
  102. package/dist/development/src/accessorTree/useDirtinessState.cjs.map +1 -1
  103. package/dist/development/src/accessorTree/useDirtinessState.js.map +1 -1
  104. package/dist/development/src/accessorTree/useEnvironmentWithSchema.cjs.map +1 -1
  105. package/dist/development/src/accessorTree/useEnvironmentWithSchema.js.map +1 -1
  106. package/dist/development/src/accessorTree/useMutationState.cjs.map +1 -1
  107. package/dist/development/src/accessorTree/useMutationState.js.map +1 -1
  108. package/dist/development/src/coreComponents/Component.cjs.map +1 -1
  109. package/dist/development/src/coreComponents/Component.js.map +1 -1
  110. package/dist/development/src/coreComponents/DataBindingProvider.cjs +1 -1
  111. package/dist/development/src/coreComponents/DataBindingProvider.cjs.map +1 -1
  112. package/dist/development/src/coreComponents/DataBindingProvider.js +1 -1
  113. package/dist/development/src/coreComponents/DataBindingProvider.js.map +1 -1
  114. package/dist/development/src/coreComponents/Entity.cjs.map +1 -1
  115. package/dist/development/src/coreComponents/Entity.js.map +1 -1
  116. package/dist/development/src/coreComponents/EntityList.cjs +3 -3
  117. package/dist/development/src/coreComponents/EntityList.cjs.map +1 -1
  118. package/dist/development/src/coreComponents/EntityList.js +3 -3
  119. package/dist/development/src/coreComponents/EntityList.js.map +1 -1
  120. package/dist/development/src/coreComponents/EntityListSubTree.cjs +3 -3
  121. package/dist/development/src/coreComponents/EntityListSubTree.cjs.map +1 -1
  122. package/dist/development/src/coreComponents/EntityListSubTree.js +4 -4
  123. package/dist/development/src/coreComponents/EntityListSubTree.js.map +1 -1
  124. package/dist/development/src/coreComponents/EntitySubTree.cjs.map +1 -1
  125. package/dist/development/src/coreComponents/EntitySubTree.js +1 -1
  126. package/dist/development/src/coreComponents/EntitySubTree.js.map +1 -1
  127. package/dist/development/src/coreComponents/Field.cjs +2 -2
  128. package/dist/development/src/coreComponents/Field.cjs.map +1 -1
  129. package/dist/development/src/coreComponents/Field.js +3 -3
  130. package/dist/development/src/coreComponents/Field.js.map +1 -1
  131. package/dist/development/src/coreComponents/HasMany.cjs +3 -3
  132. package/dist/development/src/coreComponents/HasMany.cjs.map +1 -1
  133. package/dist/development/src/coreComponents/HasMany.js +4 -4
  134. package/dist/development/src/coreComponents/HasMany.js.map +1 -1
  135. package/dist/development/src/coreComponents/HasOne.cjs.map +1 -1
  136. package/dist/development/src/coreComponents/HasOne.js +1 -1
  137. package/dist/development/src/coreComponents/HasOne.js.map +1 -1
  138. package/dist/development/src/coreComponents/ParentEntity.cjs.map +1 -1
  139. package/dist/development/src/coreComponents/ParentEntity.js.map +1 -1
  140. package/dist/development/src/entityEvents/useDataBindingEvent.cjs.map +1 -1
  141. package/dist/development/src/entityEvents/useDataBindingEvent.js.map +1 -1
  142. package/dist/development/src/entityEvents/useDerivedField.cjs.map +1 -1
  143. package/dist/development/src/entityEvents/useDerivedField.js.map +1 -1
  144. package/dist/development/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
  145. package/dist/development/src/entityEvents/useEntityBeforePersist.js.map +1 -1
  146. package/dist/development/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
  147. package/dist/development/src/entityEvents/useEntityBeforeUpdate.js.map +1 -1
  148. package/dist/development/src/entityEvents/useEntityEvent.cjs.map +1 -1
  149. package/dist/development/src/entityEvents/useEntityEvent.js.map +1 -1
  150. package/dist/development/src/entityEvents/useEntityPersistError.cjs.map +1 -1
  151. package/dist/development/src/entityEvents/useEntityPersistError.js.map +1 -1
  152. package/dist/development/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
  153. package/dist/development/src/entityEvents/useEntityPersistSuccess.js.map +1 -1
  154. package/dist/development/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
  155. package/dist/development/src/entityEvents/useOnConnectionUpdate.js.map +1 -1
  156. package/dist/development/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
  157. package/dist/development/src/helperComponents/DeferredSubTrees.js.map +1 -1
  158. package/dist/development/src/helperComponents/DeleteEntityTrigger.cjs +1 -1
  159. package/dist/development/src/helperComponents/DeleteEntityTrigger.cjs.map +1 -1
  160. package/dist/development/src/helperComponents/DeleteEntityTrigger.js +1 -1
  161. package/dist/development/src/helperComponents/DeleteEntityTrigger.js.map +1 -1
  162. package/dist/development/src/helperComponents/DimensionRenderer.cjs +4 -4
  163. package/dist/development/src/helperComponents/DimensionRenderer.cjs.map +1 -1
  164. package/dist/development/src/helperComponents/DimensionRenderer.js +4 -4
  165. package/dist/development/src/helperComponents/DimensionRenderer.js.map +1 -1
  166. package/dist/development/src/helperComponents/EntityView.cjs +1 -1
  167. package/dist/development/src/helperComponents/EntityView.cjs.map +1 -1
  168. package/dist/development/src/helperComponents/EntityView.js +1 -1
  169. package/dist/development/src/helperComponents/EntityView.js.map +1 -1
  170. package/dist/development/src/helperComponents/FieldView.cjs +4 -4
  171. package/dist/development/src/helperComponents/FieldView.cjs.map +1 -1
  172. package/dist/development/src/helperComponents/FieldView.js +4 -4
  173. package/dist/development/src/helperComponents/FieldView.js.map +1 -1
  174. package/dist/development/src/helperComponents/If.cjs +20 -23
  175. package/dist/development/src/helperComponents/If.cjs.map +1 -1
  176. package/dist/development/src/helperComponents/If.js +20 -23
  177. package/dist/development/src/helperComponents/If.js.map +1 -1
  178. package/dist/development/src/helperComponents/LabelMiddleware.cjs.map +1 -1
  179. package/dist/development/src/helperComponents/LabelMiddleware.js.map +1 -1
  180. package/dist/development/src/helperComponents/RecursionTerminator.cjs.map +1 -1
  181. package/dist/development/src/helperComponents/RecursionTerminator.js.map +1 -1
  182. package/dist/development/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -1
  183. package/dist/development/src/helperComponents/RecursionTerminatorPortal.js.map +1 -1
  184. package/dist/development/src/helperComponents/StaticRender.cjs.map +1 -1
  185. package/dist/development/src/helperComponents/StaticRender.js.map +1 -1
  186. package/dist/development/src/helperComponents/SugaredField.cjs.map +1 -1
  187. package/dist/development/src/helperComponents/SugaredField.js.map +1 -1
  188. package/dist/development/src/helperComponents/Variable.cjs.map +1 -1
  189. package/dist/development/src/helperComponents/Variable.js.map +1 -1
  190. package/dist/development/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
  191. package/dist/development/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  192. package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.cjs +4 -2
  193. package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.cjs.map +1 -1
  194. package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.js +4 -2
  195. package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
  196. package/dist/development/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
  197. package/dist/development/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
  198. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.cjs +1 -1
  199. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.cjs.map +1 -1
  200. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.js +1 -1
  201. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.js.map +1 -1
  202. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.cjs +1 -1
  203. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.cjs.map +1 -1
  204. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.js +1 -1
  205. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.js.map +1 -1
  206. package/dist/development/src/helperComponents/persist/PersistOnKey.cjs.map +1 -1
  207. package/dist/development/src/helperComponents/persist/PersistOnKey.js.map +1 -1
  208. package/dist/development/src/helperComponents/persist/PersistTrigger.cjs +1 -1
  209. package/dist/development/src/helperComponents/persist/PersistTrigger.cjs.map +1 -1
  210. package/dist/development/src/helperComponents/persist/PersistTrigger.js +1 -1
  211. package/dist/development/src/helperComponents/persist/PersistTrigger.js.map +1 -1
  212. package/dist/development/src/helperComponents/persist/useDecoratedPersist.cjs.map +1 -1
  213. package/dist/development/src/helperComponents/persist/useDecoratedPersist.js.map +1 -1
  214. package/dist/development/src/markers/IncrementalMarkerBuilder.cjs +47 -44
  215. package/dist/development/src/markers/IncrementalMarkerBuilder.cjs.map +1 -1
  216. package/dist/development/src/markers/IncrementalMarkerBuilder.js +47 -44
  217. package/dist/development/src/markers/IncrementalMarkerBuilder.js.map +1 -1
  218. package/dist/development/src/markers/MarkerStaticAnalyzer.cjs +19 -19
  219. package/dist/development/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
  220. package/dist/development/src/markers/MarkerStaticAnalyzer.js +19 -19
  221. package/dist/development/src/markers/MarkerStaticAnalyzer.js.map +1 -1
  222. package/dist/development/src/markers/MarkerTreeGenerator.cjs.map +1 -1
  223. package/dist/development/src/markers/MarkerTreeGenerator.js.map +1 -1
  224. package/dist/production/index.cjs +99 -99
  225. package/dist/production/index.js +48 -48
  226. package/dist/production/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
  227. package/dist/production/src/accessorPropagation/AccessorProvider.js.map +1 -1
  228. package/dist/production/src/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
  229. package/dist/production/src/accessorPropagation/BindingOperationsContext.js.map +1 -1
  230. package/dist/production/src/accessorPropagation/BindingOperationsProvider.cjs.map +1 -1
  231. package/dist/production/src/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  232. package/dist/production/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
  233. package/dist/production/src/accessorPropagation/EntityKeyContext.js.map +1 -1
  234. package/dist/production/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
  235. package/dist/production/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
  236. package/dist/production/src/accessorPropagation/EnvironmentContext.cjs +0 -1
  237. package/dist/production/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
  238. package/dist/production/src/accessorPropagation/EnvironmentContext.js +1 -2
  239. package/dist/production/src/accessorPropagation/EnvironmentContext.js.map +1 -1
  240. package/dist/production/src/accessorPropagation/TreeRootIdContext.cjs.map +1 -1
  241. package/dist/production/src/accessorPropagation/TreeRootIdContext.js.map +1 -1
  242. package/dist/production/src/accessorPropagation/TreeRootIdProvider.cjs.map +1 -1
  243. package/dist/production/src/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  244. package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.cjs.map +1 -1
  245. package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
  246. package/dist/production/src/accessorPropagation/useBindingOperations.cjs.map +1 -1
  247. package/dist/production/src/accessorPropagation/useBindingOperations.js.map +1 -1
  248. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.cjs +1 -2
  249. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
  250. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.js +1 -2
  251. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
  252. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs +1 -2
  253. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
  254. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.js +1 -2
  255. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
  256. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.cjs +1 -2
  257. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
  258. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.js +1 -2
  259. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
  260. package/dist/production/src/accessorPropagation/useEntity.cjs.map +1 -1
  261. package/dist/production/src/accessorPropagation/useEntity.js.map +1 -1
  262. package/dist/production/src/accessorPropagation/useEntityKey.cjs.map +1 -1
  263. package/dist/production/src/accessorPropagation/useEntityKey.js.map +1 -1
  264. package/dist/production/src/accessorPropagation/useEntityList.cjs.map +1 -1
  265. package/dist/production/src/accessorPropagation/useEntityList.js.map +1 -1
  266. package/dist/production/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
  267. package/dist/production/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
  268. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs +1 -1
  269. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
  270. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js +1 -1
  271. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
  272. package/dist/production/src/accessorPropagation/useEntityListSubTreeParameters.cjs.map +1 -1
  273. package/dist/production/src/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
  274. package/dist/production/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
  275. package/dist/production/src/accessorPropagation/useEntitySubTree.js.map +1 -1
  276. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs +1 -1
  277. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
  278. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js +1 -1
  279. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
  280. package/dist/production/src/accessorPropagation/useEntitySubTreeParameters.cjs.map +1 -1
  281. package/dist/production/src/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
  282. package/dist/production/src/accessorPropagation/useExtendTree.cjs +1 -4
  283. package/dist/production/src/accessorPropagation/useExtendTree.cjs.map +1 -1
  284. package/dist/production/src/accessorPropagation/useExtendTree.js +1 -4
  285. package/dist/production/src/accessorPropagation/useExtendTree.js.map +1 -1
  286. package/dist/production/src/accessorPropagation/useField.cjs.map +1 -1
  287. package/dist/production/src/accessorPropagation/useField.js.map +1 -1
  288. package/dist/production/src/accessorPropagation/useGetEntityByKey.cjs.map +1 -1
  289. package/dist/production/src/accessorPropagation/useGetEntityByKey.js.map +1 -1
  290. package/dist/production/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
  291. package/dist/production/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
  292. package/dist/production/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
  293. package/dist/production/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
  294. package/dist/production/src/accessorPropagation/useHasEntity.cjs.map +1 -1
  295. package/dist/production/src/accessorPropagation/useHasEntity.js.map +1 -1
  296. package/dist/production/src/accessorPropagation/usePersist.cjs.map +1 -1
  297. package/dist/production/src/accessorPropagation/usePersist.js.map +1 -1
  298. package/dist/production/src/accessorPropagation/useTreeRootId.cjs.map +1 -1
  299. package/dist/production/src/accessorPropagation/useTreeRootId.js.map +1 -1
  300. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs +1 -1
  301. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
  302. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js +1 -1
  303. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  304. package/dist/production/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
  305. package/dist/production/src/accessorSorting/addEntityAtIndex.js.map +1 -1
  306. package/dist/production/src/accessorSorting/repairEntitiesOrder.cjs.map +1 -1
  307. package/dist/production/src/accessorSorting/repairEntitiesOrder.js.map +1 -1
  308. package/dist/production/src/accessorSorting/sortEntities.cjs.map +1 -1
  309. package/dist/production/src/accessorSorting/sortEntities.js.map +1 -1
  310. package/dist/production/src/accessorTree/AccessorTree.cjs.map +1 -1
  311. package/dist/production/src/accessorTree/AccessorTree.js.map +1 -1
  312. package/dist/production/src/accessorTree/AccessorTreeStateContext.cjs.map +1 -1
  313. package/dist/production/src/accessorTree/AccessorTreeStateContext.js.map +1 -1
  314. package/dist/production/src/accessorTree/DirtinessContext.cjs.map +1 -1
  315. package/dist/production/src/accessorTree/DirtinessContext.js.map +1 -1
  316. package/dist/production/src/accessorTree/MutationStateContext.cjs.map +1 -1
  317. package/dist/production/src/accessorTree/MutationStateContext.js.map +1 -1
  318. package/dist/production/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
  319. package/dist/production/src/accessorTree/useAccessorTreeState.js.map +1 -1
  320. package/dist/production/src/accessorTree/useDataBinding.cjs +17 -13
  321. package/dist/production/src/accessorTree/useDataBinding.cjs.map +1 -1
  322. package/dist/production/src/accessorTree/useDataBinding.js +19 -15
  323. package/dist/production/src/accessorTree/useDataBinding.js.map +1 -1
  324. package/dist/production/src/accessorTree/useDirtinessState.cjs.map +1 -1
  325. package/dist/production/src/accessorTree/useDirtinessState.js.map +1 -1
  326. package/dist/production/src/accessorTree/useEnvironmentWithSchema.cjs.map +1 -1
  327. package/dist/production/src/accessorTree/useEnvironmentWithSchema.js.map +1 -1
  328. package/dist/production/src/accessorTree/useMutationState.cjs.map +1 -1
  329. package/dist/production/src/accessorTree/useMutationState.js.map +1 -1
  330. package/dist/production/src/coreComponents/Component.cjs.map +1 -1
  331. package/dist/production/src/coreComponents/Component.js.map +1 -1
  332. package/dist/production/src/coreComponents/DataBindingProvider.cjs.map +1 -1
  333. package/dist/production/src/coreComponents/DataBindingProvider.js.map +1 -1
  334. package/dist/production/src/coreComponents/Entity.cjs.map +1 -1
  335. package/dist/production/src/coreComponents/Entity.js.map +1 -1
  336. package/dist/production/src/coreComponents/EntityList.cjs.map +1 -1
  337. package/dist/production/src/coreComponents/EntityList.js.map +1 -1
  338. package/dist/production/src/coreComponents/EntityListSubTree.cjs.map +1 -1
  339. package/dist/production/src/coreComponents/EntityListSubTree.js +1 -1
  340. package/dist/production/src/coreComponents/EntityListSubTree.js.map +1 -1
  341. package/dist/production/src/coreComponents/EntitySubTree.cjs.map +1 -1
  342. package/dist/production/src/coreComponents/EntitySubTree.js +1 -1
  343. package/dist/production/src/coreComponents/EntitySubTree.js.map +1 -1
  344. package/dist/production/src/coreComponents/Field.cjs.map +1 -1
  345. package/dist/production/src/coreComponents/Field.js +1 -1
  346. package/dist/production/src/coreComponents/Field.js.map +1 -1
  347. package/dist/production/src/coreComponents/HasMany.cjs.map +1 -1
  348. package/dist/production/src/coreComponents/HasMany.js +1 -1
  349. package/dist/production/src/coreComponents/HasMany.js.map +1 -1
  350. package/dist/production/src/coreComponents/HasOne.cjs.map +1 -1
  351. package/dist/production/src/coreComponents/HasOne.js +1 -1
  352. package/dist/production/src/coreComponents/HasOne.js.map +1 -1
  353. package/dist/production/src/coreComponents/ParentEntity.cjs.map +1 -1
  354. package/dist/production/src/coreComponents/ParentEntity.js.map +1 -1
  355. package/dist/production/src/entityEvents/useDataBindingEvent.cjs.map +1 -1
  356. package/dist/production/src/entityEvents/useDataBindingEvent.js.map +1 -1
  357. package/dist/production/src/entityEvents/useDerivedField.cjs.map +1 -1
  358. package/dist/production/src/entityEvents/useDerivedField.js.map +1 -1
  359. package/dist/production/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
  360. package/dist/production/src/entityEvents/useEntityBeforePersist.js.map +1 -1
  361. package/dist/production/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
  362. package/dist/production/src/entityEvents/useEntityBeforeUpdate.js.map +1 -1
  363. package/dist/production/src/entityEvents/useEntityEvent.cjs.map +1 -1
  364. package/dist/production/src/entityEvents/useEntityEvent.js.map +1 -1
  365. package/dist/production/src/entityEvents/useEntityPersistError.cjs.map +1 -1
  366. package/dist/production/src/entityEvents/useEntityPersistError.js.map +1 -1
  367. package/dist/production/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
  368. package/dist/production/src/entityEvents/useEntityPersistSuccess.js.map +1 -1
  369. package/dist/production/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
  370. package/dist/production/src/entityEvents/useOnConnectionUpdate.js.map +1 -1
  371. package/dist/production/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
  372. package/dist/production/src/helperComponents/DeferredSubTrees.js.map +1 -1
  373. package/dist/production/src/helperComponents/DeleteEntityTrigger.cjs.map +1 -1
  374. package/dist/production/src/helperComponents/DeleteEntityTrigger.js.map +1 -1
  375. package/dist/production/src/helperComponents/DimensionRenderer.cjs.map +1 -1
  376. package/dist/production/src/helperComponents/DimensionRenderer.js.map +1 -1
  377. package/dist/production/src/helperComponents/EntityView.cjs.map +1 -1
  378. package/dist/production/src/helperComponents/EntityView.js.map +1 -1
  379. package/dist/production/src/helperComponents/FieldView.cjs.map +1 -1
  380. package/dist/production/src/helperComponents/FieldView.js.map +1 -1
  381. package/dist/production/src/helperComponents/If.cjs +7 -10
  382. package/dist/production/src/helperComponents/If.cjs.map +1 -1
  383. package/dist/production/src/helperComponents/If.js +8 -11
  384. package/dist/production/src/helperComponents/If.js.map +1 -1
  385. package/dist/production/src/helperComponents/LabelMiddleware.cjs.map +1 -1
  386. package/dist/production/src/helperComponents/LabelMiddleware.js.map +1 -1
  387. package/dist/production/src/helperComponents/RecursionTerminator.cjs.map +1 -1
  388. package/dist/production/src/helperComponents/RecursionTerminator.js.map +1 -1
  389. package/dist/production/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -1
  390. package/dist/production/src/helperComponents/RecursionTerminatorPortal.js.map +1 -1
  391. package/dist/production/src/helperComponents/StaticRender.cjs.map +1 -1
  392. package/dist/production/src/helperComponents/StaticRender.js.map +1 -1
  393. package/dist/production/src/helperComponents/SugaredField.cjs.map +1 -1
  394. package/dist/production/src/helperComponents/SugaredField.js.map +1 -1
  395. package/dist/production/src/helperComponents/Variable.cjs.map +1 -1
  396. package/dist/production/src/helperComponents/Variable.js.map +1 -1
  397. package/dist/production/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
  398. package/dist/production/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  399. package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.cjs +4 -2
  400. package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.cjs.map +1 -1
  401. package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.js +4 -2
  402. package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
  403. package/dist/production/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
  404. package/dist/production/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
  405. package/dist/production/src/helperComponents/persist/PersistOnFieldChange.cjs.map +1 -1
  406. package/dist/production/src/helperComponents/persist/PersistOnFieldChange.js.map +1 -1
  407. package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.cjs.map +1 -1
  408. package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.js.map +1 -1
  409. package/dist/production/src/helperComponents/persist/PersistOnKey.cjs.map +1 -1
  410. package/dist/production/src/helperComponents/persist/PersistOnKey.js.map +1 -1
  411. package/dist/production/src/helperComponents/persist/PersistTrigger.cjs.map +1 -1
  412. package/dist/production/src/helperComponents/persist/PersistTrigger.js.map +1 -1
  413. package/dist/production/src/helperComponents/persist/useDecoratedPersist.cjs.map +1 -1
  414. package/dist/production/src/helperComponents/persist/useDecoratedPersist.js.map +1 -1
  415. package/dist/production/src/markers/IncrementalMarkerBuilder.cjs +47 -44
  416. package/dist/production/src/markers/IncrementalMarkerBuilder.cjs.map +1 -1
  417. package/dist/production/src/markers/IncrementalMarkerBuilder.js +47 -44
  418. package/dist/production/src/markers/IncrementalMarkerBuilder.js.map +1 -1
  419. package/dist/production/src/markers/MarkerStaticAnalyzer.cjs +19 -19
  420. package/dist/production/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
  421. package/dist/production/src/markers/MarkerStaticAnalyzer.js +19 -19
  422. package/dist/production/src/markers/MarkerStaticAnalyzer.js.map +1 -1
  423. package/dist/production/src/markers/MarkerTreeGenerator.cjs.map +1 -1
  424. package/dist/production/src/markers/MarkerTreeGenerator.js.map +1 -1
  425. package/dist/types/accessorPropagation/BindingOperationsContext.d.ts +1 -1
  426. package/dist/types/accessorPropagation/BindingOperationsContext.d.ts.map +1 -1
  427. package/dist/types/accessorPropagation/EntityKeyContext.d.ts +1 -1
  428. package/dist/types/accessorPropagation/EntityKeyContext.d.ts.map +1 -1
  429. package/dist/types/accessorPropagation/EnvironmentContext.d.ts +1 -1
  430. package/dist/types/accessorPropagation/EnvironmentContext.d.ts.map +1 -1
  431. package/dist/types/accessorPropagation/TreeRootIdContext.d.ts +1 -1
  432. package/dist/types/accessorPropagation/TreeRootIdContext.d.ts.map +1 -1
  433. package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts.map +1 -1
  434. package/dist/types/accessorPropagation/useDesugaredRelativeEntityList.d.ts.map +1 -1
  435. package/dist/types/accessorPropagation/useDesugaredRelativeSingleEntity.d.ts.map +1 -1
  436. package/dist/types/accessorPropagation/useDesugaredRelativeSingleField.d.ts.map +1 -1
  437. package/dist/types/accessorPropagation/useEntity.d.ts.map +1 -1
  438. package/dist/types/accessorPropagation/useEntityList.d.ts.map +1 -1
  439. package/dist/types/accessorPropagation/useEntityListSubTreeLoader.d.ts.map +1 -1
  440. package/dist/types/accessorPropagation/useEntitySubTreeLoader.d.ts.map +1 -1
  441. package/dist/types/accessorPropagation/useExtendTree.d.ts.map +1 -1
  442. package/dist/types/accessorPropagation/useField.d.ts.map +1 -1
  443. package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts +1 -1
  444. package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts.map +1 -1
  445. package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts +1 -1
  446. package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts.map +1 -1
  447. package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts +1 -1
  448. package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts.map +1 -1
  449. package/dist/types/accessorTree/AccessorTreeStateAction.d.ts.map +1 -1
  450. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +1 -1
  451. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +1 -1
  452. package/dist/types/accessorTree/DirtinessContext.d.ts +1 -1
  453. package/dist/types/accessorTree/DirtinessContext.d.ts.map +1 -1
  454. package/dist/types/accessorTree/MutationStateContext.d.ts +1 -1
  455. package/dist/types/accessorTree/MutationStateContext.d.ts.map +1 -1
  456. package/dist/types/accessorTree/useDataBinding.d.ts.map +1 -1
  457. package/dist/types/accessorTree/useEnvironmentWithSchema.d.ts.map +1 -1
  458. package/dist/types/coreComponents/Component.d.ts.map +1 -1
  459. package/dist/types/coreComponents/DataBindingProvider.d.ts.map +1 -1
  460. package/dist/types/coreComponents/Entity.d.ts +1 -1
  461. package/dist/types/coreComponents/Entity.d.ts.map +1 -1
  462. package/dist/types/coreComponents/EntityList.d.ts.map +1 -1
  463. package/dist/types/coreComponents/EntityListSubTree.d.ts.map +1 -1
  464. package/dist/types/coreComponents/Field.d.ts.map +1 -1
  465. package/dist/types/coreComponents/HasMany.d.ts.map +1 -1
  466. package/dist/types/coreComponents/HasOne.d.ts.map +1 -1
  467. package/dist/types/coreComponents/ParentEntity.d.ts +1 -1
  468. package/dist/types/coreComponents/ParentEntity.d.ts.map +1 -1
  469. package/dist/types/helperComponents/DeferredSubTrees.d.ts +1 -1
  470. package/dist/types/helperComponents/DeferredSubTrees.d.ts.map +1 -1
  471. package/dist/types/helperComponents/DeleteEntityTrigger.d.ts.map +1 -1
  472. package/dist/types/helperComponents/DimensionRenderer.d.ts.map +1 -1
  473. package/dist/types/helperComponents/EntityView.d.ts.map +1 -1
  474. package/dist/types/helperComponents/FieldView.d.ts +13 -2
  475. package/dist/types/helperComponents/FieldView.d.ts.map +1 -1
  476. package/dist/types/helperComponents/If.d.ts +1 -1
  477. package/dist/types/helperComponents/If.d.ts.map +1 -1
  478. package/dist/types/helperComponents/LabelMiddleware.d.ts +1 -1
  479. package/dist/types/helperComponents/LabelMiddleware.d.ts.map +1 -1
  480. package/dist/types/helperComponents/RecursionTerminator.d.ts +1 -1
  481. package/dist/types/helperComponents/RecursionTerminator.d.ts.map +1 -1
  482. package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts +1 -1
  483. package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts.map +1 -1
  484. package/dist/types/helperComponents/StaticRender.d.ts +1 -1
  485. package/dist/types/helperComponents/StaticRender.d.ts.map +1 -1
  486. package/dist/types/helperComponents/Variable.d.ts +1 -1
  487. package/dist/types/helperComponents/Variable.d.ts.map +1 -1
  488. package/dist/types/helperComponents/helpers/FilterEvaluator.d.ts.map +1 -1
  489. package/dist/types/helperComponents/helpers/FilterFieldsCollector.d.ts.map +1 -1
  490. package/dist/types/helperComponents/persist/PersistOnFieldChange.d.ts +1 -1
  491. package/dist/types/helperComponents/persist/PersistOnFieldChange.d.ts.map +1 -1
  492. package/dist/types/helperComponents/persist/PersistOnHasOneChange.d.ts +1 -1
  493. package/dist/types/helperComponents/persist/PersistOnHasOneChange.d.ts.map +1 -1
  494. package/dist/types/helperComponents/persist/PersistTrigger.d.ts.map +1 -1
  495. package/dist/types/markers/IncrementalMarkerBuilder.d.ts.map +1 -1
  496. package/dist/types/markers/MarkerProvider.d.ts.map +1 -1
  497. package/dist/types/markers/MarkerStaticAnalyzer.d.ts.map +1 -1
  498. package/dist/types/markers/MarkerTreeGenerator.d.ts.map +1 -1
  499. package/dist/types/tsconfig.tsbuildinfo +1 -1
  500. package/package.json +18 -13
  501. package/src/accessorPropagation/BindingOperationsContext.ts +3 -3
  502. package/src/accessorPropagation/EnvironmentContext.tsx +1 -1
  503. package/src/accessorPropagation/useAccessorUpdateSubscription.ts +5 -3
  504. package/src/accessorPropagation/useDesugaredRelativeEntityList.ts +2 -3
  505. package/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts +2 -3
  506. package/src/accessorPropagation/useDesugaredRelativeSingleField.ts +2 -3
  507. package/src/accessorPropagation/useEntity.ts +0 -7
  508. package/src/accessorPropagation/useEntityKey.ts +2 -2
  509. package/src/accessorPropagation/useEntityList.ts +0 -3
  510. package/src/accessorPropagation/useEntityListSubTreeLoader.ts +12 -8
  511. package/src/accessorPropagation/useEntityListSubTreeParameters.ts +0 -6
  512. package/src/accessorPropagation/useEntitySubTreeLoader.ts +12 -9
  513. package/src/accessorPropagation/useEntitySubTreeParameters.ts +0 -6
  514. package/src/accessorPropagation/useExtendTree.ts +1 -3
  515. package/src/accessorPropagation/useField.ts +0 -3
  516. package/src/accessorPropagation/useGetEntityListSubTree.ts +3 -8
  517. package/src/accessorPropagation/useGetEntitySubTree.ts +3 -8
  518. package/src/accessorSorting/SetOrderFieldOnCreate.tsx +2 -4
  519. package/src/accessorTree/AccessorTreeStateAction.ts +2 -2
  520. package/src/accessorTree/useDataBinding.ts +18 -21
  521. package/src/accessorTree/useEnvironmentWithSchema.ts +1 -2
  522. package/src/coreComponents/Component.tsx +4 -3
  523. package/src/coreComponents/DataBindingProvider.tsx +0 -1
  524. package/src/coreComponents/Entity.tsx +1 -1
  525. package/src/coreComponents/EntityList.tsx +9 -8
  526. package/src/coreComponents/EntityListSubTree.tsx +14 -12
  527. package/src/coreComponents/Field.tsx +3 -5
  528. package/src/coreComponents/HasMany.tsx +14 -12
  529. package/src/coreComponents/HasOne.tsx +1 -2
  530. package/src/coreComponents/ParentEntity.tsx +1 -2
  531. package/src/entityEvents/useDataBindingEvent.ts +1 -1
  532. package/src/entityEvents/useEntityEvent.ts +1 -1
  533. package/src/helperComponents/DeferredSubTrees.tsx +2 -2
  534. package/src/helperComponents/DeleteEntityTrigger.tsx +1 -3
  535. package/src/helperComponents/DimensionRenderer.tsx +12 -10
  536. package/src/helperComponents/EntityView.tsx +0 -1
  537. package/src/helperComponents/FieldView.tsx +33 -20
  538. package/src/helperComponents/If.tsx +16 -14
  539. package/src/helperComponents/RecursionTerminator.tsx +1 -7
  540. package/src/helperComponents/helpers/FilterEvaluator.ts +0 -3
  541. package/src/helperComponents/helpers/FilterFieldsCollector.ts +5 -6
  542. package/src/helperComponents/helpers/evaluateCondition.ts +1 -1
  543. package/src/helperComponents/persist/PersistOnFieldChange.tsx +0 -1
  544. package/src/helperComponents/persist/PersistOnHasOneChange.tsx +1 -2
  545. package/src/helperComponents/persist/PersistOnKey.tsx +2 -2
  546. package/src/helperComponents/persist/PersistTrigger.tsx +3 -1
  547. package/src/markers/IncrementalMarkerBuilder.ts +50 -45
  548. package/src/markers/MarkerProvider.ts +6 -6
  549. package/src/markers/MarkerStaticAnalyzer.ts +16 -14
  550. package/src/markers/MarkerTreeGenerator.ts +0 -2
  551. package/src/typings/react-fix.d.ts +2 -4
  552. package/tests/cases/unit/core/entityOperations.test.tsx +18 -17
  553. package/tests/cases/unit/core/eventManager.test.tsx +15 -7
  554. package/tests/cases/unit/helperComponents/evaluateCondition.spec.ts +0 -2
  555. package/tests/cases/unit/helperComponents/schema.ts +1 -2
  556. package/tests/cases/unit/model/markerTreeGenerator.spec.tsx +103 -81
  557. package/tests/lib/bindingFactory.ts +11 -1
  558. package/tests/lib/convertModelToAdminSchema.ts +109 -107
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityListSubTreeParameters.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeParameters.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useMemo } from 'react'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\n\nexport function useEntityListSubTreeParameters(alias: Alias): Alias\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityListOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList {\n\tuseConstantValueInvariant(typeof qualifiedEntityList)\n\n\tif (typeof qualifiedEntityList === 'string') {\n\t\treturn qualifiedEntityList\n\t}\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(\n\t\tqualifiedEntityList.isCreating,\n\t\t`EntityListSubTree: cannot alternate the 'isCreating' value.`,\n\t)\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(\n\t\ttypeof qualifiedEntityList.entities,\n\t\t`EntityListSubTree: cannot alternate the 'entities' value.`,\n\t)\n\n\tif (qualifiedEntityList.isCreating) {\n\t\tconst entities = qualifiedEntityList.entities\n\n\t\tif (typeof entities === 'string') {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\treturn useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\tisCreating: true,\n\t\t\t\t\tentities,\n\t\t\t\t}),\n\t\t\t\t[entities],\n\t\t\t)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tisCreating: true,\n\t\t\t\tentities: { entityName: entities.entityName },\n\t\t\t}),\n\t\t\t[entities.entityName],\n\t\t)\n\t}\n\tconst entities = qualifiedEntityList.entities\n\n\tif (typeof entities === 'string') {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tentities: entities,\n\t\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\t\toffset: qualifiedEntityList.offset,\n\t\t\t\tlimit: qualifiedEntityList.limit,\n\t\t\t}),\n\t\t\t[entities, qualifiedEntityList.limit, qualifiedEntityList.offset, qualifiedEntityList.orderBy],\n\t\t)\n\t}\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\treturn useMemo(\n\t\t() => ({\n\t\t\tentities: {\n\t\t\t\tentityName: entities.entityName,\n\t\t\t\tfilter: entities.filter,\n\t\t\t},\n\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\toffset: qualifiedEntityList.offset,\n\t\t\tlimit: qualifiedEntityList.limit,\n\t\t}),\n\t\t[\n\t\t\tentities.entityName,\n\t\t\tentities.filter,\n\t\t\tqualifiedEntityList.limit,\n\t\t\tqualifiedEntityList.offset,\n\t\t\tqualifiedEntityList.orderBy,\n\t\t],\n\t)\n}\n"],"names":["entities"],"mappings":";;AAWO,SAAS,+BACf,qBAC+E;AAC/E,4BAA0B,OAAO,mBAAmB;AAEhD,MAAA,OAAO,wBAAwB,UAAU;AACrC,WAAA;AAAA,EAAA;AAIR;AAAA,IACC,oBAAoB;AAAA,IACpB;AAAA,EACD;AAGA;AAAA,IACC,OAAO,oBAAoB;AAAA,IAC3B;AAAA,EACD;AAEA,MAAI,oBAAoB,YAAY;AACnC,UAAMA,YAAW,oBAAoB;AAEjC,QAAA,OAAOA,cAAa,UAAU;AAE1B,aAAA;AAAA,QACN,OAAO;AAAA,UACN,YAAY;AAAA,UACZ,UAAAA;AAAAA,QAAA;AAAA,QAED,CAACA,SAAQ;AAAA,MACV;AAAA,IAAA;AAGM,WAAA;AAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,UAAU,EAAE,YAAYA,UAAS,WAAW;AAAA,MAAA;AAAA,MAE7C,CAACA,UAAS,UAAU;AAAA,IACrB;AAAA,EAAA;AAED,QAAM,WAAW,oBAAoB;AAEjC,MAAA,OAAO,aAAa,UAAU;AAE1B,WAAA;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA,SAAS,oBAAoB;AAAA,QAC7B,QAAQ,oBAAoB;AAAA,QAC5B,OAAO,oBAAoB;AAAA,MAAA;AAAA,MAE5B,CAAC,UAAU,oBAAoB,OAAO,oBAAoB,QAAQ,oBAAoB,OAAO;AAAA,IAC9F;AAAA,EAAA;AAGM,SAAA;AAAA,IACN,OAAO;AAAA,MACN,UAAU;AAAA,QACT,YAAY,SAAS;AAAA,QACrB,QAAQ,SAAS;AAAA,MAClB;AAAA,MACA,SAAS,oBAAoB;AAAA,MAC7B,QAAQ,oBAAoB;AAAA,MAC5B,OAAO,oBAAoB;AAAA,IAAA;AAAA,IAE5B;AAAA,MACC,SAAS;AAAA,MACT,SAAS;AAAA,MACT,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,IAAA;AAAA,EAEtB;AACD;"}
1
+ {"version":3,"file":"useEntityListSubTreeParameters.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeParameters.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useMemo } from 'react'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\n\nexport function useEntityListSubTreeParameters(alias: Alias): Alias\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityListOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList {\n\tuseConstantValueInvariant(typeof qualifiedEntityList)\n\n\tif (typeof qualifiedEntityList === 'string') {\n\t\treturn qualifiedEntityList\n\t}\n\n\tuseConstantValueInvariant(\n\t\tqualifiedEntityList.isCreating,\n\t\t`EntityListSubTree: cannot alternate the 'isCreating' value.`,\n\t)\n\n\tuseConstantValueInvariant(\n\t\ttypeof qualifiedEntityList.entities,\n\t\t`EntityListSubTree: cannot alternate the 'entities' value.`,\n\t)\n\n\tif (qualifiedEntityList.isCreating) {\n\t\tconst entities = qualifiedEntityList.entities\n\n\t\tif (typeof entities === 'string') {\n\t\t\treturn useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\tisCreating: true,\n\t\t\t\t\tentities,\n\t\t\t\t}),\n\t\t\t\t[entities],\n\t\t\t)\n\t\t}\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tisCreating: true,\n\t\t\t\tentities: { entityName: entities.entityName },\n\t\t\t}),\n\t\t\t[entities.entityName],\n\t\t)\n\t}\n\tconst entities = qualifiedEntityList.entities\n\n\tif (typeof entities === 'string') {\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tentities: entities,\n\t\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\t\toffset: qualifiedEntityList.offset,\n\t\t\t\tlimit: qualifiedEntityList.limit,\n\t\t\t}),\n\t\t\t[entities, qualifiedEntityList.limit, qualifiedEntityList.offset, qualifiedEntityList.orderBy],\n\t\t)\n\t}\n\treturn useMemo(\n\t\t() => ({\n\t\t\tentities: {\n\t\t\t\tentityName: entities.entityName,\n\t\t\t\tfilter: entities.filter,\n\t\t\t},\n\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\toffset: qualifiedEntityList.offset,\n\t\t\tlimit: qualifiedEntityList.limit,\n\t\t}),\n\t\t[\n\t\t\tentities.entityName,\n\t\t\tentities.filter,\n\t\t\tqualifiedEntityList.limit,\n\t\t\tqualifiedEntityList.offset,\n\t\t\tqualifiedEntityList.orderBy,\n\t\t],\n\t)\n}\n"],"names":["entities"],"mappings":";;AAWO,SAAS,+BACf,qBAC+E;AAC/E,4BAA0B,OAAO,mBAAmB;AAEpD,MAAI,OAAO,wBAAwB,UAAU;AAC5C,WAAO;AAAA,EACR;AAEA;AAAA,IACC,oBAAoB;AAAA,IACpB;AAAA,EAAA;AAGD;AAAA,IACC,OAAO,oBAAoB;AAAA,IAC3B;AAAA,EAAA;AAGD,MAAI,oBAAoB,YAAY;AACnC,UAAMA,YAAW,oBAAoB;AAErC,QAAI,OAAOA,cAAa,UAAU;AACjC,aAAO;AAAA,QACN,OAAO;AAAA,UACN,YAAY;AAAA,UACZ,UAAAA;AAAAA,QAAA;AAAA,QAED,CAACA,SAAQ;AAAA,MAAA;AAAA,IAEX;AACA,WAAO;AAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,UAAU,EAAE,YAAYA,UAAS,WAAA;AAAA,MAAW;AAAA,MAE7C,CAACA,UAAS,UAAU;AAAA,IAAA;AAAA,EAEtB;AACA,QAAM,WAAW,oBAAoB;AAErC,MAAI,OAAO,aAAa,UAAU;AACjC,WAAO;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA,SAAS,oBAAoB;AAAA,QAC7B,QAAQ,oBAAoB;AAAA,QAC5B,OAAO,oBAAoB;AAAA,MAAA;AAAA,MAE5B,CAAC,UAAU,oBAAoB,OAAO,oBAAoB,QAAQ,oBAAoB,OAAO;AAAA,IAAA;AAAA,EAE/F;AACA,SAAO;AAAA,IACN,OAAO;AAAA,MACN,UAAU;AAAA,QACT,YAAY,SAAS;AAAA,QACrB,QAAQ,SAAS;AAAA,MAAA;AAAA,MAElB,SAAS,oBAAoB;AAAA,MAC7B,QAAQ,oBAAoB;AAAA,MAC5B,OAAO,oBAAoB;AAAA,IAAA;AAAA,IAE5B;AAAA,MACC,SAAS;AAAA,MACT,SAAS;AAAA,MACT,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,IAAA;AAAA,EACrB;AAEF;"}
@@ -1 +1 @@
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,oBAAoB;AACjC,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,EAC9C;AAKO,SAAAC,8BAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;;"}
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":";;;;;;AAOO,MAAM,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAaA,oBAAAA,oBAAA;AACnB,QAAM,aAAaC,2BAAAA,2BAA2B,qBAAqB;AACnE,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAAA;AAAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAM9C,SAAOC,8BAAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;;"}
@@ -1 +1 @@
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,oBAAoB;AACjC,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,EAC9C;AAKO,SAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
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":";;;;AAOO,MAAM,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAa,oBAAA;AACnB,QAAM,aAAa,2BAA2B,qBAAqB;AACnE,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAM9C,SAAO,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
@@ -13,7 +13,7 @@ const useEntitySubTreeLoader = (entity, children, state) => {
13
13
  treeRootId: void 0,
14
14
  customState: void 0
15
15
  });
16
- const currentlyLoading = React.useRef();
16
+ const currentlyLoading = React.useRef(void 0);
17
17
  const extendTree = useExtendTree.useExtendTree();
18
18
  const [reloadTrigger, setReloadTrigger] = React.useState(null);
19
19
  const memoizedEntity = reactUtils.useObjectMemo(entity ?? emptyObject);
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(entity: SugaredQualifiedSingleEntity | undefined, children: ReactNode, state?: State): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentity: SugaredQualifiedSingleEntity\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntitySubTree","useCallback"],"mappings":";;;;;;AA8DA,MAAM,cAAc,CAAC;AAEd,MAAM,yBAAyB,CAAQ,QAAkD,UAAqB,UAA4F;AAChN,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAA6C;AAAA,IACxF,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmBC,MAAAA,OAGtB;AAEH,QAAM,aAAaC,cAAAA,cAAc;AACjC,QAAM,CAAC,eAAe,gBAAgB,IAAIF,MAAAA,SAAwB,IAAI;AAChE,QAAA,iBAAiBG,WAAAA,cAAc,UAAU,WAAW;AACpD,QAAA,iBAAiB,SAAS,iBAAiB;AAEjDC,QAAAA,UAAU,MAAM;AACf,KAAC,YAAY;AACZ,UAAI,CAAC,gBAAgB;AACpB;AAAA,MAAA;AAGD,uBAAiB,UAAU;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,MACD;AAEA,wBAAkB,CAAM,OAAA;AACnB,YAAA,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AACvE,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA,OACM;AACC,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA;AAAA,MACD,CACA;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,cAAAA,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAK,MAAA;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAET,8BAAA;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QACF;AAAA,MAEF;AAGA,UAAI,eAAe;AAClB,yBAAiB,UAAU;AACT,0BAAA;AAAA,UACjB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MAAA;AAAA,IACF,GACE;AAAA,EAAA,GACD,CAAC,YAAY,gBAAgB,UAAU,OAAO,aAAa,CAAC;AAExD,SAAA;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQC,MAAAA,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAE,CAAA;AAAA,IAAA;AAAA,EAEpD;AACD;;"}
1
+ {"version":3,"file":"useEntitySubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(\n\tentity: SugaredQualifiedSingleEntity | undefined,\n\tchildren: ReactNode,\n\tstate?: State,\n): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<\n\t\t{\n\t\t\tentity: SugaredQualifiedSingleEntity\n\t\t\tstate?: State\n\t\t} | undefined\n\t>(undefined)\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t;(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntitySubTree","useCallback"],"mappings":";;;;;;AA4DA,MAAM,cAAc,CAAA;AAEb,MAAM,yBAAyB,CACrC,QACA,UACA,UAC8E;AAC9E,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAA6C;AAAA,IACxF,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmBC,MAAAA,OAKvB,MAAS;AAEX,QAAM,aAAaC,cAAAA,cAAA;AACnB,QAAM,CAAC,eAAe,gBAAgB,IAAIF,MAAAA,SAAwB,IAAI;AACtE,QAAM,iBAAiBG,WAAAA,cAAc,UAAU,WAAW;AAC1D,QAAM,iBAAiB,SAAS,iBAAiB;AAEjDC,QAAAA,UAAU,MAAM;AACd,KAAC,YAAY;AACb,UAAI,CAAC,gBAAgB;AACpB;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,MAAA;AAGD,wBAAkB,CAAA,OAAM;AACvB,YAAI,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AAC9E,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET,OAAO;AACN,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET;AAAA,MACD,CAAC;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,cAAAA,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAA,MAAK;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAE3B,8BAAkB;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UACF;AAAA,QAAA;AAAA,MACD;AAGD,UAAI,eAAe;AAClB,yBAAiB,UAAU;AAC3B,0BAAkB;AAAA,UACjB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MACF;AAAA,IACD,GAAA;AAAA,EACD,GAAG,CAAC,YAAY,gBAAgB,UAAU,OAAO,aAAa,CAAC;AAE/D,SAAO;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQC,MAAAA,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAA,CAAE;AAAA,IAAA;AAAA,EACnD;AAEF;;"}
@@ -11,7 +11,7 @@ const useEntitySubTreeLoader = (entity, children, state) => {
11
11
  treeRootId: void 0,
12
12
  customState: void 0
13
13
  });
14
- const currentlyLoading = useRef();
14
+ const currentlyLoading = useRef(void 0);
15
15
  const extendTree = useExtendTree();
16
16
  const [reloadTrigger, setReloadTrigger] = useState(null);
17
17
  const memoizedEntity = useObjectMemo(entity ?? emptyObject);
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTreeLoader.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(entity: SugaredQualifiedSingleEntity | undefined, children: ReactNode, state?: State): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentity: SugaredQualifiedSingleEntity\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":[],"mappings":";;;;AA8DA,MAAM,cAAc,CAAC;AAEd,MAAM,yBAAyB,CAAQ,QAAkD,UAAqB,UAA4F;AAChN,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAA6C;AAAA,IACxF,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmB,OAGtB;AAEH,QAAM,aAAa,cAAc;AACjC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,IAAI;AAChE,QAAA,iBAAiB,cAAc,UAAU,WAAW;AACpD,QAAA,iBAAiB,SAAS,iBAAiB;AAEjD,YAAU,MAAM;AACf,KAAC,YAAY;AACZ,UAAI,CAAC,gBAAgB;AACpB;AAAA,MAAA;AAGD,uBAAiB,UAAU;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,MACD;AAEA,wBAAkB,CAAM,OAAA;AACnB,YAAA,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AACvE,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA,OACM;AACC,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA;AAAA,MACD,CACA;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3B,cAAc,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAK,MAAA;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAET,8BAAA;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QACF;AAAA,MAEF;AAGA,UAAI,eAAe;AAClB,yBAAiB,UAAU;AACT,0BAAA;AAAA,UACjB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MAAA;AAAA,IACF,GACE;AAAA,EAAA,GACD,CAAC,YAAY,gBAAgB,UAAU,OAAO,aAAa,CAAC;AAExD,SAAA;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAE,CAAA;AAAA,IAAA;AAAA,EAEpD;AACD;"}
1
+ {"version":3,"file":"useEntitySubTreeLoader.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(\n\tentity: SugaredQualifiedSingleEntity | undefined,\n\tchildren: ReactNode,\n\tstate?: State,\n): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<\n\t\t{\n\t\t\tentity: SugaredQualifiedSingleEntity\n\t\t\tstate?: State\n\t\t} | undefined\n\t>(undefined)\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t;(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":[],"mappings":";;;;AA4DA,MAAM,cAAc,CAAA;AAEb,MAAM,yBAAyB,CACrC,QACA,UACA,UAC8E;AAC9E,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAA6C;AAAA,IACxF,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmB,OAKvB,MAAS;AAEX,QAAM,aAAa,cAAA;AACnB,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,IAAI;AACtE,QAAM,iBAAiB,cAAc,UAAU,WAAW;AAC1D,QAAM,iBAAiB,SAAS,iBAAiB;AAEjD,YAAU,MAAM;AACd,KAAC,YAAY;AACb,UAAI,CAAC,gBAAgB;AACpB;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,MAAA;AAGD,wBAAkB,CAAA,OAAM;AACvB,YAAI,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AAC9E,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET,OAAO;AACN,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET;AAAA,MACD,CAAC;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3B,cAAc,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAA,MAAK;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAE3B,8BAAkB;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UACF;AAAA,QAAA;AAAA,MACD;AAGD,UAAI,eAAe;AAClB,yBAAiB,UAAU;AAC3B,0BAAkB;AAAA,UACjB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MACF;AAAA,IACD,GAAA;AAAA,EACD,GAAG,CAAC,YAAY,gBAAgB,UAAU,OAAO,aAAa,CAAC;AAE/D,SAAO;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAA,CAAE;AAAA,IAAA;AAAA,EACnD;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTreeParameters.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeParameters.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useMemo } from 'react'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\n\nexport function useEntitySubTreeParameters(alias: Alias): Alias\nexport function useEntitySubTreeParameters(\n\tqualifiedEntity: SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity\nexport function useEntitySubTreeParameters(\n\tqualifiedSingleEntityOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity\nexport function useEntitySubTreeParameters(\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity {\n\tuseConstantValueInvariant(typeof qualifiedSingleEntity)\n\n\tif (typeof qualifiedSingleEntity === 'string') {\n\t\treturn qualifiedSingleEntity\n\t}\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(qualifiedSingleEntity.isCreating, `EntitySubTree: cannot alternate the 'isCreating' value.`)\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(typeof qualifiedSingleEntity.entity, `EntitySubTree: cannot alternate the 'entity' value.`)\n\n\tif (qualifiedSingleEntity.isCreating) {\n\t\tconst entity = qualifiedSingleEntity.entity\n\n\t\tif (typeof entity === 'string') {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\treturn useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\tisCreating: true,\n\t\t\t\t\tentity: entity,\n\t\t\t\t}),\n\t\t\t\t[entity],\n\t\t\t)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tisCreating: true,\n\t\t\t\tentity: { entityName: entity.entityName },\n\t\t\t}),\n\t\t\t[entity.entityName],\n\t\t)\n\t}\n\n\tconst entity = qualifiedSingleEntity.entity\n\n\tif (typeof entity === 'string') {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(() => ({ entity: entity }), [entity])\n\t}\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\treturn useMemo(\n\t\t() => ({\n\t\t\tentity: {\n\t\t\t\tentityName: entity.entityName,\n\t\t\t\tfilter: entity.filter,\n\t\t\t\twhere: entity.where,\n\t\t\t},\n\t\t}),\n\t\t[entity.entityName, entity.filter, entity.where],\n\t)\n}\n"],"names":["useConstantValueInvariant","entity","useMemo"],"mappings":";;;;AAWO,SAAS,2BACf,uBACmF;AACnFA,aAAA,0BAA0B,OAAO,qBAAqB;AAElD,MAAA,OAAO,0BAA0B,UAAU;AACvC,WAAA;AAAA,EAAA;AAGkBA,aAAAA,0BAAA,sBAAsB,YAAY,yDAAyD;AAG3FA,aAAAA,0BAAA,OAAO,sBAAsB,QAAQ,qDAAqD;AAEpH,MAAI,sBAAsB,YAAY;AACrC,UAAMC,UAAS,sBAAsB;AAEjC,QAAA,OAAOA,YAAW,UAAU;AAExB,aAAAC,MAAA;AAAA,QACN,OAAO;AAAA,UACN,YAAY;AAAA,UACZ,QAAQD;AAAAA,QAAA;AAAA,QAET,CAACA,OAAM;AAAA,MACR;AAAA,IAAA;AAGM,WAAAC,MAAA;AAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,QAAQ,EAAE,YAAYD,QAAO,WAAW;AAAA,MAAA;AAAA,MAEzC,CAACA,QAAO,UAAU;AAAA,IACnB;AAAA,EAAA;AAGD,QAAM,SAAS,sBAAsB;AAEjC,MAAA,OAAO,WAAW,UAAU;AAE/B,WAAOC,MAAAA,QAAQ,OAAO,EAAE,OAAmB,IAAA,CAAC,MAAM,CAAC;AAAA,EAAA;AAG7C,SAAAA,MAAA;AAAA,IACN,OAAO;AAAA,MACN,QAAQ;AAAA,QACP,YAAY,OAAO;AAAA,QACnB,QAAQ,OAAO;AAAA,QACf,OAAO,OAAO;AAAA,MAAA;AAAA,IACf;AAAA,IAED,CAAC,OAAO,YAAY,OAAO,QAAQ,OAAO,KAAK;AAAA,EAChD;AACD;;"}
1
+ {"version":3,"file":"useEntitySubTreeParameters.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeParameters.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useMemo } from 'react'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\n\nexport function useEntitySubTreeParameters(alias: Alias): Alias\nexport function useEntitySubTreeParameters(\n\tqualifiedEntity: SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity\nexport function useEntitySubTreeParameters(\n\tqualifiedSingleEntityOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity\nexport function useEntitySubTreeParameters(\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity {\n\tuseConstantValueInvariant(typeof qualifiedSingleEntity)\n\n\tif (typeof qualifiedSingleEntity === 'string') {\n\t\treturn qualifiedSingleEntity\n\t}\n\tuseConstantValueInvariant(qualifiedSingleEntity.isCreating, `EntitySubTree: cannot alternate the 'isCreating' value.`)\n\n\tuseConstantValueInvariant(typeof qualifiedSingleEntity.entity, `EntitySubTree: cannot alternate the 'entity' value.`)\n\n\tif (qualifiedSingleEntity.isCreating) {\n\t\tconst entity = qualifiedSingleEntity.entity\n\n\t\tif (typeof entity === 'string') {\n\t\t\treturn useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\tisCreating: true,\n\t\t\t\t\tentity: entity,\n\t\t\t\t}),\n\t\t\t\t[entity],\n\t\t\t)\n\t\t}\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tisCreating: true,\n\t\t\t\tentity: { entityName: entity.entityName },\n\t\t\t}),\n\t\t\t[entity.entityName],\n\t\t)\n\t}\n\n\tconst entity = qualifiedSingleEntity.entity\n\n\tif (typeof entity === 'string') {\n\t\treturn useMemo(() => ({ entity: entity }), [entity])\n\t}\n\treturn useMemo(\n\t\t() => ({\n\t\t\tentity: {\n\t\t\t\tentityName: entity.entityName,\n\t\t\t\tfilter: entity.filter,\n\t\t\t\twhere: entity.where,\n\t\t\t},\n\t\t}),\n\t\t[entity.entityName, entity.filter, entity.where],\n\t)\n}\n"],"names":["useConstantValueInvariant","entity","useMemo"],"mappings":";;;;AAWO,SAAS,2BACf,uBACmF;AACnFA,aAAAA,0BAA0B,OAAO,qBAAqB;AAEtD,MAAI,OAAO,0BAA0B,UAAU;AAC9C,WAAO;AAAA,EACR;AACAA,aAAAA,0BAA0B,sBAAsB,YAAY,yDAAyD;AAErHA,aAAAA,0BAA0B,OAAO,sBAAsB,QAAQ,qDAAqD;AAEpH,MAAI,sBAAsB,YAAY;AACrC,UAAMC,UAAS,sBAAsB;AAErC,QAAI,OAAOA,YAAW,UAAU;AAC/B,aAAOC,MAAAA;AAAAA,QACN,OAAO;AAAA,UACN,YAAY;AAAA,UACZ,QAAQD;AAAAA,QAAA;AAAA,QAET,CAACA,OAAM;AAAA,MAAA;AAAA,IAET;AACA,WAAOC,MAAAA;AAAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,QAAQ,EAAE,YAAYD,QAAO,WAAA;AAAA,MAAW;AAAA,MAEzC,CAACA,QAAO,UAAU;AAAA,IAAA;AAAA,EAEpB;AAEA,QAAM,SAAS,sBAAsB;AAErC,MAAI,OAAO,WAAW,UAAU;AAC/B,WAAOC,MAAAA,QAAQ,OAAO,EAAE,WAAmB,CAAC,MAAM,CAAC;AAAA,EACpD;AACA,SAAOA,MAAAA;AAAAA,IACN,OAAO;AAAA,MACN,QAAQ;AAAA,QACP,YAAY,OAAO;AAAA,QACnB,QAAQ,OAAO;AAAA,QACf,OAAO,OAAO;AAAA,MAAA;AAAA,IACf;AAAA,IAED,CAAC,OAAO,YAAY,OAAO,QAAQ,OAAO,KAAK;AAAA,EAAA;AAEjD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTreeParameters.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeParameters.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useMemo } from 'react'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\n\nexport function useEntitySubTreeParameters(alias: Alias): Alias\nexport function useEntitySubTreeParameters(\n\tqualifiedEntity: SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity\nexport function useEntitySubTreeParameters(\n\tqualifiedSingleEntityOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity\nexport function useEntitySubTreeParameters(\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity {\n\tuseConstantValueInvariant(typeof qualifiedSingleEntity)\n\n\tif (typeof qualifiedSingleEntity === 'string') {\n\t\treturn qualifiedSingleEntity\n\t}\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(qualifiedSingleEntity.isCreating, `EntitySubTree: cannot alternate the 'isCreating' value.`)\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(typeof qualifiedSingleEntity.entity, `EntitySubTree: cannot alternate the 'entity' value.`)\n\n\tif (qualifiedSingleEntity.isCreating) {\n\t\tconst entity = qualifiedSingleEntity.entity\n\n\t\tif (typeof entity === 'string') {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\treturn useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\tisCreating: true,\n\t\t\t\t\tentity: entity,\n\t\t\t\t}),\n\t\t\t\t[entity],\n\t\t\t)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tisCreating: true,\n\t\t\t\tentity: { entityName: entity.entityName },\n\t\t\t}),\n\t\t\t[entity.entityName],\n\t\t)\n\t}\n\n\tconst entity = qualifiedSingleEntity.entity\n\n\tif (typeof entity === 'string') {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(() => ({ entity: entity }), [entity])\n\t}\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\treturn useMemo(\n\t\t() => ({\n\t\t\tentity: {\n\t\t\t\tentityName: entity.entityName,\n\t\t\t\tfilter: entity.filter,\n\t\t\t\twhere: entity.where,\n\t\t\t},\n\t\t}),\n\t\t[entity.entityName, entity.filter, entity.where],\n\t)\n}\n"],"names":["entity"],"mappings":";;AAWO,SAAS,2BACf,uBACmF;AACnF,4BAA0B,OAAO,qBAAqB;AAElD,MAAA,OAAO,0BAA0B,UAAU;AACvC,WAAA;AAAA,EAAA;AAGkB,4BAAA,sBAAsB,YAAY,yDAAyD;AAG3F,4BAAA,OAAO,sBAAsB,QAAQ,qDAAqD;AAEpH,MAAI,sBAAsB,YAAY;AACrC,UAAMA,UAAS,sBAAsB;AAEjC,QAAA,OAAOA,YAAW,UAAU;AAExB,aAAA;AAAA,QACN,OAAO;AAAA,UACN,YAAY;AAAA,UACZ,QAAQA;AAAAA,QAAA;AAAA,QAET,CAACA,OAAM;AAAA,MACR;AAAA,IAAA;AAGM,WAAA;AAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,QAAQ,EAAE,YAAYA,QAAO,WAAW;AAAA,MAAA;AAAA,MAEzC,CAACA,QAAO,UAAU;AAAA,IACnB;AAAA,EAAA;AAGD,QAAM,SAAS,sBAAsB;AAEjC,MAAA,OAAO,WAAW,UAAU;AAE/B,WAAO,QAAQ,OAAO,EAAE,OAAmB,IAAA,CAAC,MAAM,CAAC;AAAA,EAAA;AAG7C,SAAA;AAAA,IACN,OAAO;AAAA,MACN,QAAQ;AAAA,QACP,YAAY,OAAO;AAAA,QACnB,QAAQ,OAAO;AAAA,QACf,OAAO,OAAO;AAAA,MAAA;AAAA,IACf;AAAA,IAED,CAAC,OAAO,YAAY,OAAO,QAAQ,OAAO,KAAK;AAAA,EAChD;AACD;"}
1
+ {"version":3,"file":"useEntitySubTreeParameters.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeParameters.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useMemo } from 'react'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\n\nexport function useEntitySubTreeParameters(alias: Alias): Alias\nexport function useEntitySubTreeParameters(\n\tqualifiedEntity: SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity\nexport function useEntitySubTreeParameters(\n\tqualifiedSingleEntityOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity\nexport function useEntitySubTreeParameters(\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n): Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity {\n\tuseConstantValueInvariant(typeof qualifiedSingleEntity)\n\n\tif (typeof qualifiedSingleEntity === 'string') {\n\t\treturn qualifiedSingleEntity\n\t}\n\tuseConstantValueInvariant(qualifiedSingleEntity.isCreating, `EntitySubTree: cannot alternate the 'isCreating' value.`)\n\n\tuseConstantValueInvariant(typeof qualifiedSingleEntity.entity, `EntitySubTree: cannot alternate the 'entity' value.`)\n\n\tif (qualifiedSingleEntity.isCreating) {\n\t\tconst entity = qualifiedSingleEntity.entity\n\n\t\tif (typeof entity === 'string') {\n\t\t\treturn useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\tisCreating: true,\n\t\t\t\t\tentity: entity,\n\t\t\t\t}),\n\t\t\t\t[entity],\n\t\t\t)\n\t\t}\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tisCreating: true,\n\t\t\t\tentity: { entityName: entity.entityName },\n\t\t\t}),\n\t\t\t[entity.entityName],\n\t\t)\n\t}\n\n\tconst entity = qualifiedSingleEntity.entity\n\n\tif (typeof entity === 'string') {\n\t\treturn useMemo(() => ({ entity: entity }), [entity])\n\t}\n\treturn useMemo(\n\t\t() => ({\n\t\t\tentity: {\n\t\t\t\tentityName: entity.entityName,\n\t\t\t\tfilter: entity.filter,\n\t\t\t\twhere: entity.where,\n\t\t\t},\n\t\t}),\n\t\t[entity.entityName, entity.filter, entity.where],\n\t)\n}\n"],"names":["entity"],"mappings":";;AAWO,SAAS,2BACf,uBACmF;AACnF,4BAA0B,OAAO,qBAAqB;AAEtD,MAAI,OAAO,0BAA0B,UAAU;AAC9C,WAAO;AAAA,EACR;AACA,4BAA0B,sBAAsB,YAAY,yDAAyD;AAErH,4BAA0B,OAAO,sBAAsB,QAAQ,qDAAqD;AAEpH,MAAI,sBAAsB,YAAY;AACrC,UAAMA,UAAS,sBAAsB;AAErC,QAAI,OAAOA,YAAW,UAAU;AAC/B,aAAO;AAAA,QACN,OAAO;AAAA,UACN,YAAY;AAAA,UACZ,QAAQA;AAAAA,QAAA;AAAA,QAET,CAACA,OAAM;AAAA,MAAA;AAAA,IAET;AACA,WAAO;AAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,QAAQ,EAAE,YAAYA,QAAO,WAAA;AAAA,MAAW;AAAA,MAEzC,CAACA,QAAO,UAAU;AAAA,IAAA;AAAA,EAEpB;AAEA,QAAM,SAAS,sBAAsB;AAErC,MAAI,OAAO,WAAW,UAAU;AAC/B,WAAO,QAAQ,OAAO,EAAE,WAAmB,CAAC,MAAM,CAAC;AAAA,EACpD;AACA,SAAO;AAAA,IACN,OAAO;AAAA,MACN,QAAQ;AAAA,QACP,YAAY,OAAO;AAAA,QACnB,QAAQ,OAAO;AAAA,QACf,OAAO,OAAO;AAAA,MAAA;AAAA,IACf;AAAA,IAED,CAAC,OAAO,YAAY,OAAO,QAAQ,OAAO,KAAK;AAAA,EAAA;AAEjD;"}
@@ -12,10 +12,7 @@ const useExtendTree = () => {
12
12
  const environment = useEnvironment.useEnvironment();
13
13
  return React.useCallback(async (newFragment, options) => {
14
14
  try {
15
- const newTreeRootId = await extendTree(
16
- newFragment,
17
- { environment, ...options, signal: abort() }
18
- );
15
+ const newTreeRootId = await extendTree(newFragment, { environment, ...options, signal: abort() });
19
16
  if (!isMountedRef.current) {
20
17
  return;
21
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useExtendTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useExtendTree.ts"],"sourcesContent":["import { ReactNode, useCallback } from 'react'\nimport { useAbortController, useIsMounted } from '@contember/react-utils'\nimport { useBindingOperations } from './useBindingOperations'\nimport { TreeRootId } from '@contember/binding'\nimport { ExtendTreeOptions } from '@contember/binding'\nimport { DataBindingExtendAborted } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\nexport const useExtendTree = () => {\n\tconst abort = useAbortController()\n\tconst { extendTree } = useBindingOperations()\n\tconst isMountedRef = useIsMounted()\n\tconst environment = useEnvironment()\n\treturn useCallback(async (newFragment: ReactNode, options?: Omit<ExtendTreeOptions, 'signal'>): Promise<TreeRootId | undefined> => {\n\t\ttry {\n\t\t\tconst newTreeRootId = await extendTree(newFragment,\n\t\t\t\t{ environment, ...options, signal: abort() },\n\t\t\t)\n\t\t\tif (!isMountedRef.current) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn newTreeRootId\n\t\t} catch (e) {\n\t\t\tif (e === DataBindingExtendAborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}, [abort, environment, extendTree, isMountedRef])\n}\n"],"names":["useAbortController","useBindingOperations","useIsMounted","useEnvironment","useCallback","DataBindingExtendAborted"],"mappings":";;;;;;;AAQO,MAAM,gBAAgB,MAAM;AAClC,QAAM,QAAQA,WAAAA,mBAAmB;AAC3B,QAAA,EAAE,WAAW,IAAIC,0CAAqB;AAC5C,QAAM,eAAeC,WAAAA,aAAa;AAClC,QAAM,cAAcC,eAAAA,eAAe;AAC5B,SAAAC,MAAA,YAAY,OAAO,aAAwB,YAAiF;AAC9H,QAAA;AACH,YAAM,gBAAgB,MAAM;AAAA,QAAW;AAAA,QACtC,EAAE,aAAa,GAAG,SAAS,QAAQ,MAAQ,EAAA;AAAA,MAC5C;AACI,UAAA,CAAC,aAAa,SAAS;AAC1B;AAAA,MAAA;AAEM,aAAA;AAAA,aACC,GAAG;AACX,UAAI,MAAMC,QAAAA,0BAA0B;AACnC;AAAA,MAAA;AAEK,YAAA;AAAA,IAAA;AAAA,KAEL,CAAC,OAAO,aAAa,YAAY,YAAY,CAAC;AAClD;;"}
1
+ {"version":3,"file":"useExtendTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useExtendTree.ts"],"sourcesContent":["import { ReactNode, useCallback } from 'react'\nimport { useAbortController, useIsMounted } from '@contember/react-utils'\nimport { useBindingOperations } from './useBindingOperations'\nimport { TreeRootId } from '@contember/binding'\nimport { ExtendTreeOptions } from '@contember/binding'\nimport { DataBindingExtendAborted } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\nexport const useExtendTree = () => {\n\tconst abort = useAbortController()\n\tconst { extendTree } = useBindingOperations()\n\tconst isMountedRef = useIsMounted()\n\tconst environment = useEnvironment()\n\treturn useCallback(async (newFragment: ReactNode, options?: Omit<ExtendTreeOptions, 'signal'>): Promise<TreeRootId | undefined> => {\n\t\ttry {\n\t\t\tconst newTreeRootId = await extendTree(newFragment, { environment, ...options, signal: abort() })\n\t\t\tif (!isMountedRef.current) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn newTreeRootId\n\t\t} catch (e) {\n\t\t\tif (e === DataBindingExtendAborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}, [abort, environment, extendTree, isMountedRef])\n}\n"],"names":["useAbortController","useBindingOperations","useIsMounted","useEnvironment","useCallback","DataBindingExtendAborted"],"mappings":";;;;;;;AAQO,MAAM,gBAAgB,MAAM;AAClC,QAAM,QAAQA,WAAAA,mBAAA;AACd,QAAM,EAAE,WAAA,IAAeC,0CAAA;AACvB,QAAM,eAAeC,WAAAA,aAAA;AACrB,QAAM,cAAcC,eAAAA,eAAA;AACpB,SAAOC,MAAAA,YAAY,OAAO,aAAwB,YAAiF;AAClI,QAAI;AACH,YAAM,gBAAgB,MAAM,WAAW,aAAa,EAAE,aAAa,GAAG,SAAS,QAAQ,MAAA,GAAS;AAChG,UAAI,CAAC,aAAa,SAAS;AAC1B;AAAA,MACD;AACA,aAAO;AAAA,IACR,SAAS,GAAG;AACX,UAAI,MAAMC,QAAAA,0BAA0B;AACnC;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD,GAAG,CAAC,OAAO,aAAa,YAAY,YAAY,CAAC;AAClD;;"}
@@ -10,10 +10,7 @@ const useExtendTree = () => {
10
10
  const environment = useEnvironment();
11
11
  return useCallback(async (newFragment, options) => {
12
12
  try {
13
- const newTreeRootId = await extendTree(
14
- newFragment,
15
- { environment, ...options, signal: abort() }
16
- );
13
+ const newTreeRootId = await extendTree(newFragment, { environment, ...options, signal: abort() });
17
14
  if (!isMountedRef.current) {
18
15
  return;
19
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useExtendTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useExtendTree.ts"],"sourcesContent":["import { ReactNode, useCallback } from 'react'\nimport { useAbortController, useIsMounted } from '@contember/react-utils'\nimport { useBindingOperations } from './useBindingOperations'\nimport { TreeRootId } from '@contember/binding'\nimport { ExtendTreeOptions } from '@contember/binding'\nimport { DataBindingExtendAborted } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\nexport const useExtendTree = () => {\n\tconst abort = useAbortController()\n\tconst { extendTree } = useBindingOperations()\n\tconst isMountedRef = useIsMounted()\n\tconst environment = useEnvironment()\n\treturn useCallback(async (newFragment: ReactNode, options?: Omit<ExtendTreeOptions, 'signal'>): Promise<TreeRootId | undefined> => {\n\t\ttry {\n\t\t\tconst newTreeRootId = await extendTree(newFragment,\n\t\t\t\t{ environment, ...options, signal: abort() },\n\t\t\t)\n\t\t\tif (!isMountedRef.current) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn newTreeRootId\n\t\t} catch (e) {\n\t\t\tif (e === DataBindingExtendAborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}, [abort, environment, extendTree, isMountedRef])\n}\n"],"names":[],"mappings":";;;;;AAQO,MAAM,gBAAgB,MAAM;AAClC,QAAM,QAAQ,mBAAmB;AAC3B,QAAA,EAAE,WAAW,IAAI,qBAAqB;AAC5C,QAAM,eAAe,aAAa;AAClC,QAAM,cAAc,eAAe;AAC5B,SAAA,YAAY,OAAO,aAAwB,YAAiF;AAC9H,QAAA;AACH,YAAM,gBAAgB,MAAM;AAAA,QAAW;AAAA,QACtC,EAAE,aAAa,GAAG,SAAS,QAAQ,MAAQ,EAAA;AAAA,MAC5C;AACI,UAAA,CAAC,aAAa,SAAS;AAC1B;AAAA,MAAA;AAEM,aAAA;AAAA,aACC,GAAG;AACX,UAAI,MAAM,0BAA0B;AACnC;AAAA,MAAA;AAEK,YAAA;AAAA,IAAA;AAAA,KAEL,CAAC,OAAO,aAAa,YAAY,YAAY,CAAC;AAClD;"}
1
+ {"version":3,"file":"useExtendTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useExtendTree.ts"],"sourcesContent":["import { ReactNode, useCallback } from 'react'\nimport { useAbortController, useIsMounted } from '@contember/react-utils'\nimport { useBindingOperations } from './useBindingOperations'\nimport { TreeRootId } from '@contember/binding'\nimport { ExtendTreeOptions } from '@contember/binding'\nimport { DataBindingExtendAborted } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\nexport const useExtendTree = () => {\n\tconst abort = useAbortController()\n\tconst { extendTree } = useBindingOperations()\n\tconst isMountedRef = useIsMounted()\n\tconst environment = useEnvironment()\n\treturn useCallback(async (newFragment: ReactNode, options?: Omit<ExtendTreeOptions, 'signal'>): Promise<TreeRootId | undefined> => {\n\t\ttry {\n\t\t\tconst newTreeRootId = await extendTree(newFragment, { environment, ...options, signal: abort() })\n\t\t\tif (!isMountedRef.current) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn newTreeRootId\n\t\t} catch (e) {\n\t\t\tif (e === DataBindingExtendAborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}, [abort, environment, extendTree, isMountedRef])\n}\n"],"names":[],"mappings":";;;;;AAQO,MAAM,gBAAgB,MAAM;AAClC,QAAM,QAAQ,mBAAA;AACd,QAAM,EAAE,WAAA,IAAe,qBAAA;AACvB,QAAM,eAAe,aAAA;AACrB,QAAM,cAAc,eAAA;AACpB,SAAO,YAAY,OAAO,aAAwB,YAAiF;AAClI,QAAI;AACH,YAAM,gBAAgB,MAAM,WAAW,aAAa,EAAE,aAAa,GAAG,SAAS,QAAQ,MAAA,GAAS;AAChG,UAAI,CAAC,aAAa,SAAS;AAC1B;AAAA,MACD;AACA,aAAO;AAAA,IACR,SAAS,GAAG;AACX,UAAI,MAAM,0BAA0B;AACnC;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD,GAAG,CAAC,OAAO,aAAa,YAAY,YAAY,CAAC;AAClD;"}
@@ -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.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,EACD;AAEA,QAAM,YAAYC,aAAAA,aAAa;AAC/B,QAAM,iBAAiBC,kBAAAA,kBAAkB;AACnC,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,IACD;AAEA,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,IAAA;AAGvE,WAAA;AAAA,EAAA;AAED,SAAA;AACR;;"}
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\tuseConstantLengthInvariant(\n\t\t\trelativeSingleField.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [field, { update }] = useAccessorUpdateSubscription(getField)\n\n\t\tif (relativeSingleField.hasOneRelationPath.length) {\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;AACnC,QAAM,sBAAsBA,gCAAAA,gCAAgC,0BAA0B;AACtFC,aAAAA;AAAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAYC,aAAAA,aAAA;AAClB,QAAM,iBAAiBC,kBAAAA,kBAAA;AACvB,QAAM,WAAWC,MAAAA,YAAY,MAAM;AAClC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,SAAgB,mBAAoB;AAAA,EACnD,GAAG,CAAC,WAAW,gBAAgB,mBAAmB,CAAC;AAEnD,MAAI,qBAAqB;AACxBC,eAAAA;AAAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,IAAA;AAED,UAAM,CAAC,OAAO,EAAE,QAAQ,IAAIC,8BAAAA,8BAA8B,QAAQ;AAElE,QAAI,oBAAoB,mBAAmB,QAAQ;AAClDC,4BAAAA,sBAAsB,oBAAoB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC9E;AAEA,WAAO;AAAA,EACR;AACA,SAAO;AACR;;"}
@@ -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.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,EACD;AAEA,QAAM,YAAY,aAAa;AAC/B,QAAM,iBAAiB,kBAAkB;AACnC,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,IACD;AAEA,UAAM,CAAC,OAAO,EAAE,OAAQ,CAAA,IAAI,8BAA8B,QAAQ;AAE9D,QAAA,oBAAoB,mBAAmB,QAAQ;AAElD,4BAAsB,oBAAoB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAAA;AAGvE,WAAA;AAAA,EAAA;AAED,SAAA;AACR;"}
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\tuseConstantLengthInvariant(\n\t\t\trelativeSingleField.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [field, { update }] = useAccessorUpdateSubscription(getField)\n\n\t\tif (relativeSingleField.hasOneRelationPath.length) {\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;AACnC,QAAM,sBAAsB,gCAAgC,0BAA0B;AACtF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAY,aAAA;AAClB,QAAM,iBAAiB,kBAAA;AACvB,QAAM,WAAW,YAAY,MAAM;AAClC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,SAAgB,mBAAoB;AAAA,EACnD,GAAG,CAAC,WAAW,gBAAgB,mBAAmB,CAAC;AAEnD,MAAI,qBAAqB;AACxB;AAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,IAAA;AAED,UAAM,CAAC,OAAO,EAAE,QAAQ,IAAI,8BAA8B,QAAQ;AAElE,QAAI,oBAAoB,mBAAmB,QAAQ;AAClD,4BAAsB,oBAAoB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC9E;AAEA,WAAO;AAAA,EACR;AACA,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityByKey.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts"],"sourcesContent":["import type { GetEntityByKey } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const useGetEntityByKey = (): GetEntityByKey => useBindingOperations().getEntityByKey\n"],"names":["useBindingOperations"],"mappings":";;;AAGa,MAAA,oBAAoB,MAAsBA,qBAAAA,uBAAuB;;"}
1
+ {"version":3,"file":"useGetEntityByKey.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts"],"sourcesContent":["import type { GetEntityByKey } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const useGetEntityByKey = (): GetEntityByKey => useBindingOperations().getEntityByKey\n"],"names":["useBindingOperations"],"mappings":";;;AAGO,MAAM,oBAAoB,MAAsBA,qBAAAA,uBAAuB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityByKey.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts"],"sourcesContent":["import type { GetEntityByKey } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const useGetEntityByKey = (): GetEntityByKey => useBindingOperations().getEntityByKey\n"],"names":[],"mappings":";AAGa,MAAA,oBAAoB,MAAsB,uBAAuB;"}
1
+ {"version":3,"file":"useGetEntityByKey.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts"],"sourcesContent":["import type { GetEntityByKey } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const useGetEntityByKey = (): GetEntityByKey => useBindingOperations().getEntityByKey\n"],"names":[],"mappings":";AAGO,MAAM,oBAAoB,MAAsB,uBAAuB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type {\n\tAlias,\n\tSugaredQualifiedEntityList,\n\tSugaredUnconstrainedQualifiedEntityList,\n\tTreeRootId,\n} from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntityListSubTree = (): ((\n\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityListAccessor) => {\n\tconst environment = useEnvironment()\n\tconst getEntityListSubTree = useBindingOperations().getEntityListSubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntityListSubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntityListSubTree, treeRootId],\n\t)\n}\n"],"names":["useEnvironment","useBindingOperations","useTreeRootId","useCallback"],"mappings":";;;;;;AAYO,MAAM,0BAA0B,MAGX;AAC3B,QAAM,cAAcA,eAAAA,eAAe;AAC7B,QAAA,uBAAuBC,4CAAuB;AACpD,QAAM,aAAaC,cAAAA,cAAc;AAE1B,SAAAC,MAAA;AAAA,IACN,CACC,sBACG,WACC,qBAAqB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IACtG,CAAC,aAAa,sBAAsB,UAAU;AAAA,EAC/C;AACD;;"}
1
+ {"version":3,"file":"useGetEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntityListSubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityListAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntityListSubTree = useBindingOperations().getEntityListSubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntityListSubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntityListSubTree, treeRootId],\n\t)\n}\n"],"names":["useEnvironment","useBindingOperations","useTreeRootId","useCallback"],"mappings":";;;;;;AAOO,MAAM,0BAA0B,MAGZ;AAC1B,QAAM,cAAcA,eAAAA,eAAA;AACpB,QAAM,uBAAuBC,qBAAAA,uBAAuB;AACpD,QAAM,aAAaC,cAAAA,cAAA;AAEnB,SAAOC,MAAAA;AAAAA,IACN,CACC,sBACG,WACC,qBAAqB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IACtG,CAAC,aAAa,sBAAsB,UAAU;AAAA,EAAA;AAEhD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type {\n\tAlias,\n\tSugaredQualifiedEntityList,\n\tSugaredUnconstrainedQualifiedEntityList,\n\tTreeRootId,\n} from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntityListSubTree = (): ((\n\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityListAccessor) => {\n\tconst environment = useEnvironment()\n\tconst getEntityListSubTree = useBindingOperations().getEntityListSubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntityListSubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntityListSubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAYO,MAAM,0BAA0B,MAGX;AAC3B,QAAM,cAAc,eAAe;AAC7B,QAAA,uBAAuB,uBAAuB;AACpD,QAAM,aAAa,cAAc;AAE1B,SAAA;AAAA,IACN,CACC,sBACG,WACC,qBAAqB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IACtG,CAAC,aAAa,sBAAsB,UAAU;AAAA,EAC/C;AACD;"}
1
+ {"version":3,"file":"useGetEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntityListSubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityListAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntityListSubTree = useBindingOperations().getEntityListSubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntityListSubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntityListSubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,0BAA0B,MAGZ;AAC1B,QAAM,cAAc,eAAA;AACpB,QAAM,uBAAuB,uBAAuB;AACpD,QAAM,aAAa,cAAA;AAEnB,SAAO;AAAA,IACN,CACC,sBACG,WACC,qBAAqB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IACtG,CAAC,aAAa,sBAAsB,UAAU;AAAA,EAAA;AAEhD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntitySubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport type {\n\tAlias,\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntitySubTree = (): ((\n\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityAccessor) => {\n\tconst environment = useEnvironment()\n\tconst getEntitySubTree = useBindingOperations().getEntitySubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntitySubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntitySubTree, treeRootId],\n\t)\n}\n"],"names":["useEnvironment","useBindingOperations","useTreeRootId","useCallback"],"mappings":";;;;;;AAYO,MAAM,sBAAsB,MAGX;AACvB,QAAM,cAAcA,eAAAA,eAAe;AAC7B,QAAA,mBAAmBC,4CAAuB;AAChD,QAAM,aAAaC,cAAAA,cAAc;AAE1B,SAAAC,MAAA;AAAA,IACN,CACC,sBACG,WACC,iBAAiB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IAClG,CAAC,aAAa,kBAAkB,UAAU;AAAA,EAC3C;AACD;;"}
1
+ {"version":3,"file":"useGetEntitySubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntitySubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntitySubTree = useBindingOperations().getEntitySubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntitySubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntitySubTree, treeRootId],\n\t)\n}\n"],"names":["useEnvironment","useBindingOperations","useTreeRootId","useCallback"],"mappings":";;;;;;AAOO,MAAM,sBAAsB,MAGZ;AACtB,QAAM,cAAcA,eAAAA,eAAA;AACpB,QAAM,mBAAmBC,qBAAAA,uBAAuB;AAChD,QAAM,aAAaC,cAAAA,cAAA;AAEnB,SAAOC,MAAAA;AAAAA,IACN,CACC,sBACG,WACC,iBAAiB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IAClG,CAAC,aAAa,kBAAkB,UAAU;AAAA,EAAA;AAE5C;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntitySubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport type {\n\tAlias,\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntitySubTree = (): ((\n\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityAccessor) => {\n\tconst environment = useEnvironment()\n\tconst getEntitySubTree = useBindingOperations().getEntitySubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntitySubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntitySubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAYO,MAAM,sBAAsB,MAGX;AACvB,QAAM,cAAc,eAAe;AAC7B,QAAA,mBAAmB,uBAAuB;AAChD,QAAM,aAAa,cAAc;AAE1B,SAAA;AAAA,IACN,CACC,sBACG,WACC,iBAAiB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IAClG,CAAC,aAAa,kBAAkB,UAAU;AAAA,EAC3C;AACD;"}
1
+ {"version":3,"file":"useGetEntitySubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntitySubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntitySubTree = useBindingOperations().getEntitySubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntitySubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntitySubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,sBAAsB,MAGZ;AACtB,QAAM,cAAc,eAAA;AACpB,QAAM,mBAAmB,uBAAuB;AAChD,QAAM,aAAa,cAAA;AAEnB,SAAO;AAAA,IACN,CACC,sBACG,WACC,iBAAiB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IAClG,CAAC,aAAa,kBAAkB,UAAU;AAAA,EAAA;AAE5C;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useHasEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useHasEntity.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useHasEntity = (): boolean => {\n\treturn useContext(EntityKeyContext) !== undefined\n}\n"],"names":["useContext","EntityKeyContext"],"mappings":";;;;AAGO,MAAM,eAAe,MAAe;AACnC,SAAAA,MAAA,WAAWC,iCAAgB,MAAM;AACzC;;"}
1
+ {"version":3,"file":"useHasEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useHasEntity.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useHasEntity = (): boolean => {\n\treturn useContext(EntityKeyContext) !== undefined\n}\n"],"names":["useContext","EntityKeyContext"],"mappings":";;;;AAGO,MAAM,eAAe,MAAe;AAC1C,SAAOA,MAAAA,WAAWC,iBAAAA,gBAAgB,MAAM;AACzC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useHasEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useHasEntity.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useHasEntity = (): boolean => {\n\treturn useContext(EntityKeyContext) !== undefined\n}\n"],"names":[],"mappings":";;AAGO,MAAM,eAAe,MAAe;AACnC,SAAA,WAAW,gBAAgB,MAAM;AACzC;"}
1
+ {"version":3,"file":"useHasEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useHasEntity.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useHasEntity = (): boolean => {\n\treturn useContext(EntityKeyContext) !== undefined\n}\n"],"names":[],"mappings":";;AAGO,MAAM,eAAe,MAAe;AAC1C,SAAO,WAAW,gBAAgB,MAAM;AACzC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePersist.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/usePersist.ts"],"sourcesContent":["import type { Persist } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const usePersist = (): Persist => useBindingOperations().persist\n"],"names":["useBindingOperations"],"mappings":";;;AAGa,MAAA,aAAa,MAAeA,qBAAAA,uBAAuB;;"}
1
+ {"version":3,"file":"usePersist.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/usePersist.ts"],"sourcesContent":["import type { Persist } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const usePersist = (): Persist => useBindingOperations().persist\n"],"names":["useBindingOperations"],"mappings":";;;AAGO,MAAM,aAAa,MAAeA,qBAAAA,uBAAuB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePersist.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/usePersist.ts"],"sourcesContent":["import type { Persist } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const usePersist = (): Persist => useBindingOperations().persist\n"],"names":[],"mappings":";AAGa,MAAA,aAAa,MAAe,uBAAuB;"}
1
+ {"version":3,"file":"usePersist.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/usePersist.ts"],"sourcesContent":["import type { Persist } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const usePersist = (): Persist => useBindingOperations().persist\n"],"names":[],"mappings":";AAGO,MAAM,aAAa,MAAe,uBAAuB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTreeRootId.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useTreeRootId.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport const useTreeRootId = (): TreeRootId | undefined => useContext(TreeRootIdContext)\n"],"names":["useContext","TreeRootIdContext"],"mappings":";;;;AAIa,MAAA,gBAAgB,MAA8BA,MAAAA,WAAWC,kBAAiB,iBAAA;;"}
1
+ {"version":3,"file":"useTreeRootId.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useTreeRootId.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport const useTreeRootId = (): TreeRootId | undefined => useContext(TreeRootIdContext)\n"],"names":["useContext","TreeRootIdContext"],"mappings":";;;;AAIO,MAAM,gBAAgB,MAA8BA,MAAAA,WAAWC,kBAAAA,iBAAiB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTreeRootId.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useTreeRootId.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport const useTreeRootId = (): TreeRootId | undefined => useContext(TreeRootIdContext)\n"],"names":[],"mappings":";;AAIa,MAAA,gBAAgB,MAA8B,WAAW,iBAAiB;"}
1
+ {"version":3,"file":"useTreeRootId.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useTreeRootId.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport const useTreeRootId = (): TreeRootId | undefined => useContext(TreeRootIdContext)\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB,MAA8B,WAAW,iBAAiB;"}
@@ -43,7 +43,7 @@ const SetOrderFieldOnCreate = Component.Component(
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",
46
- lineNumber: 60,
46
+ lineNumber: 58,
47
47
  columnNumber: 7
48
48
  }, void 0)
49
49
  },
@@ -51,30 +51,30 @@ const SetOrderFieldOnCreate = Component.Component(
51
51
  false,
52
52
  {
53
53
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
54
- lineNumber: 48,
54
+ lineNumber: 46,
55
55
  columnNumber: 6
56
56
  },
57
57
  void 0
58
58
  ),
59
59
  /* @__PURE__ */ jsxDevRuntime.jsxDEV(EntityListSubTree.EntityListSubTree, { ...qel, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(SugaredField.SugaredField, { field: orderField }, void 0, false, {
60
60
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
61
- lineNumber: 63,
61
+ lineNumber: 61,
62
62
  columnNumber: 7
63
63
  }, void 0) }, void 0, false, {
64
64
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
65
- lineNumber: 62,
65
+ lineNumber: 60,
66
66
  columnNumber: 6
67
67
  }, void 0)
68
68
  ] }, void 0, true, {
69
69
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
70
- lineNumber: 47,
70
+ lineNumber: 45,
71
71
  columnNumber: 5
72
72
  }, void 0);
73
73
  }
74
74
  return /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: [
75
75
  /* @__PURE__ */ jsxDevRuntime.jsxDEV(Field.Field, { field: desugaredOrderField, defaultValue: newOrderFieldValue, isNonbearing: true }, void 0, false, {
76
76
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
77
- lineNumber: 70,
77
+ lineNumber: 68,
78
78
  columnNumber: 5
79
79
  }, void 0),
80
80
  /* @__PURE__ */ jsxDevRuntime.jsxDEV(
@@ -84,7 +84,7 @@ const SetOrderFieldOnCreate = Component.Component(
84
84
  expectedMutation: "anyMutation",
85
85
  orderBy: getOrderBy("asc"),
86
86
  onBeforePersist: (getAccessor, bindingOperations) => {
87
- let newEntityKey = void 0;
87
+ let newEntityKey;
88
88
  addEntityAtIndex.addEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, (getNewEntity) => {
89
89
  newEntityKey = getNewEntity().key;
90
90
  });
@@ -92,7 +92,7 @@ const SetOrderFieldOnCreate = Component.Component(
92
92
  },
93
93
  children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(SugaredField.SugaredField, { field: orderField }, void 0, false, {
94
94
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
95
- lineNumber: 85,
95
+ lineNumber: 83,
96
96
  columnNumber: 6
97
97
  }, void 0)
98
98
  },
@@ -100,14 +100,14 @@ const SetOrderFieldOnCreate = Component.Component(
100
100
  false,
101
101
  {
102
102
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
103
- lineNumber: 71,
103
+ lineNumber: 69,
104
104
  columnNumber: 5
105
105
  },
106
106
  void 0
107
107
  )
108
108
  ] }, void 0, true, {
109
109
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
110
- lineNumber: 69,
110
+ lineNumber: 67,
111
111
  columnNumber: 4
112
112
  }, void 0);
113
113
  },
@@ -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].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":";;;;;;;;;;AAqBO,MAAM,wBAAwBA,UAAA;AAAA,EACpC,MAAM;AAAA,EACN,CAAC,EAAE,YAAY,oBAAoB,OAAA,GAAU,gBAAgB;AAC5D,UAAM,sBAAsBC,QAAA,cAAc,2BAA2B,YAAY,WAAW;AACtF,UAAA,aAAa,CAAC,UAA0C;AAAA,MAC7D,oBAAoB,mBAClB,IAAI,CAAY,aAAA,SAAS,KAAK,EAC9B;AAAA,QACA,CAAC,aAAa,kBAAkB;AAAA,UAC/B,CAAC,YAAY,GAAG;AAAA,QAAA;AAAA,QAEjB;AAAA,UACC,CAAC,oBAAoB,KAAK,GAAG;AAAA,QAAA;AAAA,MAC9B;AAAA,IAEH;AAEA,QAAI,uBAAuB,QAAW;AACrC,YAAM,MAAkC;AAAA,QACvC,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,OAAO;AAAA,QACP,SAAS,WAAW,MAAM;AAAA,MAC3B;AACA,aAEEC,8BAAA,OAAAC,wBAAA,EAAA,UAAA;AAAA,QAAAD,8BAAA;AAAA,UAACE,cAAA;AAAA,UAAA;AAAA,YACA;AAAA,YACA,YAAU;AAAA,YACV,iBAAiB,CAAC,aAAa,sBAAsB;AAC9C,oBAAA,cAAc,kBAAkB,qBAAqB,GAAG;AACxD,oBAAA,WAAW,MAAM,KAAK,WAAW;AACvC,oBAAMC,sBAAqB,CAAC,SAAS,SAClC,KACC,SAAS,CAAC,EAAE,SAAiB,mBAAmB,EAAE,SAAS,KAAK;AACpE,0BAAc,EAAA,SAAiB,mBAAmB,EAAE,YAAYA,mBAAkB;AAAA,YACnF;AAAA,YAEA,UAAAH,8BAAAA,OAACI,aAAAA,cAAa,EAAA,OAAO,cAArB,QAAA,OAAA;AAAA,cAAA,UAAA;AAAA,cAAA,YAAA;AAAA,cAAA,cAAA;AAAA,YAAA,GAAiCC,MAAA;AAAA,UAAA;AAAA,UAZlC;AAAA,UAAA;AAAA,UAAA;AAAA,YAAA,UAAA;AAAA,YAAA,YAAA;AAAA,YAAA,cAAA;AAAA,UAAA;AAAA,UAAAA;AAAAA,QAaA;AAAA,6CACCC,kBAAAA,mBAAmB,EAAA,GAAG,KACtB,UAACN,8BAAA,OAAAI,2BAAA,EAAa,OAAO,WAArB,GAAA,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA,GAAAC,MAAiC,EADlC,GAAA,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA,GAEAA,MAAA;AAAA,MAAA,KAjBD,QAAA,MAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAkBA,GAAAA,MAAA;AAAA,IAAA;AAGF,WAEEL,8BAAA,OAAAC,wBAAA,EAAA,UAAA;AAAA,MAAAD,8BAAAA,OAACO,eAAM,OAAO,qBAAqB,cAAc,oBAAoB,cAAY,KAAjF,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAkF,GAAAF,MAAA;AAAA,MAClFL,8BAAA;AAAA,QAACM,kBAAA;AAAA,QAAA;AAAA,UACA,UAAU;AAAA,UACV,kBAAiB;AAAA,UACjB,SAAS,WAAW,KAAK;AAAA,UACzB,iBAAiB,CAAC,aAAa,sBAAsB;AAGpD,gBAAI,eAAmC;AACvCE,6BAAAA,iBAAiB,YAAY,GAAG,qBAAqB,oBAAoB,CAAgB,iBAAA;AACxF,6BAAe,eAAe;AAAA,YAAA,CAC9B;AACD,4BAAgB,kBAAkB,eAAe,YAAY,EAAE,aAAa;AAAA,UAC7E;AAAA,UAEA,UAAAR,8BAAAA,OAACI,aAAAA,cAAa,EAAA,OAAO,cAArB,QAAA,OAAA;AAAA,YAAA,UAAA;AAAA,YAAA,YAAA;AAAA,YAAA,cAAA;AAAA,UAAA,GAAiCC,MAAA;AAAA,QAAA;AAAA,QAdlC;AAAA,QAAA;AAAA,QAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA;AAAA,QAAAA;AAAAA,MAAA;AAAA,IAeA,KAjBD,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAkBA,GAAAA,MAAA;AAAA,EAEF;AAAA,EACA;AACD;;"}
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 extends SetOrderFieldOnCreateOwnProps, Pick<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\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":";;;;;;;;;;AAmBO,MAAM,wBAAwBA,UAAAA;AAAAA,EACpC,MAAM;AAAA,EACN,CAAC,EAAE,YAAY,oBAAoB,OAAA,GAAU,gBAAgB;AAC5D,UAAM,sBAAsBC,QAAAA,cAAc,2BAA2B,YAAY,WAAW;AAC5F,UAAM,aAAa,CAAC,UAA0C;AAAA,MAC7D,oBAAoB,mBAClB,IAAI,CAAA,aAAY,SAAS,KAAK,EAC9B;AAAA,QACA,CAAC,aAAa,kBAAkB;AAAA,UAC/B,CAAC,YAAY,GAAG;AAAA,QAAA;AAAA,QAEjB;AAAA,UACC,CAAC,oBAAoB,KAAK,GAAG;AAAA,QAAA;AAAA,MAC9B;AAAA,IACD;AAGF,QAAI,uBAAuB,QAAW;AACrC,YAAM,MAAkC;AAAA,QACvC,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,OAAO;AAAA,QACP,SAAS,WAAW,MAAM;AAAA,MAAA;AAE3B,aACCC,8BAAAA,OAAAC,wBAAA,EACC,UAAA;AAAA,QAAAD,8BAAAA;AAAAA,UAACE,cAAAA;AAAAA,UAAA;AAAA,YACA;AAAA,YACA,YAAU;AAAA,YACV,iBAAiB,CAAC,aAAa,sBAAsB;AACpD,oBAAM,cAAc,kBAAkB,qBAAqB,GAAG;AAC9D,oBAAM,WAAW,MAAM,KAAK,WAAW;AACvC,oBAAMC,sBAAqB,CAAC,SAAS,SAClC,KACC,SAAS,CAAC,EAAE,SAAiB,mBAAmB,EAAE,SAAS,KAAK;AACpE,0BAAA,EAAc,SAAiB,mBAAmB,EAAE,YAAYA,mBAAkB;AAAA,YACnF;AAAA,YAEA,UAAAH,8BAAAA,OAACI,2BAAA,EAAa,OAAO,WAAA,GAArB,QAAA,OAAA;AAAA,cAAA,UAAA;AAAA,cAAA,YAAA;AAAA,cAAA,cAAA;AAAA,YAAA,GAAAC,MAAiC;AAAA,UAAA;AAAA,UAZlC;AAAA,UAAA;AAAA,UAAA;AAAA,YAAA,UAAA;AAAA,YAAA,YAAA;AAAA,YAAA,cAAA;AAAA,UAAA;AAAA,UAAAA;AAAAA,QAAA;AAAA,6CAcCC,kBAAAA,mBAAA,EAAmB,GAAG,KACtB,UAAAN,8BAAAA,OAACI,aAAAA,cAAA,EAAa,OAAO,cAArB,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA,GAAAC,MAAiC,EAAA,GADlC,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA,GAAAA,MAEA;AAAA,MAAA,EAAA,GAjBD,QAAA,MAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAAAA,MAkBA;AAAA,IAEF;AACA,WACCL,8BAAAA,OAAAC,wBAAA,EACC,UAAA;AAAA,MAAAD,8BAAAA,OAACO,MAAAA,SAAM,OAAO,qBAAqB,cAAc,oBAAoB,cAAY,QAAjF,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAAAF,MAAkF;AAAA,MAClFL,8BAAAA;AAAAA,QAACM,kBAAAA;AAAAA,QAAA;AAAA,UACA,UAAU;AAAA,UACV,kBAAiB;AAAA,UACjB,SAAS,WAAW,KAAK;AAAA,UACzB,iBAAiB,CAAC,aAAa,sBAAsB;AAGpD,gBAAI;AACJE,6BAAAA,iBAAiB,YAAA,GAAe,qBAAqB,oBAAoB,CAAA,iBAAgB;AACxF,6BAAe,eAAe;AAAA,YAC/B,CAAC;AACD,4BAAgB,kBAAkB,eAAe,YAAY,EAAE,aAAA;AAAA,UAChE;AAAA,UAEA,UAAAR,8BAAAA,OAACI,2BAAA,EAAa,OAAO,WAAA,GAArB,QAAA,OAAA;AAAA,YAAA,UAAA;AAAA,YAAA,YAAA;AAAA,YAAA,cAAA;AAAA,UAAA,GAAAC,MAAiC;AAAA,QAAA;AAAA,QAdlC;AAAA,QAAA;AAAA,QAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA;AAAA,QAAAA;AAAAA,MAAA;AAAA,IAeA,EAAA,GAjBD,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAA,MAkBA;AAAA,EAEF;AAAA,EACA;AACD;;"}
@@ -41,7 +41,7 @@ const SetOrderFieldOnCreate = Component(
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",
44
- lineNumber: 60,
44
+ lineNumber: 58,
45
45
  columnNumber: 7
46
46
  }, void 0)
47
47
  },
@@ -49,30 +49,30 @@ const SetOrderFieldOnCreate = Component(
49
49
  false,
50
50
  {
51
51
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
52
- lineNumber: 48,
52
+ lineNumber: 46,
53
53
  columnNumber: 6
54
54
  },
55
55
  void 0
56
56
  ),
57
57
  /* @__PURE__ */ jsxDEV(EntityListSubTree, { ...qel, children: /* @__PURE__ */ jsxDEV(SugaredField, { field: orderField }, void 0, false, {
58
58
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
59
- lineNumber: 63,
59
+ lineNumber: 61,
60
60
  columnNumber: 7
61
61
  }, void 0) }, void 0, false, {
62
62
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
63
- lineNumber: 62,
63
+ lineNumber: 60,
64
64
  columnNumber: 6
65
65
  }, void 0)
66
66
  ] }, void 0, true, {
67
67
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
68
- lineNumber: 47,
68
+ lineNumber: 45,
69
69
  columnNumber: 5
70
70
  }, void 0);
71
71
  }
72
72
  return /* @__PURE__ */ jsxDEV(Fragment, { children: [
73
73
  /* @__PURE__ */ jsxDEV(Field, { field: desugaredOrderField, defaultValue: newOrderFieldValue, isNonbearing: true }, void 0, false, {
74
74
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
75
- lineNumber: 70,
75
+ lineNumber: 68,
76
76
  columnNumber: 5
77
77
  }, void 0),
78
78
  /* @__PURE__ */ jsxDEV(
@@ -82,7 +82,7 @@ const SetOrderFieldOnCreate = Component(
82
82
  expectedMutation: "anyMutation",
83
83
  orderBy: getOrderBy("asc"),
84
84
  onBeforePersist: (getAccessor, bindingOperations) => {
85
- let newEntityKey = void 0;
85
+ let newEntityKey;
86
86
  addEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, (getNewEntity) => {
87
87
  newEntityKey = getNewEntity().key;
88
88
  });
@@ -90,7 +90,7 @@ const SetOrderFieldOnCreate = Component(
90
90
  },
91
91
  children: /* @__PURE__ */ jsxDEV(SugaredField, { field: orderField }, void 0, false, {
92
92
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
93
- lineNumber: 85,
93
+ lineNumber: 83,
94
94
  columnNumber: 6
95
95
  }, void 0)
96
96
  },
@@ -98,14 +98,14 @@ const SetOrderFieldOnCreate = Component(
98
98
  false,
99
99
  {
100
100
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
101
- lineNumber: 71,
101
+ lineNumber: 69,
102
102
  columnNumber: 5
103
103
  },
104
104
  void 0
105
105
  )
106
106
  ] }, void 0, true, {
107
107
  fileName: "/home/runner/work/contember/contember/packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx",
108
- lineNumber: 69,
108
+ lineNumber: 67,
109
109
  columnNumber: 4
110
110
  }, void 0);
111
111
  },