@contember/react-binding 2.0.0-alpha.9 → 2.0.0-beta.1

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 (688) hide show
  1. package/dist/development/index.cjs +19 -11
  2. package/dist/development/index.cjs.map +1 -1
  3. package/dist/development/index.js +18 -10
  4. package/dist/development/index.js.map +1 -1
  5. package/dist/development/src/accessorPropagation/AccessorProvider.cjs +1 -1
  6. package/dist/development/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
  7. package/dist/development/src/accessorPropagation/AccessorProvider.js +1 -1
  8. package/dist/development/src/accessorPropagation/AccessorProvider.js.map +1 -1
  9. package/dist/development/src/accessorPropagation/BindingOperationsContext.cjs +3 -2
  10. package/dist/development/src/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
  11. package/dist/development/src/accessorPropagation/BindingOperationsContext.js +3 -2
  12. package/dist/development/src/accessorPropagation/BindingOperationsContext.js.map +1 -1
  13. package/dist/development/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
  14. package/dist/development/src/accessorPropagation/EntityKeyContext.js.map +1 -1
  15. package/dist/development/src/accessorPropagation/EntityKeyProvider.cjs +1 -1
  16. package/dist/development/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
  17. package/dist/development/src/accessorPropagation/EntityKeyProvider.js +1 -1
  18. package/dist/development/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
  19. package/dist/development/src/accessorPropagation/EnvironmentContext.cjs +13 -8
  20. package/dist/development/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
  21. package/dist/development/src/accessorPropagation/EnvironmentContext.js +14 -9
  22. package/dist/development/src/accessorPropagation/EnvironmentContext.js.map +1 -1
  23. package/dist/development/src/accessorPropagation/TreeRootIdContext.cjs.map +1 -1
  24. package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.cjs +14 -37
  25. package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.cjs.map +1 -1
  26. package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.js +15 -38
  27. package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
  28. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
  29. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
  30. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
  31. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
  32. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
  33. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
  34. package/dist/development/src/accessorPropagation/useEntity.cjs +4 -4
  35. package/dist/development/src/accessorPropagation/useEntity.cjs.map +1 -1
  36. package/dist/development/src/accessorPropagation/useEntity.js +4 -4
  37. package/dist/development/src/accessorPropagation/useEntity.js.map +1 -1
  38. package/dist/development/src/accessorPropagation/useEntityKey.cjs.map +1 -1
  39. package/dist/development/src/accessorPropagation/useEntityKey.js.map +1 -1
  40. package/dist/development/src/accessorPropagation/useEntityList.cjs +3 -3
  41. package/dist/development/src/accessorPropagation/useEntityList.cjs.map +1 -1
  42. package/dist/development/src/accessorPropagation/useEntityList.js +3 -3
  43. package/dist/development/src/accessorPropagation/useEntityList.js.map +1 -1
  44. package/dist/development/src/accessorPropagation/useEntityListSubTree.cjs +1 -1
  45. package/dist/development/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
  46. package/dist/development/src/accessorPropagation/useEntityListSubTree.js +1 -1
  47. package/dist/development/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
  48. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs +54 -15
  49. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
  50. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js +55 -16
  51. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
  52. package/dist/development/src/accessorPropagation/useEntityListSubTreeParameters.cjs.map +1 -1
  53. package/dist/development/src/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
  54. package/dist/development/src/accessorPropagation/useEntitySubTree.cjs +1 -1
  55. package/dist/development/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
  56. package/dist/development/src/accessorPropagation/useEntitySubTree.js +1 -1
  57. package/dist/development/src/accessorPropagation/useEntitySubTree.js.map +1 -1
  58. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs +54 -15
  59. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
  60. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js +55 -16
  61. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
  62. package/dist/development/src/accessorPropagation/useEntitySubTreeParameters.cjs.map +1 -1
  63. package/dist/development/src/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
  64. package/dist/development/src/accessorPropagation/useExtendTree.cjs.map +1 -1
  65. package/dist/development/src/accessorPropagation/useExtendTree.js.map +1 -1
  66. package/dist/development/src/accessorPropagation/useField.cjs +3 -3
  67. package/dist/development/src/accessorPropagation/useField.cjs.map +1 -1
  68. package/dist/development/src/accessorPropagation/useField.js +3 -3
  69. package/dist/development/src/accessorPropagation/useField.js.map +1 -1
  70. package/dist/development/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
  71. package/dist/development/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
  72. package/dist/development/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
  73. package/dist/development/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
  74. package/dist/development/src/accessorPropagation/useHasEntity.cjs.map +1 -1
  75. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs +2 -2
  76. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
  77. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js +2 -2
  78. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  79. package/dist/development/src/accessorSorting/addEntityAtIndex.cjs +1 -1
  80. package/dist/development/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
  81. package/dist/development/src/accessorSorting/addEntityAtIndex.js +1 -1
  82. package/dist/development/src/accessorSorting/addEntityAtIndex.js.map +1 -1
  83. package/dist/development/src/accessorSorting/repairEntitiesOrder.cjs +1 -1
  84. package/dist/development/src/accessorSorting/repairEntitiesOrder.cjs.map +1 -1
  85. package/dist/development/src/accessorSorting/repairEntitiesOrder.js +1 -1
  86. package/dist/development/src/accessorSorting/repairEntitiesOrder.js.map +1 -1
  87. package/dist/development/src/accessorSorting/sortEntities.cjs +2 -2
  88. package/dist/development/src/accessorSorting/sortEntities.cjs.map +1 -1
  89. package/dist/development/src/accessorSorting/sortEntities.js +2 -2
  90. package/dist/development/src/accessorSorting/sortEntities.js.map +1 -1
  91. package/dist/development/src/accessorTree/AccessorTree.cjs +16 -6
  92. package/dist/development/src/accessorTree/AccessorTree.cjs.map +1 -1
  93. package/dist/development/src/accessorTree/AccessorTree.js +16 -6
  94. package/dist/development/src/accessorTree/AccessorTree.js.map +1 -1
  95. package/dist/development/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
  96. package/dist/development/src/accessorTree/useAccessorTreeState.js.map +1 -1
  97. package/dist/development/src/accessorTree/useDataBinding.cjs +23 -36
  98. package/dist/development/src/accessorTree/useDataBinding.cjs.map +1 -1
  99. package/dist/development/src/accessorTree/useDataBinding.js +26 -39
  100. package/dist/development/src/accessorTree/useDataBinding.js.map +1 -1
  101. package/dist/development/src/accessorTree/useEnvironmentWithSchema.cjs +31 -0
  102. package/dist/development/src/accessorTree/useEnvironmentWithSchema.cjs.map +1 -0
  103. package/dist/development/src/accessorTree/useEnvironmentWithSchema.js +31 -0
  104. package/dist/development/src/accessorTree/useEnvironmentWithSchema.js.map +1 -0
  105. package/dist/development/src/coreComponents/Component.cjs.map +1 -1
  106. package/dist/development/src/coreComponents/Component.js.map +1 -1
  107. package/dist/development/src/coreComponents/DataBindingProvider.cjs +4 -14
  108. package/dist/development/src/coreComponents/DataBindingProvider.cjs.map +1 -1
  109. package/dist/development/src/coreComponents/DataBindingProvider.js +4 -14
  110. package/dist/development/src/coreComponents/DataBindingProvider.js.map +1 -1
  111. package/dist/development/src/coreComponents/Entity.cjs.map +1 -1
  112. package/dist/development/src/coreComponents/Entity.js.map +1 -1
  113. package/dist/development/src/coreComponents/EntityList.cjs.map +1 -1
  114. package/dist/development/src/coreComponents/EntityList.js.map +1 -1
  115. package/dist/development/src/coreComponents/EntityListSubTree.cjs +5 -14
  116. package/dist/development/src/coreComponents/EntityListSubTree.cjs.map +1 -1
  117. package/dist/development/src/coreComponents/EntityListSubTree.js +5 -14
  118. package/dist/development/src/coreComponents/EntityListSubTree.js.map +1 -1
  119. package/dist/development/src/coreComponents/EntitySubTree.cjs +7 -16
  120. package/dist/development/src/coreComponents/EntitySubTree.cjs.map +1 -1
  121. package/dist/development/src/coreComponents/EntitySubTree.js +7 -16
  122. package/dist/development/src/coreComponents/EntitySubTree.js.map +1 -1
  123. package/dist/development/src/coreComponents/Field.cjs +3 -4
  124. package/dist/development/src/coreComponents/Field.cjs.map +1 -1
  125. package/dist/development/src/coreComponents/Field.js +3 -4
  126. package/dist/development/src/coreComponents/Field.js.map +1 -1
  127. package/dist/development/src/coreComponents/HasMany.cjs.map +1 -1
  128. package/dist/development/src/coreComponents/HasOne.cjs.map +1 -1
  129. package/dist/development/src/coreComponents/ParentEntity.cjs.map +1 -1
  130. package/dist/development/src/entityEvents/useDataBindingEvent.cjs +15 -0
  131. package/dist/development/src/entityEvents/useDataBindingEvent.cjs.map +1 -0
  132. package/dist/development/src/entityEvents/useDataBindingEvent.js +15 -0
  133. package/dist/development/src/entityEvents/useDataBindingEvent.js.map +1 -0
  134. package/dist/development/src/entityEvents/useDerivedField.cjs +3 -3
  135. package/dist/development/src/entityEvents/useDerivedField.cjs.map +1 -1
  136. package/dist/development/src/entityEvents/useDerivedField.js +3 -3
  137. package/dist/development/src/entityEvents/useDerivedField.js.map +1 -1
  138. package/dist/development/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
  139. package/dist/development/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
  140. package/dist/development/src/entityEvents/useEntityEvent.cjs +11 -11
  141. package/dist/development/src/entityEvents/useEntityEvent.cjs.map +1 -1
  142. package/dist/development/src/entityEvents/useEntityEvent.js +11 -11
  143. package/dist/development/src/entityEvents/useEntityEvent.js.map +1 -1
  144. package/dist/development/src/entityEvents/useEntityPersistError.cjs.map +1 -1
  145. package/dist/development/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
  146. package/dist/development/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
  147. package/dist/development/src/helperComponents/DeferredSubTrees.cjs +3 -4
  148. package/dist/development/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
  149. package/dist/development/src/helperComponents/DeferredSubTrees.js +4 -5
  150. package/dist/development/src/helperComponents/DeferredSubTrees.js.map +1 -1
  151. package/dist/development/src/helperComponents/DeleteEntityTrigger.cjs +45 -0
  152. package/dist/development/src/helperComponents/DeleteEntityTrigger.cjs.map +1 -0
  153. package/dist/development/src/helperComponents/DeleteEntityTrigger.js +45 -0
  154. package/dist/development/src/helperComponents/DeleteEntityTrigger.js.map +1 -0
  155. package/dist/development/src/helperComponents/DimensionRenderer.cjs.map +1 -1
  156. package/dist/development/src/helperComponents/DimensionRenderer.js.map +1 -1
  157. package/dist/development/src/helperComponents/EntityView.cjs.map +1 -1
  158. package/dist/development/src/helperComponents/EntityView.js.map +1 -1
  159. package/dist/development/src/helperComponents/FieldView.cjs +1 -1
  160. package/dist/development/src/helperComponents/FieldView.cjs.map +1 -1
  161. package/dist/development/src/helperComponents/FieldView.js +1 -1
  162. package/dist/development/src/helperComponents/FieldView.js.map +1 -1
  163. package/dist/development/src/helperComponents/If.cjs.map +1 -1
  164. package/dist/development/src/helperComponents/If.js.map +1 -1
  165. package/dist/development/src/helperComponents/LabelMiddleware.cjs.map +1 -1
  166. package/dist/development/src/helperComponents/LabelMiddleware.js.map +1 -1
  167. package/dist/development/src/helperComponents/RecursionTerminator.cjs +55 -0
  168. package/dist/development/src/helperComponents/RecursionTerminator.cjs.map +1 -0
  169. package/dist/development/src/helperComponents/RecursionTerminator.js +55 -0
  170. package/dist/development/src/helperComponents/RecursionTerminator.js.map +1 -0
  171. package/dist/development/src/helperComponents/RecursionTerminatorPortal.cjs +36 -0
  172. package/dist/development/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -0
  173. package/dist/development/src/helperComponents/RecursionTerminatorPortal.js +36 -0
  174. package/dist/development/src/helperComponents/RecursionTerminatorPortal.js.map +1 -0
  175. package/dist/development/src/helperComponents/SugaredField.cjs.map +1 -1
  176. package/dist/development/src/helperComponents/SugaredField.js.map +1 -1
  177. package/dist/development/src/helperComponents/Variable.cjs.map +1 -1
  178. package/dist/development/src/helperComponents/Variable.js.map +1 -1
  179. package/dist/development/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
  180. package/dist/development/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  181. package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.cjs.map +1 -1
  182. package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
  183. package/dist/development/src/helperComponents/helpers/evaluateCondition.cjs +14 -21
  184. package/dist/development/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
  185. package/dist/development/src/helperComponents/helpers/evaluateCondition.js +14 -21
  186. package/dist/development/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
  187. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.cjs +28 -0
  188. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.cjs.map +1 -0
  189. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.js +28 -0
  190. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.js.map +1 -0
  191. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.cjs +35 -0
  192. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.cjs.map +1 -0
  193. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.js +35 -0
  194. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.js.map +1 -0
  195. package/dist/development/src/helperComponents/persist/PersistOnKey.cjs +30 -0
  196. package/dist/development/src/helperComponents/persist/PersistOnKey.cjs.map +1 -0
  197. package/dist/development/src/helperComponents/persist/PersistOnKey.js +30 -0
  198. package/dist/development/src/helperComponents/persist/PersistOnKey.js.map +1 -0
  199. package/dist/development/src/helperComponents/persist/PersistTrigger.cjs +37 -0
  200. package/dist/development/src/helperComponents/persist/PersistTrigger.cjs.map +1 -0
  201. package/dist/development/src/helperComponents/persist/PersistTrigger.js +37 -0
  202. package/dist/development/src/helperComponents/persist/PersistTrigger.js.map +1 -0
  203. package/dist/development/src/helperComponents/persist/useDecoratedPersist.cjs +22 -0
  204. package/dist/development/src/helperComponents/persist/useDecoratedPersist.cjs.map +1 -0
  205. package/dist/development/src/helperComponents/persist/useDecoratedPersist.js +22 -0
  206. package/dist/development/src/helperComponents/persist/useDecoratedPersist.js.map +1 -0
  207. package/dist/development/src/markers/IncrementalMarkerBuilder.cjs +56 -0
  208. package/dist/development/src/markers/IncrementalMarkerBuilder.cjs.map +1 -0
  209. package/dist/development/src/markers/IncrementalMarkerBuilder.js +56 -0
  210. package/dist/development/src/markers/IncrementalMarkerBuilder.js.map +1 -0
  211. package/dist/development/src/markers/MarkerStaticAnalyzer.cjs +117 -0
  212. package/dist/development/src/markers/MarkerStaticAnalyzer.cjs.map +1 -0
  213. package/dist/development/src/markers/MarkerStaticAnalyzer.js +117 -0
  214. package/dist/development/src/markers/MarkerStaticAnalyzer.js.map +1 -0
  215. package/dist/development/src/markers/MarkerTreeGenerator.cjs +55 -0
  216. package/dist/development/src/markers/MarkerTreeGenerator.cjs.map +1 -0
  217. package/dist/development/src/markers/MarkerTreeGenerator.js +55 -0
  218. package/dist/development/src/markers/MarkerTreeGenerator.js.map +1 -0
  219. package/dist/production/index.cjs +19 -11
  220. package/dist/production/index.cjs.map +1 -1
  221. package/dist/production/index.js +18 -10
  222. package/dist/production/index.js.map +1 -1
  223. package/dist/production/src/accessorPropagation/AccessorProvider.cjs +1 -1
  224. package/dist/production/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
  225. package/dist/production/src/accessorPropagation/AccessorProvider.js +1 -1
  226. package/dist/production/src/accessorPropagation/AccessorProvider.js.map +1 -1
  227. package/dist/production/src/accessorPropagation/BindingOperationsContext.cjs +3 -2
  228. package/dist/production/src/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
  229. package/dist/production/src/accessorPropagation/BindingOperationsContext.js +3 -2
  230. package/dist/production/src/accessorPropagation/BindingOperationsContext.js.map +1 -1
  231. package/dist/production/src/accessorPropagation/BindingOperationsProvider.cjs.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 +9 -4
  237. package/dist/production/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
  238. package/dist/production/src/accessorPropagation/EnvironmentContext.js +10 -5
  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/TreeRootIdProvider.cjs.map +1 -1
  242. package/dist/production/src/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  243. package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.cjs +14 -37
  244. package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.cjs.map +1 -1
  245. package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.js +15 -38
  246. package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
  247. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
  248. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
  249. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
  250. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
  251. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
  252. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
  253. package/dist/production/src/accessorPropagation/useEntity.cjs +4 -4
  254. package/dist/production/src/accessorPropagation/useEntity.cjs.map +1 -1
  255. package/dist/production/src/accessorPropagation/useEntity.js +4 -4
  256. package/dist/production/src/accessorPropagation/useEntity.js.map +1 -1
  257. package/dist/production/src/accessorPropagation/useEntityKey.cjs.map +1 -1
  258. package/dist/production/src/accessorPropagation/useEntityKey.js.map +1 -1
  259. package/dist/production/src/accessorPropagation/useEntityList.cjs +3 -3
  260. package/dist/production/src/accessorPropagation/useEntityList.cjs.map +1 -1
  261. package/dist/production/src/accessorPropagation/useEntityList.js +3 -3
  262. package/dist/production/src/accessorPropagation/useEntityList.js.map +1 -1
  263. package/dist/production/src/accessorPropagation/useEntityListSubTree.cjs +1 -1
  264. package/dist/production/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
  265. package/dist/production/src/accessorPropagation/useEntityListSubTree.js +1 -1
  266. package/dist/production/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
  267. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs +54 -15
  268. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
  269. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js +55 -16
  270. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
  271. package/dist/production/src/accessorPropagation/useEntityListSubTreeParameters.cjs.map +1 -1
  272. package/dist/production/src/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
  273. package/dist/production/src/accessorPropagation/useEntitySubTree.cjs +1 -1
  274. package/dist/production/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
  275. package/dist/production/src/accessorPropagation/useEntitySubTree.js +1 -1
  276. package/dist/production/src/accessorPropagation/useEntitySubTree.js.map +1 -1
  277. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs +54 -15
  278. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
  279. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js +55 -16
  280. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
  281. package/dist/production/src/accessorPropagation/useEntitySubTreeParameters.cjs.map +1 -1
  282. package/dist/production/src/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
  283. package/dist/production/src/accessorPropagation/useExtendTree.cjs.map +1 -1
  284. package/dist/production/src/accessorPropagation/useExtendTree.js.map +1 -1
  285. package/dist/production/src/accessorPropagation/useField.cjs +3 -3
  286. package/dist/production/src/accessorPropagation/useField.cjs.map +1 -1
  287. package/dist/production/src/accessorPropagation/useField.js +3 -3
  288. package/dist/production/src/accessorPropagation/useField.js.map +1 -1
  289. package/dist/production/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
  290. package/dist/production/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
  291. package/dist/production/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
  292. package/dist/production/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
  293. package/dist/production/src/accessorPropagation/useHasEntity.cjs.map +1 -1
  294. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs +2 -2
  295. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
  296. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js +2 -2
  297. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  298. package/dist/production/src/accessorSorting/addEntityAtIndex.cjs +1 -1
  299. package/dist/production/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
  300. package/dist/production/src/accessorSorting/addEntityAtIndex.js +1 -1
  301. package/dist/production/src/accessorSorting/addEntityAtIndex.js.map +1 -1
  302. package/dist/production/src/accessorSorting/repairEntitiesOrder.cjs +1 -1
  303. package/dist/production/src/accessorSorting/repairEntitiesOrder.cjs.map +1 -1
  304. package/dist/production/src/accessorSorting/repairEntitiesOrder.js +1 -1
  305. package/dist/production/src/accessorSorting/repairEntitiesOrder.js.map +1 -1
  306. package/dist/production/src/accessorSorting/sortEntities.cjs +2 -2
  307. package/dist/production/src/accessorSorting/sortEntities.cjs.map +1 -1
  308. package/dist/production/src/accessorSorting/sortEntities.js +2 -2
  309. package/dist/production/src/accessorSorting/sortEntities.js.map +1 -1
  310. package/dist/production/src/accessorTree/AccessorTree.cjs +3 -1
  311. package/dist/production/src/accessorTree/AccessorTree.cjs.map +1 -1
  312. package/dist/production/src/accessorTree/AccessorTree.js +3 -1
  313. package/dist/production/src/accessorTree/AccessorTree.js.map +1 -1
  314. package/dist/production/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
  315. package/dist/production/src/accessorTree/useAccessorTreeState.js.map +1 -1
  316. package/dist/production/src/accessorTree/useDataBinding.cjs +23 -36
  317. package/dist/production/src/accessorTree/useDataBinding.cjs.map +1 -1
  318. package/dist/production/src/accessorTree/useDataBinding.js +26 -39
  319. package/dist/production/src/accessorTree/useDataBinding.js.map +1 -1
  320. package/dist/production/src/accessorTree/useEnvironmentWithSchema.cjs +31 -0
  321. package/dist/production/src/accessorTree/useEnvironmentWithSchema.cjs.map +1 -0
  322. package/dist/production/src/accessorTree/useEnvironmentWithSchema.js +31 -0
  323. package/dist/production/src/accessorTree/useEnvironmentWithSchema.js.map +1 -0
  324. package/dist/production/src/coreComponents/Component.cjs.map +1 -1
  325. package/dist/production/src/coreComponents/Component.js.map +1 -1
  326. package/dist/production/src/coreComponents/DataBindingProvider.cjs +3 -5
  327. package/dist/production/src/coreComponents/DataBindingProvider.cjs.map +1 -1
  328. package/dist/production/src/coreComponents/DataBindingProvider.js +3 -5
  329. package/dist/production/src/coreComponents/DataBindingProvider.js.map +1 -1
  330. package/dist/production/src/coreComponents/EntityList.cjs.map +1 -1
  331. package/dist/production/src/coreComponents/EntityList.js.map +1 -1
  332. package/dist/production/src/coreComponents/EntityListSubTree.cjs +2 -11
  333. package/dist/production/src/coreComponents/EntityListSubTree.cjs.map +1 -1
  334. package/dist/production/src/coreComponents/EntityListSubTree.js +2 -11
  335. package/dist/production/src/coreComponents/EntityListSubTree.js.map +1 -1
  336. package/dist/production/src/coreComponents/EntitySubTree.cjs +2 -11
  337. package/dist/production/src/coreComponents/EntitySubTree.cjs.map +1 -1
  338. package/dist/production/src/coreComponents/EntitySubTree.js +2 -11
  339. package/dist/production/src/coreComponents/EntitySubTree.js.map +1 -1
  340. package/dist/production/src/coreComponents/Field.cjs +1 -2
  341. package/dist/production/src/coreComponents/Field.cjs.map +1 -1
  342. package/dist/production/src/coreComponents/Field.js +1 -2
  343. package/dist/production/src/coreComponents/Field.js.map +1 -1
  344. package/dist/production/src/coreComponents/HasMany.cjs.map +1 -1
  345. package/dist/production/src/coreComponents/HasMany.js.map +1 -1
  346. package/dist/production/src/coreComponents/HasOne.cjs.map +1 -1
  347. package/dist/production/src/coreComponents/HasOne.js.map +1 -1
  348. package/dist/production/src/coreComponents/ParentEntity.cjs.map +1 -1
  349. package/dist/production/src/entityEvents/useDataBindingEvent.cjs +15 -0
  350. package/dist/production/src/entityEvents/useDataBindingEvent.cjs.map +1 -0
  351. package/dist/production/src/entityEvents/useDataBindingEvent.js +15 -0
  352. package/dist/production/src/entityEvents/useDataBindingEvent.js.map +1 -0
  353. package/dist/production/src/entityEvents/useDerivedField.cjs +3 -3
  354. package/dist/production/src/entityEvents/useDerivedField.cjs.map +1 -1
  355. package/dist/production/src/entityEvents/useDerivedField.js +3 -3
  356. package/dist/production/src/entityEvents/useDerivedField.js.map +1 -1
  357. package/dist/production/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
  358. package/dist/production/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
  359. package/dist/production/src/entityEvents/useEntityEvent.cjs +11 -11
  360. package/dist/production/src/entityEvents/useEntityEvent.cjs.map +1 -1
  361. package/dist/production/src/entityEvents/useEntityEvent.js +11 -11
  362. package/dist/production/src/entityEvents/useEntityEvent.js.map +1 -1
  363. package/dist/production/src/entityEvents/useEntityPersistError.cjs.map +1 -1
  364. package/dist/production/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
  365. package/dist/production/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
  366. package/dist/production/src/helperComponents/DeferredSubTrees.cjs +3 -4
  367. package/dist/production/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
  368. package/dist/production/src/helperComponents/DeferredSubTrees.js +4 -5
  369. package/dist/production/src/helperComponents/DeferredSubTrees.js.map +1 -1
  370. package/dist/production/src/helperComponents/DeleteEntityTrigger.cjs +37 -0
  371. package/dist/production/src/helperComponents/DeleteEntityTrigger.cjs.map +1 -0
  372. package/dist/production/src/helperComponents/DeleteEntityTrigger.js +37 -0
  373. package/dist/production/src/helperComponents/DeleteEntityTrigger.js.map +1 -0
  374. package/dist/production/src/helperComponents/DimensionRenderer.cjs.map +1 -1
  375. package/dist/production/src/helperComponents/DimensionRenderer.js.map +1 -1
  376. package/dist/production/src/helperComponents/EntityView.cjs.map +1 -1
  377. package/dist/production/src/helperComponents/EntityView.js.map +1 -1
  378. package/dist/production/src/helperComponents/FieldView.cjs +1 -1
  379. package/dist/production/src/helperComponents/FieldView.cjs.map +1 -1
  380. package/dist/production/src/helperComponents/FieldView.js +1 -1
  381. package/dist/production/src/helperComponents/FieldView.js.map +1 -1
  382. package/dist/production/src/helperComponents/If.cjs.map +1 -1
  383. package/dist/production/src/helperComponents/If.js.map +1 -1
  384. package/dist/production/src/helperComponents/LabelMiddleware.cjs.map +1 -1
  385. package/dist/production/src/helperComponents/LabelMiddleware.js.map +1 -1
  386. package/dist/production/src/helperComponents/RecursionTerminator.cjs +55 -0
  387. package/dist/production/src/helperComponents/RecursionTerminator.cjs.map +1 -0
  388. package/dist/production/src/helperComponents/RecursionTerminator.js +55 -0
  389. package/dist/production/src/helperComponents/RecursionTerminator.js.map +1 -0
  390. package/dist/production/src/helperComponents/RecursionTerminatorPortal.cjs +32 -0
  391. package/dist/production/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -0
  392. package/dist/production/src/helperComponents/RecursionTerminatorPortal.js +32 -0
  393. package/dist/production/src/helperComponents/RecursionTerminatorPortal.js.map +1 -0
  394. package/dist/production/src/helperComponents/SugaredField.cjs.map +1 -1
  395. package/dist/production/src/helperComponents/SugaredField.js.map +1 -1
  396. package/dist/production/src/helperComponents/Variable.cjs.map +1 -1
  397. package/dist/production/src/helperComponents/Variable.js.map +1 -1
  398. package/dist/production/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
  399. package/dist/production/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  400. package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.cjs.map +1 -1
  401. package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
  402. package/dist/production/src/helperComponents/helpers/evaluateCondition.cjs +14 -21
  403. package/dist/production/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
  404. package/dist/production/src/helperComponents/helpers/evaluateCondition.js +14 -21
  405. package/dist/production/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
  406. package/dist/production/src/helperComponents/persist/PersistOnFieldChange.cjs +24 -0
  407. package/dist/production/src/helperComponents/persist/PersistOnFieldChange.cjs.map +1 -0
  408. package/dist/production/src/helperComponents/persist/PersistOnFieldChange.js +24 -0
  409. package/dist/production/src/helperComponents/persist/PersistOnFieldChange.js.map +1 -0
  410. package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.cjs +31 -0
  411. package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.cjs.map +1 -0
  412. package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.js +31 -0
  413. package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.js.map +1 -0
  414. package/dist/production/src/helperComponents/persist/PersistOnKey.cjs +30 -0
  415. package/dist/production/src/helperComponents/persist/PersistOnKey.cjs.map +1 -0
  416. package/dist/production/src/helperComponents/persist/PersistOnKey.js +30 -0
  417. package/dist/production/src/helperComponents/persist/PersistOnKey.js.map +1 -0
  418. package/dist/production/src/helperComponents/persist/PersistTrigger.cjs +29 -0
  419. package/dist/production/src/helperComponents/persist/PersistTrigger.cjs.map +1 -0
  420. package/dist/production/src/helperComponents/persist/PersistTrigger.js +29 -0
  421. package/dist/production/src/helperComponents/persist/PersistTrigger.js.map +1 -0
  422. package/dist/production/src/helperComponents/persist/useDecoratedPersist.cjs +22 -0
  423. package/dist/production/src/helperComponents/persist/useDecoratedPersist.cjs.map +1 -0
  424. package/dist/production/src/helperComponents/persist/useDecoratedPersist.js +22 -0
  425. package/dist/production/src/helperComponents/persist/useDecoratedPersist.js.map +1 -0
  426. package/dist/production/src/markers/IncrementalMarkerBuilder.cjs +56 -0
  427. package/dist/production/src/markers/IncrementalMarkerBuilder.cjs.map +1 -0
  428. package/dist/production/src/markers/IncrementalMarkerBuilder.js +56 -0
  429. package/dist/production/src/markers/IncrementalMarkerBuilder.js.map +1 -0
  430. package/dist/production/src/markers/MarkerStaticAnalyzer.cjs +117 -0
  431. package/dist/production/src/markers/MarkerStaticAnalyzer.cjs.map +1 -0
  432. package/dist/production/src/markers/MarkerStaticAnalyzer.js +117 -0
  433. package/dist/production/src/markers/MarkerStaticAnalyzer.js.map +1 -0
  434. package/dist/production/src/markers/MarkerTreeGenerator.cjs +55 -0
  435. package/dist/production/src/markers/MarkerTreeGenerator.cjs.map +1 -0
  436. package/dist/production/src/markers/MarkerTreeGenerator.js +55 -0
  437. package/dist/production/src/markers/MarkerTreeGenerator.js.map +1 -0
  438. package/dist/types/accessorPropagation/BindingOperationsContext.d.ts +1 -1
  439. package/dist/types/accessorPropagation/BindingOperationsContext.d.ts.map +1 -1
  440. package/dist/types/accessorPropagation/EntityKeyContext.d.ts +2 -1
  441. package/dist/types/accessorPropagation/EntityKeyContext.d.ts.map +1 -1
  442. package/dist/types/accessorPropagation/EntityKeyProvider.d.ts +2 -1
  443. package/dist/types/accessorPropagation/EntityKeyProvider.d.ts.map +1 -1
  444. package/dist/types/accessorPropagation/EnvironmentContext.d.ts +5 -4
  445. package/dist/types/accessorPropagation/EnvironmentContext.d.ts.map +1 -1
  446. package/dist/types/accessorPropagation/TreeRootIdContext.d.ts +1 -1
  447. package/dist/types/accessorPropagation/TreeRootIdContext.d.ts.map +1 -1
  448. package/dist/types/accessorPropagation/index.d.ts +0 -1
  449. package/dist/types/accessorPropagation/index.d.ts.map +1 -1
  450. package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts +7 -12
  451. package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts.map +1 -1
  452. package/dist/types/accessorPropagation/useEntityKey.d.ts +2 -1
  453. package/dist/types/accessorPropagation/useEntityKey.d.ts.map +1 -1
  454. package/dist/types/accessorPropagation/useEntityListSubTreeLoader.d.ts +39 -5
  455. package/dist/types/accessorPropagation/useEntityListSubTreeLoader.d.ts.map +1 -1
  456. package/dist/types/accessorPropagation/useEntitySubTree.d.ts +1 -2
  457. package/dist/types/accessorPropagation/useEntitySubTree.d.ts.map +1 -1
  458. package/dist/types/accessorPropagation/useEntitySubTreeLoader.d.ts +40 -5
  459. package/dist/types/accessorPropagation/useEntitySubTreeLoader.d.ts.map +1 -1
  460. package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts +1 -1
  461. package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts.map +1 -1
  462. package/dist/types/accessorSorting/index.d.ts +0 -2
  463. package/dist/types/accessorSorting/index.d.ts.map +1 -1
  464. package/dist/types/accessorTree/AccessorTree.d.ts.map +1 -1
  465. package/dist/types/accessorTree/AccessorTreeState.d.ts +1 -4
  466. package/dist/types/accessorTree/AccessorTreeState.d.ts.map +1 -1
  467. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +1 -1
  468. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +1 -1
  469. package/dist/types/accessorTree/AccessorTreeStateOptions.d.ts +0 -2
  470. package/dist/types/accessorTree/AccessorTreeStateOptions.d.ts.map +1 -1
  471. package/dist/types/accessorTree/DirtinessContext.d.ts +1 -1
  472. package/dist/types/accessorTree/DirtinessContext.d.ts.map +1 -1
  473. package/dist/types/accessorTree/MutationStateContext.d.ts +1 -1
  474. package/dist/types/accessorTree/MutationStateContext.d.ts.map +1 -1
  475. package/dist/types/accessorTree/index.d.ts +0 -1
  476. package/dist/types/accessorTree/index.d.ts.map +1 -1
  477. package/dist/types/accessorTree/useDataBinding.d.ts +6 -2
  478. package/dist/types/accessorTree/useDataBinding.d.ts.map +1 -1
  479. package/dist/types/accessorTree/useEnvironmentWithSchema.d.ts +3 -0
  480. package/dist/types/accessorTree/useEnvironmentWithSchema.d.ts.map +1 -0
  481. package/dist/types/coreComponents/Component.d.ts +1 -1
  482. package/dist/types/coreComponents/Component.d.ts.map +1 -1
  483. package/dist/types/coreComponents/DataBindingProvider.d.ts +8 -8
  484. package/dist/types/coreComponents/DataBindingProvider.d.ts.map +1 -1
  485. package/dist/types/coreComponents/Entity.d.ts +1 -1
  486. package/dist/types/coreComponents/Entity.d.ts.map +1 -1
  487. package/dist/types/coreComponents/EntityListSubTree.d.ts +1 -1
  488. package/dist/types/coreComponents/EntityListSubTree.d.ts.map +1 -1
  489. package/dist/types/coreComponents/EntitySubTree.d.ts +1 -1
  490. package/dist/types/coreComponents/EntitySubTree.d.ts.map +1 -1
  491. package/dist/types/coreComponents/Field.d.ts.map +1 -1
  492. package/dist/types/coreComponents/ParentEntity.d.ts +1 -1
  493. package/dist/types/coreComponents/ParentEntity.d.ts.map +1 -1
  494. package/dist/types/coreComponents/index.d.ts +0 -1
  495. package/dist/types/coreComponents/index.d.ts.map +1 -1
  496. package/dist/types/entityEvents/index.d.ts +1 -0
  497. package/dist/types/entityEvents/index.d.ts.map +1 -1
  498. package/dist/types/entityEvents/useDataBindingEvent.d.ts +3 -0
  499. package/dist/types/entityEvents/useDataBindingEvent.d.ts.map +1 -0
  500. package/dist/types/entityEvents/useEntityEvent.d.ts.map +1 -1
  501. package/dist/types/helperComponents/DeferredSubTrees.d.ts +1 -1
  502. package/dist/types/helperComponents/DeferredSubTrees.d.ts.map +1 -1
  503. package/dist/types/helperComponents/DeleteEntityTrigger.d.ts +39 -0
  504. package/dist/types/helperComponents/DeleteEntityTrigger.d.ts.map +1 -0
  505. package/dist/types/helperComponents/If.d.ts +1 -1
  506. package/dist/types/helperComponents/If.d.ts.map +1 -1
  507. package/dist/types/helperComponents/LabelMiddleware.d.ts +1 -1
  508. package/dist/types/helperComponents/LabelMiddleware.d.ts.map +1 -1
  509. package/dist/types/helperComponents/RecursionTerminator.d.ts +22 -0
  510. package/dist/types/helperComponents/RecursionTerminator.d.ts.map +1 -0
  511. package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts +3 -0
  512. package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts.map +1 -0
  513. package/dist/types/helperComponents/StaticRender.d.ts +1 -1
  514. package/dist/types/helperComponents/StaticRender.d.ts.map +1 -1
  515. package/dist/types/helperComponents/Variable.d.ts +1 -1
  516. package/dist/types/helperComponents/Variable.d.ts.map +1 -1
  517. package/dist/types/helperComponents/helpers/evaluateCondition.d.ts +2 -2
  518. package/dist/types/helperComponents/helpers/evaluateCondition.d.ts.map +1 -1
  519. package/dist/types/helperComponents/index.d.ts +4 -0
  520. package/dist/types/helperComponents/index.d.ts.map +1 -1
  521. package/dist/types/helperComponents/persist/PersistOnFieldChange.d.ts +29 -0
  522. package/dist/types/helperComponents/persist/PersistOnFieldChange.d.ts.map +1 -0
  523. package/dist/types/helperComponents/persist/PersistOnHasOneChange.d.ts +29 -0
  524. package/dist/types/helperComponents/persist/PersistOnHasOneChange.d.ts.map +1 -0
  525. package/dist/types/helperComponents/persist/PersistOnKey.d.ts +29 -0
  526. package/dist/types/helperComponents/persist/PersistOnKey.d.ts.map +1 -0
  527. package/dist/types/helperComponents/persist/PersistTrigger.d.ts +32 -0
  528. package/dist/types/helperComponents/persist/PersistTrigger.d.ts.map +1 -0
  529. package/dist/types/helperComponents/persist/index.d.ts +5 -0
  530. package/dist/types/helperComponents/persist/index.d.ts.map +1 -0
  531. package/dist/types/helperComponents/persist/useDecoratedPersist.d.ts +7 -0
  532. package/dist/types/helperComponents/persist/useDecoratedPersist.d.ts.map +1 -0
  533. package/dist/types/index.d.ts +1 -1
  534. package/dist/types/index.d.ts.map +1 -1
  535. package/dist/types/markers/IncrementalMarkerBuilder.d.ts +5 -0
  536. package/dist/types/markers/IncrementalMarkerBuilder.d.ts.map +1 -0
  537. package/dist/types/{coreComponents → markers}/MarkerProvider.d.ts +1 -2
  538. package/dist/types/markers/MarkerProvider.d.ts.map +1 -0
  539. package/dist/types/markers/MarkerStaticAnalyzer.d.ts +14 -0
  540. package/dist/types/markers/MarkerStaticAnalyzer.d.ts.map +1 -0
  541. package/dist/types/markers/MarkerTreeGenerator.d.ts +10 -0
  542. package/dist/types/markers/MarkerTreeGenerator.d.ts.map +1 -0
  543. package/dist/types/markers/index.d.ts +3 -0
  544. package/dist/types/markers/index.d.ts.map +1 -0
  545. package/dist/types/tsconfig.tsbuildinfo +1 -1
  546. package/package.json +12 -9
  547. package/src/accessorPropagation/AccessorProvider.tsx +1 -1
  548. package/src/accessorPropagation/BindingOperationsContext.ts +2 -1
  549. package/src/accessorPropagation/EntityKeyContext.ts +2 -1
  550. package/src/accessorPropagation/EntityKeyProvider.tsx +2 -1
  551. package/src/accessorPropagation/EnvironmentContext.tsx +16 -9
  552. package/src/accessorPropagation/index.ts +0 -1
  553. package/src/accessorPropagation/useAccessorUpdateSubscription.ts +19 -87
  554. package/src/accessorPropagation/useEntity.ts +4 -4
  555. package/src/accessorPropagation/useEntityKey.ts +2 -2
  556. package/src/accessorPropagation/useEntityList.ts +3 -3
  557. package/src/accessorPropagation/useEntityListSubTree.ts +1 -1
  558. package/src/accessorPropagation/useEntityListSubTreeLoader.ts +111 -28
  559. package/src/accessorPropagation/useEntitySubTree.ts +3 -4
  560. package/src/accessorPropagation/useEntitySubTreeLoader.ts +113 -28
  561. package/src/accessorPropagation/useField.ts +3 -3
  562. package/src/accessorSorting/SetOrderFieldOnCreate.tsx +2 -2
  563. package/src/accessorSorting/addEntityAtIndex.ts +1 -1
  564. package/src/accessorSorting/index.ts +0 -2
  565. package/src/accessorSorting/repairEntitiesOrder.ts +1 -1
  566. package/src/accessorSorting/sortEntities.ts +2 -2
  567. package/src/accessorTree/AccessorTree.tsx +17 -12
  568. package/src/accessorTree/AccessorTreeState.ts +1 -4
  569. package/src/accessorTree/AccessorTreeStateOptions.ts +0 -2
  570. package/src/accessorTree/index.ts +0 -1
  571. package/src/accessorTree/useDataBinding.ts +35 -44
  572. package/src/accessorTree/useEnvironmentWithSchema.ts +31 -0
  573. package/src/coreComponents/Component.tsx +2 -2
  574. package/src/coreComponents/DataBindingProvider.tsx +22 -35
  575. package/src/coreComponents/EntityListSubTree.tsx +4 -18
  576. package/src/coreComponents/EntitySubTree.tsx +5 -20
  577. package/src/coreComponents/Field.tsx +0 -2
  578. package/src/coreComponents/index.ts +0 -1
  579. package/src/entityEvents/index.ts +1 -0
  580. package/src/entityEvents/useDataBindingEvent.ts +16 -0
  581. package/src/entityEvents/useDerivedField.ts +3 -3
  582. package/src/entityEvents/useEntityEvent.ts +17 -14
  583. package/src/helperComponents/DeferredSubTrees.tsx +1 -5
  584. package/src/helperComponents/DeleteEntityTrigger.tsx +80 -0
  585. package/src/helperComponents/FieldView.tsx +1 -1
  586. package/src/helperComponents/RecursionTerminator.tsx +73 -0
  587. package/src/helperComponents/RecursionTerminatorPortal.tsx +32 -0
  588. package/src/helperComponents/helpers/evaluateCondition.ts +16 -23
  589. package/src/helperComponents/index.ts +5 -0
  590. package/src/helperComponents/persist/PersistOnFieldChange.tsx +53 -0
  591. package/src/helperComponents/persist/PersistOnHasOneChange.tsx +59 -0
  592. package/src/helperComponents/persist/PersistOnKey.tsx +64 -0
  593. package/src/helperComponents/persist/PersistTrigger.tsx +59 -0
  594. package/src/helperComponents/persist/index.tsx +4 -0
  595. package/src/helperComponents/persist/useDecoratedPersist.ts +26 -0
  596. package/src/index.ts +1 -1
  597. package/src/markers/IncrementalMarkerBuilder.ts +60 -0
  598. package/src/{coreComponents → markers}/MarkerProvider.ts +2 -2
  599. package/src/markers/MarkerStaticAnalyzer.ts +140 -0
  600. package/src/markers/MarkerTreeGenerator.ts +75 -0
  601. package/src/markers/index.ts +2 -0
  602. package/src/tsconfig.json +1 -1
  603. package/src/typings/react-fix.d.ts +12 -0
  604. package/tests/cases/unit/core/entityOperations.test.tsx +4 -4
  605. package/tests/cases/unit/core/eventManager.test.tsx +11 -8
  606. package/tests/cases/unit/helperComponents/FilterEvaluator.spec.ts +1 -1
  607. package/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts +1 -1
  608. package/tests/cases/unit/helperComponents/evaluateCondition.spec.ts +1 -5
  609. package/tests/cases/unit/model/markerTreeGenerator.spec.tsx +68 -14
  610. package/tests/lib/bindingFactory.ts +1 -1
  611. package/dist/development/src/MarkerTreeGenerator.cjs +0 -89
  612. package/dist/development/src/MarkerTreeGenerator.cjs.map +0 -1
  613. package/dist/development/src/MarkerTreeGenerator.js +0 -89
  614. package/dist/development/src/MarkerTreeGenerator.js.map +0 -1
  615. package/dist/development/src/accessorPropagation/useGetTreeFilters.cjs +0 -6
  616. package/dist/development/src/accessorPropagation/useGetTreeFilters.cjs.map +0 -1
  617. package/dist/development/src/accessorPropagation/useGetTreeFilters.js +0 -6
  618. package/dist/development/src/accessorPropagation/useGetTreeFilters.js.map +0 -1
  619. package/dist/development/src/accessorSorting/errors.cjs +0 -10
  620. package/dist/development/src/accessorSorting/errors.cjs.map +0 -1
  621. package/dist/development/src/accessorSorting/errors.js +0 -10
  622. package/dist/development/src/accessorSorting/errors.js.map +0 -1
  623. package/dist/development/src/accessorSorting/moveEntity.cjs +0 -42
  624. package/dist/development/src/accessorSorting/moveEntity.cjs.map +0 -1
  625. package/dist/development/src/accessorSorting/moveEntity.js +0 -42
  626. package/dist/development/src/accessorSorting/moveEntity.js.map +0 -1
  627. package/dist/development/src/accessorSorting/useSortedEntities.cjs +0 -80
  628. package/dist/development/src/accessorSorting/useSortedEntities.cjs.map +0 -1
  629. package/dist/development/src/accessorSorting/useSortedEntities.js +0 -80
  630. package/dist/development/src/accessorSorting/useSortedEntities.js.map +0 -1
  631. package/dist/development/src/accessorTree/accessorTreeStateReducer.cjs +0 -34
  632. package/dist/development/src/accessorTree/accessorTreeStateReducer.cjs.map +0 -1
  633. package/dist/development/src/accessorTree/accessorTreeStateReducer.js +0 -34
  634. package/dist/development/src/accessorTree/accessorTreeStateReducer.js.map +0 -1
  635. package/dist/development/src/core/IncrementalMarkerBuilder.cjs +0 -63
  636. package/dist/development/src/core/IncrementalMarkerBuilder.cjs.map +0 -1
  637. package/dist/development/src/core/IncrementalMarkerBuilder.js +0 -63
  638. package/dist/development/src/core/IncrementalMarkerBuilder.js.map +0 -1
  639. package/dist/production/src/MarkerTreeGenerator.cjs +0 -89
  640. package/dist/production/src/MarkerTreeGenerator.cjs.map +0 -1
  641. package/dist/production/src/MarkerTreeGenerator.js +0 -89
  642. package/dist/production/src/MarkerTreeGenerator.js.map +0 -1
  643. package/dist/production/src/accessorPropagation/useGetTreeFilters.cjs +0 -6
  644. package/dist/production/src/accessorPropagation/useGetTreeFilters.cjs.map +0 -1
  645. package/dist/production/src/accessorPropagation/useGetTreeFilters.js +0 -6
  646. package/dist/production/src/accessorPropagation/useGetTreeFilters.js.map +0 -1
  647. package/dist/production/src/accessorSorting/errors.cjs +0 -10
  648. package/dist/production/src/accessorSorting/errors.cjs.map +0 -1
  649. package/dist/production/src/accessorSorting/errors.js +0 -10
  650. package/dist/production/src/accessorSorting/errors.js.map +0 -1
  651. package/dist/production/src/accessorSorting/moveEntity.cjs +0 -42
  652. package/dist/production/src/accessorSorting/moveEntity.cjs.map +0 -1
  653. package/dist/production/src/accessorSorting/moveEntity.js +0 -42
  654. package/dist/production/src/accessorSorting/moveEntity.js.map +0 -1
  655. package/dist/production/src/accessorSorting/useSortedEntities.cjs +0 -80
  656. package/dist/production/src/accessorSorting/useSortedEntities.cjs.map +0 -1
  657. package/dist/production/src/accessorSorting/useSortedEntities.js +0 -80
  658. package/dist/production/src/accessorSorting/useSortedEntities.js.map +0 -1
  659. package/dist/production/src/accessorTree/accessorTreeStateReducer.cjs +0 -34
  660. package/dist/production/src/accessorTree/accessorTreeStateReducer.cjs.map +0 -1
  661. package/dist/production/src/accessorTree/accessorTreeStateReducer.js +0 -34
  662. package/dist/production/src/accessorTree/accessorTreeStateReducer.js.map +0 -1
  663. package/dist/production/src/core/IncrementalMarkerBuilder.cjs +0 -63
  664. package/dist/production/src/core/IncrementalMarkerBuilder.cjs.map +0 -1
  665. package/dist/production/src/core/IncrementalMarkerBuilder.js +0 -63
  666. package/dist/production/src/core/IncrementalMarkerBuilder.js.map +0 -1
  667. package/dist/types/MarkerTreeGenerator.d.ts +0 -14
  668. package/dist/types/MarkerTreeGenerator.d.ts.map +0 -1
  669. package/dist/types/accessorPropagation/useGetTreeFilters.d.ts +0 -3
  670. package/dist/types/accessorPropagation/useGetTreeFilters.d.ts.map +0 -1
  671. package/dist/types/accessorSorting/errors.d.ts +0 -3
  672. package/dist/types/accessorSorting/errors.d.ts.map +0 -1
  673. package/dist/types/accessorSorting/moveEntity.d.ts +0 -4
  674. package/dist/types/accessorSorting/moveEntity.d.ts.map +0 -1
  675. package/dist/types/accessorSorting/useSortedEntities.d.ts +0 -5
  676. package/dist/types/accessorSorting/useSortedEntities.d.ts.map +0 -1
  677. package/dist/types/accessorTree/accessorTreeStateReducer.d.ts +0 -4
  678. package/dist/types/accessorTree/accessorTreeStateReducer.d.ts.map +0 -1
  679. package/dist/types/core/IncrementalMarkerBuilder.d.ts +0 -7
  680. package/dist/types/core/IncrementalMarkerBuilder.d.ts.map +0 -1
  681. package/dist/types/coreComponents/MarkerProvider.d.ts.map +0 -1
  682. package/src/MarkerTreeGenerator.ts +0 -121
  683. package/src/accessorPropagation/useGetTreeFilters.ts +0 -4
  684. package/src/accessorSorting/errors.ts +0 -9
  685. package/src/accessorSorting/moveEntity.ts +0 -65
  686. package/src/accessorSorting/useSortedEntities.ts +0 -102
  687. package/src/accessorTree/accessorTreeStateReducer.ts +0 -36
  688. package/src/core/IncrementalMarkerBuilder.ts +0 -64
@@ -15,16 +15,16 @@ function useEntityList(sugaredRelativeEntityList) {
15
15
  const getEntityByKey = useGetEntityByKey();
16
16
  const getEntityList = useCallback(() => {
17
17
  const parent = getEntityByKey(entityKey);
18
- return parent.getRelativeEntityList(relativeEntityList);
18
+ return parent.getEntityList(relativeEntityList);
19
19
  }, [entityKey, getEntityByKey, relativeEntityList]);
20
20
  if (relativeEntityList) {
21
21
  useConstantLengthInvariant(
22
22
  relativeEntityList.hasOneRelationPath,
23
23
  "Cannot change the length of the hasOneRelation path!"
24
24
  );
25
- const [entityList, forceUpdate] = useAccessorUpdateSubscription(getEntityList, true);
25
+ const [entityList, { update }] = useAccessorUpdateSubscription(getEntityList);
26
26
  if (relativeEntityList.hasOneRelationPath.length) {
27
- useOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, forceUpdate);
27
+ useOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update);
28
28
  }
29
29
  return entityList;
30
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getRelativeEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entityList, forceUpdate] = useAccessorUpdateSubscription(getEntityList, true)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, forceUpdate)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":[],"mappings":";;;;;;;AAaA,SAAS,cACR,2BACiC;AAC3B,QAAA,qBAAqB,+BAA+B,yBAAyB;AACnF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACjB,QAAA,gBAAgB,YAAY,MAAM;AACjC,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,sBAAsB,kBAAmB;AAAA,EACrD,GAAA,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AAEvB;AAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IAAA;AAGD,UAAM,CAAC,YAAY,WAAW,IAAI,8BAA8B,eAAe,IAAI;AAE/E,QAAA,mBAAmB,mBAAmB,QAAQ;AAEjD,4BAAsB,mBAAmB,mBAAmB,CAAC,EAAE,OAAO,WAAW;AAAA,IAClF;AAEO,WAAA;AAAA,EACR;AACO,SAAA;AACR;"}
1
+ {"version":3,"file":"useEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entityList, { update }] = useAccessorUpdateSubscription(getEntityList)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":[],"mappings":";;;;;;;AAaA,SAAS,cACR,2BACiC;AAC3B,QAAA,qBAAqB,+BAA+B,yBAAyB;AACnF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EACD;AAEA,QAAM,YAAY,aAAa;AAC/B,QAAM,iBAAiB,kBAAkB;AACnC,QAAA,gBAAgB,YAAY,MAAM;AACjC,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,cAAc,kBAAmB;AAAA,EAC7C,GAAA,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AAEvB;AAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IACD;AAEA,UAAM,CAAC,YAAY,EAAE,OAAQ,CAAA,IAAI,8BAA8B,aAAa;AAExE,QAAA,mBAAmB,mBAAmB,QAAQ;AAEjD,4BAAsB,mBAAmB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAAA;AAGtE,WAAA;AAAA,EAAA;AAED,SAAA;AACR;"}
@@ -13,7 +13,7 @@ const useEntityListSubTree = (qualifiedEntityList, ...treeId) => {
13
13
  () => getSubTree(parameters, ...hasTreeId ? [treeIdVal] : []),
14
14
  [getSubTree, hasTreeId, parameters, treeIdVal]
15
15
  );
16
- return useAccessorUpdateSubscription.useAccessorUpdateSubscription(getAccessor);
16
+ return useAccessorUpdateSubscription.useAccessorUpdateSubscription(getAccessor)[0];
17
17
  };
18
18
  exports.useEntityListSubTree = useEntityListSubTree;
19
19
  //# sourceMappingURL=useEntityListSubTree.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)\n}\n"],"names":["useGetEntityListSubTree","useEntityListSubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAaA,wBAAAA;AACb,QAAA,aAAaC,8DAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAA;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAO9C,SAAOC,8BAAAA,8BAA8B,WAAW;AACjD;;"}
1
+ {"version":3,"file":"useEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntityListSubTree","useEntityListSubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAaA,wBAAAA,wBAAwB;AACrC,QAAA,aAAaC,8DAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAA;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAC9C;AAMO,SAAAC,8BAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;;"}
@@ -11,7 +11,7 @@ const useEntityListSubTree = (qualifiedEntityList, ...treeId) => {
11
11
  () => getSubTree(parameters, ...hasTreeId ? [treeIdVal] : []),
12
12
  [getSubTree, hasTreeId, parameters, treeIdVal]
13
13
  );
14
- return useAccessorUpdateSubscription(getAccessor);
14
+ return useAccessorUpdateSubscription(getAccessor)[0];
15
15
  };
16
16
  export {
17
17
  useEntityListSubTree
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAa;AACb,QAAA,aAAa,+BAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAO9C,SAAO,8BAA8B,WAAW;AACjD;"}
1
+ {"version":3,"file":"useEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAa,wBAAwB;AACrC,QAAA,aAAa,+BAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAC9C;AAMO,SAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
@@ -2,46 +2,85 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const useExtendTree = require("./useExtendTree.cjs");
5
+ const reactUtils = require("@contember/react-utils");
5
6
  const EntityListSubTree = require("../coreComponents/EntityListSubTree.cjs");
7
+ const emptyObject = {};
6
8
  const useEntityListSubTreeLoader = (entities, children, state) => {
7
9
  const [displayedState, setDisplayedState] = React.useState({
10
+ state: "initial",
11
+ isLoading: false,
8
12
  entities: void 0,
9
13
  treeRootId: void 0,
10
- state: void 0
14
+ customState: void 0
11
15
  });
12
16
  const currentlyLoading = React.useRef();
13
- const [loadingState, setLoadingState] = React.useState("initial");
14
17
  const extendTree = useExtendTree.useExtendTree();
18
+ const [reloadTrigger, setReloadTrigger] = React.useState(null);
19
+ const memoizedEntities = reactUtils.useObjectMemo(entities ?? emptyObject);
20
+ const resolvedEntities = entities ? memoizedEntities : void 0;
15
21
  React.useEffect(() => {
16
22
  (async () => {
17
- if (!entities || displayedState.state === state && displayedState.entities === entities || currentlyLoading.current?.entities === entities && currentlyLoading.current?.state === state) {
23
+ if (!resolvedEntities) {
18
24
  return;
19
25
  }
20
26
  currentlyLoading.current = {
21
- entities,
27
+ entities: resolvedEntities,
22
28
  state
23
29
  };
24
- if (displayedState.entities) {
25
- setLoadingState("refreshing");
26
- }
30
+ setDisplayedState((it) => {
31
+ if (it.state === "initial" || it.state === "loading" || it.state === "failed") {
32
+ return {
33
+ ...it,
34
+ isLoading: true,
35
+ state: "loading"
36
+ };
37
+ } else {
38
+ return {
39
+ ...it,
40
+ isLoading: true,
41
+ state: "refreshing"
42
+ };
43
+ }
44
+ });
27
45
  const newTreeRootId = await extendTree(
28
46
  React.createElement(EntityListSubTree.EntityListSubTree, {
29
- ...entities,
47
+ ...resolvedEntities,
30
48
  children
31
- })
49
+ }),
50
+ {
51
+ force: reloadTrigger !== null,
52
+ onError: (e) => {
53
+ console.error(e);
54
+ currentlyLoading.current = void 0;
55
+ setDisplayedState({
56
+ state: "failed",
57
+ error: e,
58
+ entities: void 0,
59
+ treeRootId: void 0,
60
+ customState: void 0,
61
+ isLoading: false
62
+ });
63
+ }
64
+ }
32
65
  );
33
- currentlyLoading.current = void 0;
34
66
  if (newTreeRootId) {
67
+ currentlyLoading.current = void 0;
35
68
  setDisplayedState({
36
- entities,
69
+ state: "loaded",
70
+ entities: resolvedEntities,
37
71
  treeRootId: newTreeRootId,
38
- state
72
+ customState: state,
73
+ isLoading: false
39
74
  });
40
- setLoadingState("loaded");
41
75
  }
42
76
  })();
43
- }, [displayedState, extendTree, entities, children, state]);
44
- return [displayedState, loadingState];
77
+ }, [extendTree, resolvedEntities, children, state, reloadTrigger]);
78
+ return [
79
+ displayedState,
80
+ {
81
+ reload: React.useCallback(() => setReloadTrigger({}), [])
82
+ }
83
+ ];
45
84
  };
46
85
  exports.useEntityListSubTreeLoader = useEntityListSubTreeLoader;
47
86
  //# sourceMappingURL=useEntityListSubTreeLoader.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityListSubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\n\nexport type UseEntityListSubTreeLoaderResult<State> = {\n\tentities: SugaredQualifiedEntityList | undefined\n\ttreeRootId: TreeRootId | undefined\n\tstate: State | undefined\n}\n\nexport type EntityListSubTreeLoaderState =\n\t| 'initial'\n\t| 'refreshing'\n\t| 'loaded'\n\nexport const useEntityListSubTreeLoader = <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State): [UseEntityListSubTreeLoaderResult<State>, EntityListSubTreeLoaderState] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderResult<State>>({\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tstate: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentities: SugaredQualifiedEntityList\n\t\tstate?: State\n\t}>()\n\n\tconst [loadingState, setLoadingState] = useState<EntityListSubTreeLoaderState>('initial')\n\tconst extendTree = useExtendTree()\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (\n\t\t\t\t!entities\n\t\t\t\t|| displayedState.state === state && displayedState.entities === entities\n\t\t\t\t|| currentlyLoading.current?.entities === entities && currentlyLoading.current?.state === state\n\t\t\t) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tif (displayedState.entities) {\n\t\t\t\tsetLoadingState('refreshing')\n\t\t\t}\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...entities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t)\n\t\t\tcurrentlyLoading.current = undefined\n\t\t\tif (newTreeRootId) {\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tentities: entities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tstate: state,\n\t\t\t\t})\n\t\t\t\tsetLoadingState('loaded')\n\t\t\t}\n\t\t})()\n\t}, [displayedState, extendTree, entities, children, state])\n\n\treturn [displayedState, loadingState]\n}\n"],"names":["useState","useRef","useExtendTree","useEffect","createElement","EntityListSubTree"],"mappings":";;;;;AAgBO,MAAM,6BAA6B,CAAQ,UAAkD,UAAqB,UAA2F;AACnN,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAAkD;AAAA,IAC7F,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,EAAA,CACP;AACD,QAAM,mBAAmBC,MAAAA;AAKzB,QAAM,CAAC,cAAc,eAAe,IAAID,eAAuC,SAAS;AACxF,QAAM,aAAaE,cAAAA;AAEnBC,QAAAA,UAAU,MAAM;AACf,KAAC,YAAY;AACZ,UACC,CAAC,YACE,eAAe,UAAU,SAAS,eAAe,aAAa,YAC9D,iBAAiB,SAAS,aAAa,YAAY,iBAAiB,SAAS,UAAU,OACzF;AACD;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B;AAAA,QACA;AAAA,MAAA;AAGD,UAAI,eAAe,UAAU;AAC5B,wBAAgB,YAAY;AAAA,MAC7B;AAEA,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,kBAAAA,mBAAmB;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,MAAA;AAEF,uBAAiB,UAAU;AAC3B,UAAI,eAAe;AACA,0BAAA;AAAA,UACjB;AAAA,UACA,YAAY;AAAA,UACZ;AAAA,QAAA,CACA;AACD,wBAAgB,QAAQ;AAAA,MACzB;AAAA,IAAA;EACE,GACD,CAAC,gBAAgB,YAAY,UAAU,UAAU,KAAK,CAAC;AAEnD,SAAA,CAAC,gBAAgB,YAAY;AACrC;;"}
1
+ {"version":3,"file":"useEntityListSubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\nimport { useEnvironment } from './useEnvironment'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntityListSubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntityListSubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntityListSubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntityListSubTreeLoaderState<State> =\n\t| UseEntityListSubTreeLoaderStateInitial\n\t| UseEntityListSubTreeLoaderStateLoading\n\t| UseEntityListSubTreeLoaderStateRefreshing<State>\n\t| UseEntityListSubTreeLoaderStateLoaded<State>\n\t| UseEntityListSubTreeLoaderStateFailed\n\nexport type UseEntityListSubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedEntityList\n\nexport const useEntityListSubTreeLoader = <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State): [UseEntityListSubTreeLoaderState<State>, UseEntityListSubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentities: SugaredQualifiedEntityList\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntities = useObjectMemo(entities ?? emptyObject)\n\tconst resolvedEntities = entities ? memoizedEntities : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntities) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities: resolvedEntities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...resolvedEntities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentities: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentities: resolvedEntities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntities, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntityListSubTree","useCallback"],"mappings":";;;;;;AA6DA,MAAM,cAAc,CAAC;AAEd,MAAM,6BAA6B,CAAQ,UAAkD,UAAqB,UAAoG;AAC5N,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAAiD;AAAA,IAC5F,OAAO;AAAA,IACP,WAAW;AAAA,IACX,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmBC,MAAAA,OAGtB;AAEH,QAAM,aAAaC,cAAAA,cAAc;AACjC,QAAM,CAAC,eAAe,gBAAgB,IAAIF,MAAAA,SAAwB,IAAI;AAChE,QAAA,mBAAmBG,WAAAA,cAAc,YAAY,WAAW;AACxD,QAAA,mBAAmB,WAAW,mBAAmB;AAEvDC,QAAAA,UAAU,MAAM;AACf,KAAC,YAAY;AACZ,UAAI,CAAC,kBAAkB;AACtB;AAAA,MAAA;AAGD,uBAAiB,UAAU;AAAA,QAC1B,UAAU;AAAA,QACV;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,kBAAAA,mBAAmB;AAAA,UAChC,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,UAAU;AAAA,cACV,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QACF;AAAA,MAEF;AAEA,UAAI,eAAe;AAClB,yBAAiB,UAAU;AACT,0BAAA;AAAA,UACjB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MAAA;AAAA,IACF,GACE;AAAA,EAAA,GACD,CAAC,YAAY,kBAAkB,UAAU,OAAO,aAAa,CAAC;AAE1D,SAAA;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQC,MAAAA,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAE,CAAA;AAAA,IAAA;AAAA,EAEpD;AACD;;"}
@@ -1,45 +1,84 @@
1
- import { useState, useRef, useEffect, createElement } from "react";
1
+ import { useState, useRef, useEffect, createElement, useCallback } from "react";
2
2
  import { useExtendTree } from "./useExtendTree.js";
3
+ import { useObjectMemo } from "@contember/react-utils";
3
4
  import { EntityListSubTree } from "../coreComponents/EntityListSubTree.js";
5
+ const emptyObject = {};
4
6
  const useEntityListSubTreeLoader = (entities, children, state) => {
5
7
  const [displayedState, setDisplayedState] = useState({
8
+ state: "initial",
9
+ isLoading: false,
6
10
  entities: void 0,
7
11
  treeRootId: void 0,
8
- state: void 0
12
+ customState: void 0
9
13
  });
10
14
  const currentlyLoading = useRef();
11
- const [loadingState, setLoadingState] = useState("initial");
12
15
  const extendTree = useExtendTree();
16
+ const [reloadTrigger, setReloadTrigger] = useState(null);
17
+ const memoizedEntities = useObjectMemo(entities ?? emptyObject);
18
+ const resolvedEntities = entities ? memoizedEntities : void 0;
13
19
  useEffect(() => {
14
20
  (async () => {
15
- if (!entities || displayedState.state === state && displayedState.entities === entities || currentlyLoading.current?.entities === entities && currentlyLoading.current?.state === state) {
21
+ if (!resolvedEntities) {
16
22
  return;
17
23
  }
18
24
  currentlyLoading.current = {
19
- entities,
25
+ entities: resolvedEntities,
20
26
  state
21
27
  };
22
- if (displayedState.entities) {
23
- setLoadingState("refreshing");
24
- }
28
+ setDisplayedState((it) => {
29
+ if (it.state === "initial" || it.state === "loading" || it.state === "failed") {
30
+ return {
31
+ ...it,
32
+ isLoading: true,
33
+ state: "loading"
34
+ };
35
+ } else {
36
+ return {
37
+ ...it,
38
+ isLoading: true,
39
+ state: "refreshing"
40
+ };
41
+ }
42
+ });
25
43
  const newTreeRootId = await extendTree(
26
44
  createElement(EntityListSubTree, {
27
- ...entities,
45
+ ...resolvedEntities,
28
46
  children
29
- })
47
+ }),
48
+ {
49
+ force: reloadTrigger !== null,
50
+ onError: (e) => {
51
+ console.error(e);
52
+ currentlyLoading.current = void 0;
53
+ setDisplayedState({
54
+ state: "failed",
55
+ error: e,
56
+ entities: void 0,
57
+ treeRootId: void 0,
58
+ customState: void 0,
59
+ isLoading: false
60
+ });
61
+ }
62
+ }
30
63
  );
31
- currentlyLoading.current = void 0;
32
64
  if (newTreeRootId) {
65
+ currentlyLoading.current = void 0;
33
66
  setDisplayedState({
34
- entities,
67
+ state: "loaded",
68
+ entities: resolvedEntities,
35
69
  treeRootId: newTreeRootId,
36
- state
70
+ customState: state,
71
+ isLoading: false
37
72
  });
38
- setLoadingState("loaded");
39
73
  }
40
74
  })();
41
- }, [displayedState, extendTree, entities, children, state]);
42
- return [displayedState, loadingState];
75
+ }, [extendTree, resolvedEntities, children, state, reloadTrigger]);
76
+ return [
77
+ displayedState,
78
+ {
79
+ reload: useCallback(() => setReloadTrigger({}), [])
80
+ }
81
+ ];
43
82
  };
44
83
  export {
45
84
  useEntityListSubTreeLoader
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityListSubTreeLoader.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\n\nexport type UseEntityListSubTreeLoaderResult<State> = {\n\tentities: SugaredQualifiedEntityList | undefined\n\ttreeRootId: TreeRootId | undefined\n\tstate: State | undefined\n}\n\nexport type EntityListSubTreeLoaderState =\n\t| 'initial'\n\t| 'refreshing'\n\t| 'loaded'\n\nexport const useEntityListSubTreeLoader = <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State): [UseEntityListSubTreeLoaderResult<State>, EntityListSubTreeLoaderState] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderResult<State>>({\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tstate: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentities: SugaredQualifiedEntityList\n\t\tstate?: State\n\t}>()\n\n\tconst [loadingState, setLoadingState] = useState<EntityListSubTreeLoaderState>('initial')\n\tconst extendTree = useExtendTree()\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (\n\t\t\t\t!entities\n\t\t\t\t|| displayedState.state === state && displayedState.entities === entities\n\t\t\t\t|| currentlyLoading.current?.entities === entities && currentlyLoading.current?.state === state\n\t\t\t) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tif (displayedState.entities) {\n\t\t\t\tsetLoadingState('refreshing')\n\t\t\t}\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...entities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t)\n\t\t\tcurrentlyLoading.current = undefined\n\t\t\tif (newTreeRootId) {\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tentities: entities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tstate: state,\n\t\t\t\t})\n\t\t\t\tsetLoadingState('loaded')\n\t\t\t}\n\t\t})()\n\t}, [displayedState, extendTree, entities, children, state])\n\n\treturn [displayedState, loadingState]\n}\n"],"names":[],"mappings":";;;AAgBO,MAAM,6BAA6B,CAAQ,UAAkD,UAAqB,UAA2F;AACnN,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAkD;AAAA,IAC7F,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,EAAA,CACP;AACD,QAAM,mBAAmB;AAKzB,QAAM,CAAC,cAAc,eAAe,IAAI,SAAuC,SAAS;AACxF,QAAM,aAAa;AAEnB,YAAU,MAAM;AACf,KAAC,YAAY;AACZ,UACC,CAAC,YACE,eAAe,UAAU,SAAS,eAAe,aAAa,YAC9D,iBAAiB,SAAS,aAAa,YAAY,iBAAiB,SAAS,UAAU,OACzF;AACD;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B;AAAA,QACA;AAAA,MAAA;AAGD,UAAI,eAAe,UAAU;AAC5B,wBAAgB,YAAY;AAAA,MAC7B;AAEA,YAAM,gBAAgB,MAAM;AAAA,QAC3B,cAAc,mBAAmB;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,MAAA;AAEF,uBAAiB,UAAU;AAC3B,UAAI,eAAe;AACA,0BAAA;AAAA,UACjB;AAAA,UACA,YAAY;AAAA,UACZ;AAAA,QAAA,CACA;AACD,wBAAgB,QAAQ;AAAA,MACzB;AAAA,IAAA;EACE,GACD,CAAC,gBAAgB,YAAY,UAAU,UAAU,KAAK,CAAC;AAEnD,SAAA,CAAC,gBAAgB,YAAY;AACrC;"}
1
+ {"version":3,"file":"useEntityListSubTreeLoader.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\nimport { useEnvironment } from './useEnvironment'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntityListSubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntityListSubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntityListSubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntityListSubTreeLoaderState<State> =\n\t| UseEntityListSubTreeLoaderStateInitial\n\t| UseEntityListSubTreeLoaderStateLoading\n\t| UseEntityListSubTreeLoaderStateRefreshing<State>\n\t| UseEntityListSubTreeLoaderStateLoaded<State>\n\t| UseEntityListSubTreeLoaderStateFailed\n\nexport type UseEntityListSubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedEntityList\n\nexport const useEntityListSubTreeLoader = <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State): [UseEntityListSubTreeLoaderState<State>, UseEntityListSubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentities: SugaredQualifiedEntityList\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntities = useObjectMemo(entities ?? emptyObject)\n\tconst resolvedEntities = entities ? memoizedEntities : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntities) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities: resolvedEntities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...resolvedEntities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentities: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentities: resolvedEntities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntities, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":[],"mappings":";;;;AA6DA,MAAM,cAAc,CAAC;AAEd,MAAM,6BAA6B,CAAQ,UAAkD,UAAqB,UAAoG;AAC5N,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAiD;AAAA,IAC5F,OAAO;AAAA,IACP,WAAW;AAAA,IACX,UAAU;AAAA,IACV,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,mBAAmB,cAAc,YAAY,WAAW;AACxD,QAAA,mBAAmB,WAAW,mBAAmB;AAEvD,YAAU,MAAM;AACf,KAAC,YAAY;AACZ,UAAI,CAAC,kBAAkB;AACtB;AAAA,MAAA;AAGD,uBAAiB,UAAU;AAAA,QAC1B,UAAU;AAAA,QACV;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,mBAAmB;AAAA,UAChC,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,UAAU;AAAA,cACV,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QACF;AAAA,MAEF;AAEA,UAAI,eAAe;AAClB,yBAAiB,UAAU;AACT,0BAAA;AAAA,UACjB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MAAA;AAAA,IACF,GACE;AAAA,EAAA,GACD,CAAC,YAAY,kBAAkB,UAAU,OAAO,aAAa,CAAC;AAE1D,SAAA;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAE,CAAA;AAAA,IAAA;AAAA,EAEpD;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityListSubTreeParameters.cjs","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":["useConstantValueInvariant","entities","useMemo"],"mappings":";;;;AAWO,SAAS,+BACf,qBAC+E;AAC/EA,aAAA,0BAA0B,OAAO,mBAAmB;AAEhD,MAAA,OAAO,wBAAwB,UAAU;AACrC,WAAA;AAAA,EACR;AAGAA,aAAA;AAAA,IACC,oBAAoB;AAAA,IACpB;AAAA,EAAA;AAIDA,aAAA;AAAA,IACC,OAAO,oBAAoB;AAAA,IAC3B;AAAA,EAAA;AAGD,MAAI,oBAAoB,YAAY;AACnC,UAAMC,YAAW,oBAAoB;AAEjC,QAAA,OAAOA,cAAa,UAAU;AAE1B,aAAAC,MAAA;AAAA,QACN,OAAO;AAAA,UACN,YAAY;AAAA,UACZ,UAAAD;AAAAA,QAAA;AAAA,QAED,CAACA,SAAQ;AAAA,MAAA;AAAA,IAEX;AAEO,WAAAC,MAAA;AAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,UAAU,EAAE,YAAYD,UAAS,WAAW;AAAA,MAAA;AAAA,MAE7C,CAACA,UAAS,UAAU;AAAA,IAAA;AAAA,EAEtB;AACA,QAAM,WAAW,oBAAoB;AAEjC,MAAA,OAAO,aAAa,UAAU;AAE1B,WAAAC,MAAA;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;AAEO,SAAAA,MAAA;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,IACrB;AAAA,EAAA;AAEF;;"}
1
+ {"version":3,"file":"useEntityListSubTreeParameters.cjs","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":["useConstantValueInvariant","entities","useMemo"],"mappings":";;;;AAWO,SAAS,+BACf,qBAC+E;AAC/EA,aAAA,0BAA0B,OAAO,mBAAmB;AAEhD,MAAA,OAAO,wBAAwB,UAAU;AACrC,WAAA;AAAA,EAAA;AAIRA,aAAA;AAAA,IACC,oBAAoB;AAAA,IACpB;AAAA,EACD;AAGAA,aAAA;AAAA,IACC,OAAO,oBAAoB;AAAA,IAC3B;AAAA,EACD;AAEA,MAAI,oBAAoB,YAAY;AACnC,UAAMC,YAAW,oBAAoB;AAEjC,QAAA,OAAOA,cAAa,UAAU;AAE1B,aAAAC,MAAA;AAAA,QACN,OAAO;AAAA,UACN,YAAY;AAAA,UACZ,UAAAD;AAAAA,QAAA;AAAA,QAED,CAACA,SAAQ;AAAA,MACV;AAAA,IAAA;AAGM,WAAAC,MAAA;AAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,UAAU,EAAE,YAAYD,UAAS,WAAW;AAAA,MAAA;AAAA,MAE7C,CAACA,UAAS,UAAU;AAAA,IACrB;AAAA,EAAA;AAED,QAAM,WAAW,oBAAoB;AAEjC,MAAA,OAAO,aAAa,UAAU;AAE1B,WAAAC,MAAA;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,SAAAA,MAAA;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 +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,EACR;AAGA;AAAA,IACC,oBAAoB;AAAA,IACpB;AAAA,EAAA;AAID;AAAA,IACC,OAAO,oBAAoB;AAAA,IAC3B;AAAA,EAAA;AAGD,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,MAAA;AAAA,IAEX;AAEO,WAAA;AAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,UAAU,EAAE,YAAYA,UAAS,WAAW;AAAA,MAAA;AAAA,MAE7C,CAACA,UAAS,UAAU;AAAA,IAAA;AAAA,EAEtB;AACA,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,IAAA;AAAA,EAE/F;AAEO,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,IACrB;AAAA,EAAA;AAEF;"}
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;"}
@@ -13,7 +13,7 @@ const useEntitySubTree = (qualifiedSingleEntity, ...treeId) => {
13
13
  () => getSubTree(parameters, ...hasTreeId ? [treeIdVal] : []),
14
14
  [getSubTree, hasTreeId, parameters, treeIdVal]
15
15
  );
16
- return useAccessorUpdateSubscription.useAccessorUpdateSubscription(getAccessor);
16
+ return useAccessorUpdateSubscription.useAccessorUpdateSubscription(getAccessor)[0];
17
17
  };
18
18
  exports.useEntitySubTree = useEntitySubTree;
19
19
  //# sourceMappingURL=useEntitySubTree.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\nimport { TreeRootId } from '@contember/binding'\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)\n}\n"],"names":["useGetEntitySubTree","useEntitySubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAQa,MAAA,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAaA,oBAAAA;AACb,QAAA,aAAaC,sDAA2B,qBAAqB;AAC7D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAA;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAM9C,SAAOC,8BAAAA,8BAA8B,WAAW;AACjD;;"}
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;;"}
@@ -11,7 +11,7 @@ const useEntitySubTree = (qualifiedSingleEntity, ...treeId) => {
11
11
  () => getSubTree(parameters, ...hasTreeId ? [treeIdVal] : []),
12
12
  [getSubTree, hasTreeId, parameters, treeIdVal]
13
13
  );
14
- return useAccessorUpdateSubscription(getAccessor);
14
+ return useAccessorUpdateSubscription(getAccessor)[0];
15
15
  };
16
16
  export {
17
17
  useEntitySubTree
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\nimport { TreeRootId } from '@contember/binding'\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)\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAa;AACb,QAAA,aAAa,2BAA2B,qBAAqB;AAC7D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAM9C,SAAO,8BAA8B,WAAW;AACjD;"}
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;"}
@@ -2,46 +2,85 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const useExtendTree = require("./useExtendTree.cjs");
5
+ const reactUtils = require("@contember/react-utils");
5
6
  const EntitySubTree = require("../coreComponents/EntitySubTree.cjs");
7
+ const emptyObject = {};
6
8
  const useEntitySubTreeLoader = (entity, children, state) => {
7
9
  const [displayedState, setDisplayedState] = React.useState({
10
+ state: "initial",
11
+ isLoading: false,
8
12
  entity: void 0,
9
13
  treeRootId: void 0,
10
- state: void 0
14
+ customState: void 0
11
15
  });
12
16
  const currentlyLoading = React.useRef();
13
- const [loadingState, setLoadingState] = React.useState("initial");
14
17
  const extendTree = useExtendTree.useExtendTree();
18
+ const [reloadTrigger, setReloadTrigger] = React.useState(null);
19
+ const memoizedEntity = reactUtils.useObjectMemo(entity ?? emptyObject);
20
+ const resolvedEntity = entity ? memoizedEntity : void 0;
15
21
  React.useEffect(() => {
16
22
  (async () => {
17
- if (!entity || displayedState.state === state && displayedState.entity === entity || currentlyLoading.current?.entity === entity && currentlyLoading.current?.state === state) {
23
+ if (!resolvedEntity) {
18
24
  return;
19
25
  }
20
26
  currentlyLoading.current = {
21
- entity,
27
+ entity: resolvedEntity,
22
28
  state
23
29
  };
24
- if (displayedState.entity) {
25
- setLoadingState("refreshing");
26
- }
30
+ setDisplayedState((it) => {
31
+ if (it.state === "initial" || it.state === "loading" || it.state === "failed") {
32
+ return {
33
+ ...it,
34
+ isLoading: true,
35
+ state: "loading"
36
+ };
37
+ } else {
38
+ return {
39
+ ...it,
40
+ isLoading: true,
41
+ state: "refreshing"
42
+ };
43
+ }
44
+ });
27
45
  const newTreeRootId = await extendTree(
28
46
  React.createElement(EntitySubTree.EntitySubTree, {
29
- ...entity,
47
+ ...resolvedEntity,
30
48
  children
31
- })
49
+ }),
50
+ {
51
+ force: reloadTrigger !== null,
52
+ onError: (e) => {
53
+ console.error(e);
54
+ currentlyLoading.current = void 0;
55
+ setDisplayedState({
56
+ state: "failed",
57
+ error: e,
58
+ entity: void 0,
59
+ treeRootId: void 0,
60
+ customState: void 0,
61
+ isLoading: false
62
+ });
63
+ }
64
+ }
32
65
  );
33
- currentlyLoading.current = void 0;
34
66
  if (newTreeRootId) {
67
+ currentlyLoading.current = void 0;
35
68
  setDisplayedState({
36
- entity,
69
+ state: "loaded",
70
+ entity: resolvedEntity,
37
71
  treeRootId: newTreeRootId,
38
- state
72
+ customState: state,
73
+ isLoading: false
39
74
  });
40
- setLoadingState("loaded");
41
75
  }
42
76
  })();
43
- }, [displayedState, extendTree, entity, children, state]);
44
- return [displayedState, loadingState];
77
+ }, [extendTree, resolvedEntity, children, state, reloadTrigger]);
78
+ return [
79
+ displayedState,
80
+ {
81
+ reload: React.useCallback(() => setReloadTrigger({}), [])
82
+ }
83
+ ];
45
84
  };
46
85
  exports.useEntitySubTreeLoader = useEntitySubTreeLoader;
47
86
  //# sourceMappingURL=useEntitySubTreeLoader.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\n\nexport type UseEntitySubTreeLoaderResult<State> = {\n\tentity: SugaredQualifiedSingleEntity | undefined\n\ttreeRootId: TreeRootId | undefined\n\tstate: State | undefined\n}\n\nexport type EntitySubTreeLoaderState =\n\t| 'initial'\n\t| 'refreshing'\n\t| 'loaded'\n\nexport const useEntitySubTreeLoader = <State>(entity: SugaredQualifiedSingleEntity | undefined, children: ReactNode, state?: State): [UseEntitySubTreeLoaderResult<State>, EntitySubTreeLoaderState] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderResult<State>>({\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tstate: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentity: SugaredQualifiedSingleEntity\n\t\tstate?: State\n\t}>()\n\n\tconst [loadingState, setLoadingState] = useState<EntitySubTreeLoaderState>('initial')\n\tconst extendTree = useExtendTree()\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (\n\t\t\t\t!entity\n\t\t\t\t|| displayedState.state === state && displayedState.entity === entity\n\t\t\t\t|| currentlyLoading.current?.entity === entity && currentlyLoading.current?.state === state\n\t\t\t) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tif (displayedState.entity) {\n\t\t\t\tsetLoadingState('refreshing')\n\t\t\t}\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...entity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t)\n\t\t\tcurrentlyLoading.current = undefined\n\t\t\tif (newTreeRootId) {\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tentity: entity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tstate: state,\n\t\t\t\t})\n\t\t\t\tsetLoadingState('loaded')\n\t\t\t}\n\t\t})()\n\t}, [displayedState, extendTree, entity, children, state])\n\n\treturn [displayedState, loadingState]\n}\n"],"names":["useState","useRef","useExtendTree","useEffect","createElement","EntitySubTree"],"mappings":";;;;;AAgBO,MAAM,yBAAyB,CAAQ,QAAkD,UAAqB,UAAmF;AACvM,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAA8C;AAAA,IACzF,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,OAAO;AAAA,EAAA,CACP;AACD,QAAM,mBAAmBC,MAAAA;AAKzB,QAAM,CAAC,cAAc,eAAe,IAAID,eAAmC,SAAS;AACpF,QAAM,aAAaE,cAAAA;AAEnBC,QAAAA,UAAU,MAAM;AACf,KAAC,YAAY;AACZ,UACC,CAAC,UACE,eAAe,UAAU,SAAS,eAAe,WAAW,UAC5D,iBAAiB,SAAS,WAAW,UAAU,iBAAiB,SAAS,UAAU,OACrF;AACD;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B;AAAA,QACA;AAAA,MAAA;AAGD,UAAI,eAAe,QAAQ;AAC1B,wBAAgB,YAAY;AAAA,MAC7B;AAEA,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,cAAAA,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,MAAA;AAEF,uBAAiB,UAAU;AAC3B,UAAI,eAAe;AACA,0BAAA;AAAA,UACjB;AAAA,UACA,YAAY;AAAA,UACZ;AAAA,QAAA,CACA;AACD,wBAAgB,QAAQ;AAAA,MACzB;AAAA,IAAA;EACE,GACD,CAAC,gBAAgB,YAAY,QAAQ,UAAU,KAAK,CAAC;AAEjD,SAAA,CAAC,gBAAgB,YAAY;AACrC;;"}
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;;"}