@contember/react-binding 2.1.0-beta.1 → 2.2.0-alpha.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 (427) hide show
  1. package/dist/development/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
  2. package/dist/development/src/accessorPropagation/AccessorProvider.js.map +1 -1
  3. package/dist/development/src/accessorPropagation/BindingOperationsProvider.cjs.map +1 -1
  4. package/dist/development/src/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  5. package/dist/development/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
  6. package/dist/development/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
  7. package/dist/development/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
  8. package/dist/development/src/accessorPropagation/EnvironmentContext.js.map +1 -1
  9. package/dist/development/src/accessorPropagation/TreeRootIdProvider.cjs.map +1 -1
  10. package/dist/development/src/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  11. package/dist/development/src/accessorPropagation/useBindingOperations.cjs.map +1 -1
  12. package/dist/development/src/accessorPropagation/useBindingOperations.js.map +1 -1
  13. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
  14. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
  15. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
  16. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
  17. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
  18. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
  19. package/dist/development/src/accessorPropagation/useEntity.cjs.map +1 -1
  20. package/dist/development/src/accessorPropagation/useEntity.js.map +1 -1
  21. package/dist/development/src/accessorPropagation/useEntityKey.cjs.map +1 -1
  22. package/dist/development/src/accessorPropagation/useEntityKey.js.map +1 -1
  23. package/dist/development/src/accessorPropagation/useEntityList.cjs.map +1 -1
  24. package/dist/development/src/accessorPropagation/useEntityList.js.map +1 -1
  25. package/dist/development/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
  26. package/dist/development/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
  27. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
  28. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
  29. package/dist/development/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
  30. package/dist/development/src/accessorPropagation/useEntitySubTree.js.map +1 -1
  31. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
  32. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
  33. package/dist/development/src/accessorPropagation/useEnvironment.cjs.map +1 -1
  34. package/dist/development/src/accessorPropagation/useEnvironment.js.map +1 -1
  35. package/dist/development/src/accessorPropagation/useExtendTree.cjs.map +1 -1
  36. package/dist/development/src/accessorPropagation/useExtendTree.js.map +1 -1
  37. package/dist/development/src/accessorPropagation/useField.cjs.map +1 -1
  38. package/dist/development/src/accessorPropagation/useField.js.map +1 -1
  39. package/dist/development/src/accessorPropagation/useGetEntityByKey.cjs.map +1 -1
  40. package/dist/development/src/accessorPropagation/useGetEntityByKey.js.map +1 -1
  41. package/dist/development/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
  42. package/dist/development/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
  43. package/dist/development/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
  44. package/dist/development/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
  45. package/dist/development/src/accessorPropagation/useHasEntity.cjs.map +1 -1
  46. package/dist/development/src/accessorPropagation/useHasEntity.js.map +1 -1
  47. package/dist/development/src/accessorPropagation/usePersist.cjs.map +1 -1
  48. package/dist/development/src/accessorPropagation/usePersist.js.map +1 -1
  49. package/dist/development/src/accessorPropagation/useTreeRootId.cjs.map +1 -1
  50. package/dist/development/src/accessorPropagation/useTreeRootId.js.map +1 -1
  51. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
  52. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  53. package/dist/development/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
  54. package/dist/development/src/accessorSorting/addEntityAtIndex.js.map +1 -1
  55. package/dist/development/src/accessorTree/AccessorTree.cjs.map +1 -1
  56. package/dist/development/src/accessorTree/AccessorTree.js.map +1 -1
  57. package/dist/development/src/accessorTree/AccessorTreeStateContext.cjs.map +1 -1
  58. package/dist/development/src/accessorTree/AccessorTreeStateContext.js.map +1 -1
  59. package/dist/development/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
  60. package/dist/development/src/accessorTree/useAccessorTreeState.js.map +1 -1
  61. package/dist/development/src/accessorTree/useDataBinding.cjs.map +1 -1
  62. package/dist/development/src/accessorTree/useDataBinding.js.map +1 -1
  63. package/dist/development/src/accessorTree/useDirtinessState.cjs.map +1 -1
  64. package/dist/development/src/accessorTree/useDirtinessState.js.map +1 -1
  65. package/dist/development/src/accessorTree/useMutationState.cjs.map +1 -1
  66. package/dist/development/src/accessorTree/useMutationState.js.map +1 -1
  67. package/dist/development/src/coreComponents/Component.cjs.map +1 -1
  68. package/dist/development/src/coreComponents/Component.js.map +1 -1
  69. package/dist/development/src/coreComponents/DataBindingProvider.cjs.map +1 -1
  70. package/dist/development/src/coreComponents/DataBindingProvider.js.map +1 -1
  71. package/dist/development/src/coreComponents/Entity.cjs.map +1 -1
  72. package/dist/development/src/coreComponents/Entity.js.map +1 -1
  73. package/dist/development/src/coreComponents/EntityList.cjs.map +1 -1
  74. package/dist/development/src/coreComponents/EntityList.js.map +1 -1
  75. package/dist/development/src/coreComponents/EntityListSubTree.cjs.map +1 -1
  76. package/dist/development/src/coreComponents/EntityListSubTree.js.map +1 -1
  77. package/dist/development/src/coreComponents/EntitySubTree.cjs.map +1 -1
  78. package/dist/development/src/coreComponents/EntitySubTree.js.map +1 -1
  79. package/dist/development/src/coreComponents/Field.cjs.map +1 -1
  80. package/dist/development/src/coreComponents/Field.js.map +1 -1
  81. package/dist/development/src/coreComponents/HasMany.cjs.map +1 -1
  82. package/dist/development/src/coreComponents/HasMany.js.map +1 -1
  83. package/dist/development/src/coreComponents/HasOne.cjs.map +1 -1
  84. package/dist/development/src/coreComponents/HasOne.js.map +1 -1
  85. package/dist/development/src/coreComponents/ParentEntity.cjs.map +1 -1
  86. package/dist/development/src/coreComponents/ParentEntity.js.map +1 -1
  87. package/dist/development/src/entityEvents/useDataBindingEvent.cjs.map +1 -1
  88. package/dist/development/src/entityEvents/useDataBindingEvent.js.map +1 -1
  89. package/dist/development/src/entityEvents/useDerivedField.cjs.map +1 -1
  90. package/dist/development/src/entityEvents/useDerivedField.js.map +1 -1
  91. package/dist/development/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
  92. package/dist/development/src/entityEvents/useEntityBeforePersist.js.map +1 -1
  93. package/dist/development/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
  94. package/dist/development/src/entityEvents/useEntityBeforeUpdate.js.map +1 -1
  95. package/dist/development/src/entityEvents/useEntityEvent.cjs.map +1 -1
  96. package/dist/development/src/entityEvents/useEntityEvent.js.map +1 -1
  97. package/dist/development/src/entityEvents/useEntityPersistError.cjs.map +1 -1
  98. package/dist/development/src/entityEvents/useEntityPersistError.js.map +1 -1
  99. package/dist/development/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
  100. package/dist/development/src/entityEvents/useEntityPersistSuccess.js.map +1 -1
  101. package/dist/development/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
  102. package/dist/development/src/entityEvents/useOnConnectionUpdate.js.map +1 -1
  103. package/dist/development/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
  104. package/dist/development/src/helperComponents/DeferredSubTrees.js.map +1 -1
  105. package/dist/development/src/helperComponents/DeleteEntityTrigger.cjs.map +1 -1
  106. package/dist/development/src/helperComponents/DeleteEntityTrigger.js.map +1 -1
  107. package/dist/development/src/helperComponents/DimensionRenderer.cjs.map +1 -1
  108. package/dist/development/src/helperComponents/DimensionRenderer.js.map +1 -1
  109. package/dist/development/src/helperComponents/EntityView.cjs.map +1 -1
  110. package/dist/development/src/helperComponents/EntityView.js.map +1 -1
  111. package/dist/development/src/helperComponents/FieldView.cjs.map +1 -1
  112. package/dist/development/src/helperComponents/FieldView.js.map +1 -1
  113. package/dist/development/src/helperComponents/If.cjs.map +1 -1
  114. package/dist/development/src/helperComponents/If.js.map +1 -1
  115. package/dist/development/src/helperComponents/LabelMiddleware.cjs.map +1 -1
  116. package/dist/development/src/helperComponents/LabelMiddleware.js.map +1 -1
  117. package/dist/development/src/helperComponents/RecursionTerminator.cjs.map +1 -1
  118. package/dist/development/src/helperComponents/RecursionTerminator.js.map +1 -1
  119. package/dist/development/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -1
  120. package/dist/development/src/helperComponents/RecursionTerminatorPortal.js.map +1 -1
  121. package/dist/development/src/helperComponents/StaticRender.cjs.map +1 -1
  122. package/dist/development/src/helperComponents/StaticRender.js.map +1 -1
  123. package/dist/development/src/helperComponents/SugaredField.cjs.map +1 -1
  124. package/dist/development/src/helperComponents/SugaredField.js.map +1 -1
  125. package/dist/development/src/helperComponents/Variable.cjs.map +1 -1
  126. package/dist/development/src/helperComponents/Variable.js.map +1 -1
  127. package/dist/development/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
  128. package/dist/development/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  129. package/dist/development/src/helperComponents/helpers/evaluateCondition.cjs +33 -0
  130. package/dist/development/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
  131. package/dist/development/src/helperComponents/helpers/evaluateCondition.js +33 -0
  132. package/dist/development/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
  133. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.cjs.map +1 -1
  134. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.js.map +1 -1
  135. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.cjs.map +1 -1
  136. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.js.map +1 -1
  137. package/dist/development/src/helperComponents/persist/PersistOnKey.cjs.map +1 -1
  138. package/dist/development/src/helperComponents/persist/PersistOnKey.js.map +1 -1
  139. package/dist/development/src/helperComponents/persist/PersistTrigger.cjs +1 -1
  140. package/dist/development/src/helperComponents/persist/PersistTrigger.cjs.map +1 -1
  141. package/dist/development/src/helperComponents/persist/PersistTrigger.js +1 -1
  142. package/dist/development/src/helperComponents/persist/PersistTrigger.js.map +1 -1
  143. package/dist/development/src/helperComponents/persist/useDecoratedPersist.cjs.map +1 -1
  144. package/dist/development/src/helperComponents/persist/useDecoratedPersist.js.map +1 -1
  145. package/dist/development/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
  146. package/dist/development/src/markers/MarkerStaticAnalyzer.js.map +1 -1
  147. package/dist/development/src/markers/MarkerTreeGenerator.cjs.map +1 -1
  148. package/dist/development/src/markers/MarkerTreeGenerator.js.map +1 -1
  149. package/dist/production/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
  150. package/dist/production/src/accessorPropagation/AccessorProvider.js.map +1 -1
  151. package/dist/production/src/accessorPropagation/BindingOperationsProvider.cjs.map +1 -1
  152. package/dist/production/src/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  153. package/dist/production/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
  154. package/dist/production/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
  155. package/dist/production/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
  156. package/dist/production/src/accessorPropagation/EnvironmentContext.js.map +1 -1
  157. package/dist/production/src/accessorPropagation/TreeRootIdProvider.cjs.map +1 -1
  158. package/dist/production/src/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  159. package/dist/production/src/accessorPropagation/useBindingOperations.cjs.map +1 -1
  160. package/dist/production/src/accessorPropagation/useBindingOperations.js.map +1 -1
  161. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
  162. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
  163. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
  164. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
  165. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
  166. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
  167. package/dist/production/src/accessorPropagation/useEntity.cjs.map +1 -1
  168. package/dist/production/src/accessorPropagation/useEntity.js.map +1 -1
  169. package/dist/production/src/accessorPropagation/useEntityKey.cjs.map +1 -1
  170. package/dist/production/src/accessorPropagation/useEntityKey.js.map +1 -1
  171. package/dist/production/src/accessorPropagation/useEntityList.cjs.map +1 -1
  172. package/dist/production/src/accessorPropagation/useEntityList.js.map +1 -1
  173. package/dist/production/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
  174. package/dist/production/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
  175. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
  176. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
  177. package/dist/production/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
  178. package/dist/production/src/accessorPropagation/useEntitySubTree.js.map +1 -1
  179. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
  180. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
  181. package/dist/production/src/accessorPropagation/useEnvironment.cjs.map +1 -1
  182. package/dist/production/src/accessorPropagation/useEnvironment.js.map +1 -1
  183. package/dist/production/src/accessorPropagation/useExtendTree.cjs.map +1 -1
  184. package/dist/production/src/accessorPropagation/useExtendTree.js.map +1 -1
  185. package/dist/production/src/accessorPropagation/useField.cjs.map +1 -1
  186. package/dist/production/src/accessorPropagation/useField.js.map +1 -1
  187. package/dist/production/src/accessorPropagation/useGetEntityByKey.cjs.map +1 -1
  188. package/dist/production/src/accessorPropagation/useGetEntityByKey.js.map +1 -1
  189. package/dist/production/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
  190. package/dist/production/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
  191. package/dist/production/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
  192. package/dist/production/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
  193. package/dist/production/src/accessorPropagation/useHasEntity.cjs.map +1 -1
  194. package/dist/production/src/accessorPropagation/useHasEntity.js.map +1 -1
  195. package/dist/production/src/accessorPropagation/usePersist.cjs.map +1 -1
  196. package/dist/production/src/accessorPropagation/usePersist.js.map +1 -1
  197. package/dist/production/src/accessorPropagation/useTreeRootId.cjs.map +1 -1
  198. package/dist/production/src/accessorPropagation/useTreeRootId.js.map +1 -1
  199. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
  200. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  201. package/dist/production/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
  202. package/dist/production/src/accessorSorting/addEntityAtIndex.js.map +1 -1
  203. package/dist/production/src/accessorTree/AccessorTree.cjs.map +1 -1
  204. package/dist/production/src/accessorTree/AccessorTree.js.map +1 -1
  205. package/dist/production/src/accessorTree/AccessorTreeStateContext.cjs.map +1 -1
  206. package/dist/production/src/accessorTree/AccessorTreeStateContext.js.map +1 -1
  207. package/dist/production/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
  208. package/dist/production/src/accessorTree/useAccessorTreeState.js.map +1 -1
  209. package/dist/production/src/accessorTree/useDataBinding.cjs.map +1 -1
  210. package/dist/production/src/accessorTree/useDataBinding.js.map +1 -1
  211. package/dist/production/src/accessorTree/useDirtinessState.cjs.map +1 -1
  212. package/dist/production/src/accessorTree/useDirtinessState.js.map +1 -1
  213. package/dist/production/src/accessorTree/useMutationState.cjs.map +1 -1
  214. package/dist/production/src/accessorTree/useMutationState.js.map +1 -1
  215. package/dist/production/src/coreComponents/Component.cjs.map +1 -1
  216. package/dist/production/src/coreComponents/Component.js.map +1 -1
  217. package/dist/production/src/coreComponents/DataBindingProvider.cjs.map +1 -1
  218. package/dist/production/src/coreComponents/DataBindingProvider.js.map +1 -1
  219. package/dist/production/src/coreComponents/Entity.cjs.map +1 -1
  220. package/dist/production/src/coreComponents/Entity.js.map +1 -1
  221. package/dist/production/src/coreComponents/EntityList.cjs.map +1 -1
  222. package/dist/production/src/coreComponents/EntityList.js.map +1 -1
  223. package/dist/production/src/coreComponents/EntityListSubTree.cjs.map +1 -1
  224. package/dist/production/src/coreComponents/EntityListSubTree.js.map +1 -1
  225. package/dist/production/src/coreComponents/EntitySubTree.cjs.map +1 -1
  226. package/dist/production/src/coreComponents/EntitySubTree.js.map +1 -1
  227. package/dist/production/src/coreComponents/Field.cjs.map +1 -1
  228. package/dist/production/src/coreComponents/Field.js.map +1 -1
  229. package/dist/production/src/coreComponents/HasMany.cjs.map +1 -1
  230. package/dist/production/src/coreComponents/HasMany.js.map +1 -1
  231. package/dist/production/src/coreComponents/HasOne.cjs.map +1 -1
  232. package/dist/production/src/coreComponents/HasOne.js.map +1 -1
  233. package/dist/production/src/coreComponents/ParentEntity.cjs.map +1 -1
  234. package/dist/production/src/coreComponents/ParentEntity.js.map +1 -1
  235. package/dist/production/src/entityEvents/useDataBindingEvent.cjs.map +1 -1
  236. package/dist/production/src/entityEvents/useDataBindingEvent.js.map +1 -1
  237. package/dist/production/src/entityEvents/useDerivedField.cjs.map +1 -1
  238. package/dist/production/src/entityEvents/useDerivedField.js.map +1 -1
  239. package/dist/production/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
  240. package/dist/production/src/entityEvents/useEntityBeforePersist.js.map +1 -1
  241. package/dist/production/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
  242. package/dist/production/src/entityEvents/useEntityBeforeUpdate.js.map +1 -1
  243. package/dist/production/src/entityEvents/useEntityEvent.cjs.map +1 -1
  244. package/dist/production/src/entityEvents/useEntityEvent.js.map +1 -1
  245. package/dist/production/src/entityEvents/useEntityPersistError.cjs.map +1 -1
  246. package/dist/production/src/entityEvents/useEntityPersistError.js.map +1 -1
  247. package/dist/production/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
  248. package/dist/production/src/entityEvents/useEntityPersistSuccess.js.map +1 -1
  249. package/dist/production/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
  250. package/dist/production/src/entityEvents/useOnConnectionUpdate.js.map +1 -1
  251. package/dist/production/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
  252. package/dist/production/src/helperComponents/DeferredSubTrees.js.map +1 -1
  253. package/dist/production/src/helperComponents/DeleteEntityTrigger.cjs.map +1 -1
  254. package/dist/production/src/helperComponents/DeleteEntityTrigger.js.map +1 -1
  255. package/dist/production/src/helperComponents/DimensionRenderer.cjs.map +1 -1
  256. package/dist/production/src/helperComponents/DimensionRenderer.js.map +1 -1
  257. package/dist/production/src/helperComponents/EntityView.cjs.map +1 -1
  258. package/dist/production/src/helperComponents/EntityView.js.map +1 -1
  259. package/dist/production/src/helperComponents/FieldView.cjs.map +1 -1
  260. package/dist/production/src/helperComponents/FieldView.js.map +1 -1
  261. package/dist/production/src/helperComponents/If.cjs.map +1 -1
  262. package/dist/production/src/helperComponents/If.js.map +1 -1
  263. package/dist/production/src/helperComponents/LabelMiddleware.cjs.map +1 -1
  264. package/dist/production/src/helperComponents/LabelMiddleware.js.map +1 -1
  265. package/dist/production/src/helperComponents/RecursionTerminator.cjs.map +1 -1
  266. package/dist/production/src/helperComponents/RecursionTerminator.js.map +1 -1
  267. package/dist/production/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -1
  268. package/dist/production/src/helperComponents/RecursionTerminatorPortal.js.map +1 -1
  269. package/dist/production/src/helperComponents/StaticRender.cjs.map +1 -1
  270. package/dist/production/src/helperComponents/StaticRender.js.map +1 -1
  271. package/dist/production/src/helperComponents/SugaredField.cjs.map +1 -1
  272. package/dist/production/src/helperComponents/SugaredField.js.map +1 -1
  273. package/dist/production/src/helperComponents/Variable.cjs.map +1 -1
  274. package/dist/production/src/helperComponents/Variable.js.map +1 -1
  275. package/dist/production/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
  276. package/dist/production/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  277. package/dist/production/src/helperComponents/helpers/evaluateCondition.cjs +33 -0
  278. package/dist/production/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
  279. package/dist/production/src/helperComponents/helpers/evaluateCondition.js +33 -0
  280. package/dist/production/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
  281. package/dist/production/src/helperComponents/persist/PersistOnFieldChange.cjs.map +1 -1
  282. package/dist/production/src/helperComponents/persist/PersistOnFieldChange.js.map +1 -1
  283. package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.cjs.map +1 -1
  284. package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.js.map +1 -1
  285. package/dist/production/src/helperComponents/persist/PersistOnKey.cjs.map +1 -1
  286. package/dist/production/src/helperComponents/persist/PersistOnKey.js.map +1 -1
  287. package/dist/production/src/helperComponents/persist/PersistTrigger.cjs.map +1 -1
  288. package/dist/production/src/helperComponents/persist/PersistTrigger.js.map +1 -1
  289. package/dist/production/src/helperComponents/persist/useDecoratedPersist.cjs.map +1 -1
  290. package/dist/production/src/helperComponents/persist/useDecoratedPersist.js.map +1 -1
  291. package/dist/production/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
  292. package/dist/production/src/markers/MarkerStaticAnalyzer.js.map +1 -1
  293. package/dist/production/src/markers/MarkerTreeGenerator.cjs.map +1 -1
  294. package/dist/production/src/markers/MarkerTreeGenerator.js.map +1 -1
  295. package/dist/types/accessorPropagation/index.d.ts +28 -28
  296. package/dist/types/accessorPropagation/index.d.ts.map +1 -1
  297. package/dist/types/accessorSorting/index.d.ts +5 -5
  298. package/dist/types/accessorSorting/index.d.ts.map +1 -1
  299. package/dist/types/accessorTree/AccessorTree.d.ts +1 -1
  300. package/dist/types/accessorTree/AccessorTree.d.ts.map +1 -1
  301. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +1 -1
  302. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +1 -1
  303. package/dist/types/accessorTree/index.d.ts +11 -11
  304. package/dist/types/accessorTree/index.d.ts.map +1 -1
  305. package/dist/types/accessorTree/useAccessorTreeState.d.ts +1 -1
  306. package/dist/types/accessorTree/useAccessorTreeState.d.ts.map +1 -1
  307. package/dist/types/accessorTree/useDataBinding.d.ts +1 -1
  308. package/dist/types/accessorTree/useDataBinding.d.ts.map +1 -1
  309. package/dist/types/coreComponents/Component.d.ts +1 -1
  310. package/dist/types/coreComponents/Component.d.ts.map +1 -1
  311. package/dist/types/coreComponents/DataBindingProvider.d.ts +1 -1
  312. package/dist/types/coreComponents/DataBindingProvider.d.ts.map +1 -1
  313. package/dist/types/coreComponents/EntityListSubTree.d.ts +1 -1
  314. package/dist/types/coreComponents/EntityListSubTree.d.ts.map +1 -1
  315. package/dist/types/coreComponents/EntitySubTree.d.ts +1 -1
  316. package/dist/types/coreComponents/EntitySubTree.d.ts.map +1 -1
  317. package/dist/types/coreComponents/HasMany.d.ts +1 -1
  318. package/dist/types/coreComponents/HasMany.d.ts.map +1 -1
  319. package/dist/types/coreComponents/index.d.ts +10 -10
  320. package/dist/types/coreComponents/index.d.ts.map +1 -1
  321. package/dist/types/entityEvents/index.d.ts +8 -8
  322. package/dist/types/entityEvents/index.d.ts.map +1 -1
  323. package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts +1 -1
  324. package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts.map +1 -1
  325. package/dist/types/helperComponents/SugaredField.d.ts +1 -1
  326. package/dist/types/helperComponents/SugaredField.d.ts.map +1 -1
  327. package/dist/types/helperComponents/helpers/evaluateCondition.d.ts.map +1 -1
  328. package/dist/types/helperComponents/index.d.ts +13 -13
  329. package/dist/types/helperComponents/index.d.ts.map +1 -1
  330. package/dist/types/helperComponents/persist/PersistTrigger.d.ts +3 -0
  331. package/dist/types/helperComponents/persist/PersistTrigger.d.ts.map +1 -1
  332. package/dist/types/helperComponents/persist/index.d.ts +4 -4
  333. package/dist/types/helperComponents/persist/index.d.ts.map +1 -1
  334. package/dist/types/index.d.ts +7 -7
  335. package/dist/types/index.d.ts.map +1 -1
  336. package/dist/types/markers/index.d.ts +2 -2
  337. package/dist/types/markers/index.d.ts.map +1 -1
  338. package/dist/types/tsconfig.tsbuildinfo +1 -1
  339. package/package.json +7 -8
  340. package/src/accessorPropagation/AccessorProvider.tsx +2 -2
  341. package/src/accessorPropagation/BindingOperationsProvider.tsx +1 -1
  342. package/src/accessorPropagation/EntityKeyProvider.tsx +1 -1
  343. package/src/accessorPropagation/EnvironmentContext.tsx +2 -2
  344. package/src/accessorPropagation/TreeRootIdProvider.tsx +1 -1
  345. package/src/accessorPropagation/index.ts +31 -31
  346. package/src/accessorPropagation/useBindingOperations.ts +1 -1
  347. package/src/accessorPropagation/useDesugaredRelativeEntityList.ts +1 -1
  348. package/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts +1 -1
  349. package/src/accessorPropagation/useDesugaredRelativeSingleField.ts +1 -1
  350. package/src/accessorPropagation/useEntity.ts +4 -4
  351. package/src/accessorPropagation/useEntityKey.ts +1 -1
  352. package/src/accessorPropagation/useEntityList.ts +4 -4
  353. package/src/accessorPropagation/useEntityListSubTree.ts +3 -3
  354. package/src/accessorPropagation/useEntityListSubTreeLoader.ts +3 -3
  355. package/src/accessorPropagation/useEntitySubTree.ts +3 -3
  356. package/src/accessorPropagation/useEntitySubTreeLoader.ts +2 -2
  357. package/src/accessorPropagation/useEnvironment.ts +1 -1
  358. package/src/accessorPropagation/useExtendTree.ts +2 -2
  359. package/src/accessorPropagation/useField.ts +4 -4
  360. package/src/accessorPropagation/useGetEntityByKey.ts +1 -1
  361. package/src/accessorPropagation/useGetEntityListSubTree.ts +3 -3
  362. package/src/accessorPropagation/useGetEntitySubTree.ts +3 -3
  363. package/src/accessorPropagation/useHasEntity.ts +1 -1
  364. package/src/accessorPropagation/usePersist.ts +1 -1
  365. package/src/accessorPropagation/useTreeRootId.ts +1 -1
  366. package/src/accessorSorting/SetOrderFieldOnCreate.tsx +3 -3
  367. package/src/accessorSorting/addEntityAtIndex.ts +2 -2
  368. package/src/accessorSorting/index.ts +5 -5
  369. package/src/accessorTree/AccessorTree.tsx +6 -6
  370. package/src/accessorTree/AccessorTreeStateContext.ts +1 -1
  371. package/src/accessorTree/index.ts +11 -11
  372. package/src/accessorTree/useAccessorTreeState.ts +1 -1
  373. package/src/accessorTree/useDataBinding.ts +4 -4
  374. package/src/accessorTree/useDirtinessState.ts +1 -1
  375. package/src/accessorTree/useMutationState.ts +1 -1
  376. package/src/coreComponents/Component.tsx +2 -2
  377. package/src/coreComponents/DataBindingProvider.tsx +1 -1
  378. package/src/coreComponents/Entity.tsx +2 -2
  379. package/src/coreComponents/EntityList.tsx +2 -2
  380. package/src/coreComponents/EntityListSubTree.tsx +4 -4
  381. package/src/coreComponents/EntitySubTree.tsx +5 -5
  382. package/src/coreComponents/Field.tsx +2 -2
  383. package/src/coreComponents/HasMany.tsx +4 -4
  384. package/src/coreComponents/HasOne.tsx +4 -4
  385. package/src/coreComponents/ParentEntity.tsx +1 -1
  386. package/src/coreComponents/index.ts +10 -10
  387. package/src/entityEvents/index.ts +8 -8
  388. package/src/entityEvents/useDataBindingEvent.ts +1 -1
  389. package/src/entityEvents/useDerivedField.ts +1 -1
  390. package/src/entityEvents/useEntityBeforePersist.ts +1 -1
  391. package/src/entityEvents/useEntityBeforeUpdate.ts +1 -1
  392. package/src/entityEvents/useEntityEvent.ts +1 -1
  393. package/src/entityEvents/useEntityPersistError.ts +1 -1
  394. package/src/entityEvents/useEntityPersistSuccess.ts +1 -1
  395. package/src/entityEvents/useOnConnectionUpdate.ts +1 -1
  396. package/src/helperComponents/DeferredSubTrees.tsx +4 -4
  397. package/src/helperComponents/DeleteEntityTrigger.tsx +3 -3
  398. package/src/helperComponents/DimensionRenderer.tsx +2 -2
  399. package/src/helperComponents/EntityView.tsx +1 -1
  400. package/src/helperComponents/FieldView.tsx +3 -3
  401. package/src/helperComponents/If.tsx +4 -4
  402. package/src/helperComponents/LabelMiddleware.tsx +1 -1
  403. package/src/helperComponents/RecursionTerminator.tsx +1 -1
  404. package/src/helperComponents/RecursionTerminatorPortal.tsx +3 -3
  405. package/src/helperComponents/StaticRender.tsx +1 -1
  406. package/src/helperComponents/SugaredField.tsx +1 -1
  407. package/src/helperComponents/Variable.tsx +1 -1
  408. package/src/helperComponents/helpers/FilterEvaluator.ts +1 -1
  409. package/src/helperComponents/helpers/evaluateCondition.ts +33 -0
  410. package/src/helperComponents/index.ts +13 -13
  411. package/src/helperComponents/persist/PersistOnFieldChange.tsx +3 -3
  412. package/src/helperComponents/persist/PersistOnHasOneChange.tsx +3 -3
  413. package/src/helperComponents/persist/PersistOnKey.tsx +1 -1
  414. package/src/helperComponents/persist/PersistTrigger.tsx +5 -2
  415. package/src/helperComponents/persist/index.tsx +4 -4
  416. package/src/helperComponents/persist/useDecoratedPersist.ts +1 -1
  417. package/src/index.ts +7 -7
  418. package/src/markers/MarkerStaticAnalyzer.ts +2 -2
  419. package/src/markers/MarkerTreeGenerator.ts +1 -1
  420. package/src/markers/index.ts +2 -2
  421. package/tests/cases/unit/core/entityOperations.test.tsx +3 -3
  422. package/tests/cases/unit/core/eventManager.test.tsx +3 -3
  423. package/tests/cases/unit/helperComponents/FilterEvaluator.spec.ts +3 -3
  424. package/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts +2 -2
  425. package/tests/cases/unit/helperComponents/evaluateCondition.spec.ts +1 -1
  426. package/tests/cases/unit/model/markerTreeGenerator.spec.tsx +1 -1
  427. package/tests/lib/bindingFactory.ts +1 -1
@@ -1 +1 @@
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\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\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>(\n\tentities: SugaredQualifiedEntityList | undefined,\n\tchildren: ReactNode,\n\tstate?: State,\n): [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\t{\n\t\t\tentities: SugaredQualifiedEntityList\n\t\t\tstate?: State\n\t\t} | undefined\n\t>(undefined)\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst 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":";;;;AA2DA,MAAM,cAAc,CAAA;AAEb,MAAM,6BAA6B,CACzC,UACA,UACA,UACsF;AACtF,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,OAKvB,MAAS;AAEX,QAAM,aAAa,cAAA;AACnB,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,IAAI;AACtE,QAAM,mBAAmB,cAAc,YAAY,WAAW;AAC9D,QAAM,mBAAmB,WAAW,mBAAmB;AAEvD,YAAU,MAAM;AACd,KAAC,YAAY;AACb,UAAI,CAAC,kBAAkB;AACtB;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B,UAAU;AAAA,QACV;AAAA,MAAA;AAGD,wBAAkB,CAAA,OAAM;AACvB,YAAI,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AAC9E,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET,OAAO;AACN,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET;AAAA,MACD,CAAC;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3B,cAAc,mBAAmB;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAA,MAAK;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAE3B,8BAAkB;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,UAAU;AAAA,cACV,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UACF;AAAA,QAAA;AAAA,MACD;AAGD,UAAI,eAAe;AAClB,yBAAiB,UAAU;AAC3B,0BAAkB;AAAA,UACjB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MACF;AAAA,IACD,GAAA;AAAA,EACD,GAAG,CAAC,YAAY,kBAAkB,UAAU,OAAO,aAAa,CAAC;AAEjE,SAAO;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAA,CAAE;AAAA,IAAA;AAAA,EACnD;AAEF;"}
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.js'\nimport { EntityListSubTree } from '../coreComponents/index.js'\nimport { useEnvironment } from './useEnvironment.js'\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\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\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>(\n\tentities: SugaredQualifiedEntityList | undefined,\n\tchildren: ReactNode,\n\tstate?: State,\n): [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\t{\n\t\t\tentities: SugaredQualifiedEntityList\n\t\t\tstate?: State\n\t\t} | undefined\n\t>(undefined)\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst 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":";;;;AA2DA,MAAM,cAAc,CAAA;AAEb,MAAM,6BAA6B,CACzC,UACA,UACA,UACsF;AACtF,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,OAKvB,MAAS;AAEX,QAAM,aAAa,cAAA;AACnB,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,IAAI;AACtE,QAAM,mBAAmB,cAAc,YAAY,WAAW;AAC9D,QAAM,mBAAmB,WAAW,mBAAmB;AAEvD,YAAU,MAAM;AACd,KAAC,YAAY;AACb,UAAI,CAAC,kBAAkB;AACtB;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B,UAAU;AAAA,QACV;AAAA,MAAA;AAGD,wBAAkB,CAAA,OAAM;AACvB,YAAI,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AAC9E,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET,OAAO;AACN,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET;AAAA,MACD,CAAC;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3B,cAAc,mBAAmB;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAA,MAAK;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAE3B,8BAAkB;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,UAAU;AAAA,cACV,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UACF;AAAA,QAAA;AAAA,MACD;AAGD,UAAI,eAAe;AAClB,yBAAiB,UAAU;AAC3B,0BAAkB;AAAA,UACjB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MACF;AAAA,IACD,GAAA;AAAA,EACD,GAAG,CAAC,YAAY,kBAAkB,UAAU,OAAO,aAAa,CAAC;AAEjE,SAAO;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAA,CAAE;AAAA,IAAA;AAAA,EACnD;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { Alias, EntityAccessor, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\nimport { TreeRootId } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\n\nexport const useEntitySubTree = (\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityAccessor => {\n\tconst getSubTree = useGetEntitySubTree()\n\tconst parameters = useEntitySubTreeParameters(qualifiedSingleEntity)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntitySubTree: cannot use hasOneRelationPath!`)\n\t// }\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntitySubTree","useEntitySubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAOO,MAAM,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAaA,oBAAAA,oBAAA;AACnB,QAAM,aAAaC,2BAAAA,2BAA2B,qBAAqB;AACnE,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAAA;AAAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAM9C,SAAOC,8BAAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;;"}
1
+ {"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.js'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters.js'\nimport { useGetEntitySubTree } from './useGetEntitySubTree.js'\n\nexport const useEntitySubTree = (\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityAccessor => {\n\tconst getSubTree = useGetEntitySubTree()\n\tconst parameters = useEntitySubTreeParameters(qualifiedSingleEntity)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntitySubTree: cannot use hasOneRelationPath!`)\n\t// }\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntitySubTree","useEntitySubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAOO,MAAM,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAaA,oBAAAA,oBAAA;AACnB,QAAM,aAAaC,2BAAAA,2BAA2B,qBAAqB;AACnE,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAAA;AAAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAM9C,SAAOC,8BAAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { Alias, EntityAccessor, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\nimport { TreeRootId } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\n\nexport const useEntitySubTree = (\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityAccessor => {\n\tconst getSubTree = useGetEntitySubTree()\n\tconst parameters = useEntitySubTreeParameters(qualifiedSingleEntity)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntitySubTree: cannot use hasOneRelationPath!`)\n\t// }\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAa,oBAAA;AACnB,QAAM,aAAa,2BAA2B,qBAAqB;AACnE,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAM9C,SAAO,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
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.js'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters.js'\nimport { useGetEntitySubTree } from './useGetEntitySubTree.js'\n\nexport const useEntitySubTree = (\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityAccessor => {\n\tconst getSubTree = useGetEntitySubTree()\n\tconst parameters = useEntitySubTreeParameters(qualifiedSingleEntity)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntitySubTree: cannot use hasOneRelationPath!`)\n\t// }\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAa,oBAAA;AACnB,QAAM,aAAa,2BAA2B,qBAAqB;AACnE,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAAA;AAM9C,SAAO,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(\n\tentity: SugaredQualifiedSingleEntity | undefined,\n\tchildren: ReactNode,\n\tstate?: State,\n): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<\n\t\t{\n\t\t\tentity: SugaredQualifiedSingleEntity\n\t\t\tstate?: State\n\t\t} | undefined\n\t>(undefined)\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t;(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntitySubTree","useCallback"],"mappings":";;;;;;AA4DA,MAAM,cAAc,CAAA;AAEb,MAAM,yBAAyB,CACrC,QACA,UACA,UAC8E;AAC9E,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAA6C;AAAA,IACxF,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmBC,MAAAA,OAKvB,MAAS;AAEX,QAAM,aAAaC,cAAAA,cAAA;AACnB,QAAM,CAAC,eAAe,gBAAgB,IAAIF,MAAAA,SAAwB,IAAI;AACtE,QAAM,iBAAiBG,WAAAA,cAAc,UAAU,WAAW;AAC1D,QAAM,iBAAiB,SAAS,iBAAiB;AAEjDC,QAAAA,UAAU,MAAM;AACd,KAAC,YAAY;AACb,UAAI,CAAC,gBAAgB;AACpB;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,MAAA;AAGD,wBAAkB,CAAA,OAAM;AACvB,YAAI,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AAC9E,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET,OAAO;AACN,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET;AAAA,MACD,CAAC;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,cAAAA,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAA,MAAK;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAE3B,8BAAkB;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UACF;AAAA,QAAA;AAAA,MACD;AAGD,UAAI,eAAe;AAClB,yBAAiB,UAAU;AAC3B,0BAAkB;AAAA,UACjB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MACF;AAAA,IACD,GAAA;AAAA,EACD,GAAG,CAAC,YAAY,gBAAgB,UAAU,OAAO,aAAa,CAAC;AAE/D,SAAO;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQC,MAAAA,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAA,CAAE;AAAA,IAAA;AAAA,EACnD;AAEF;;"}
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.js'\nimport { EntitySubTree } from '../coreComponents/index.js'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(\n\tentity: SugaredQualifiedSingleEntity | undefined,\n\tchildren: ReactNode,\n\tstate?: State,\n): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<\n\t\t{\n\t\t\tentity: SugaredQualifiedSingleEntity\n\t\t\tstate?: State\n\t\t} | undefined\n\t>(undefined)\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t;(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntitySubTree","useCallback"],"mappings":";;;;;;AA4DA,MAAM,cAAc,CAAA;AAEb,MAAM,yBAAyB,CACrC,QACA,UACA,UAC8E;AAC9E,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAA6C;AAAA,IACxF,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmBC,MAAAA,OAKvB,MAAS;AAEX,QAAM,aAAaC,cAAAA,cAAA;AACnB,QAAM,CAAC,eAAe,gBAAgB,IAAIF,MAAAA,SAAwB,IAAI;AACtE,QAAM,iBAAiBG,WAAAA,cAAc,UAAU,WAAW;AAC1D,QAAM,iBAAiB,SAAS,iBAAiB;AAEjDC,QAAAA,UAAU,MAAM;AACd,KAAC,YAAY;AACb,UAAI,CAAC,gBAAgB;AACpB;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,MAAA;AAGD,wBAAkB,CAAA,OAAM;AACvB,YAAI,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AAC9E,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET,OAAO;AACN,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET;AAAA,MACD,CAAC;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,cAAAA,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAA,MAAK;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAE3B,8BAAkB;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UACF;AAAA,QAAA;AAAA,MACD;AAGD,UAAI,eAAe;AAClB,yBAAiB,UAAU;AAC3B,0BAAkB;AAAA,UACjB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MACF;AAAA,IACD,GAAA;AAAA,EACD,GAAG,CAAC,YAAY,gBAAgB,UAAU,OAAO,aAAa,CAAC;AAE/D,SAAO;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQC,MAAAA,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAA,CAAE;AAAA,IAAA;AAAA,EACnD;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTreeLoader.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(\n\tentity: SugaredQualifiedSingleEntity | undefined,\n\tchildren: ReactNode,\n\tstate?: State,\n): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<\n\t\t{\n\t\t\tentity: SugaredQualifiedSingleEntity\n\t\t\tstate?: State\n\t\t} | undefined\n\t>(undefined)\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t;(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":[],"mappings":";;;;AA4DA,MAAM,cAAc,CAAA;AAEb,MAAM,yBAAyB,CACrC,QACA,UACA,UAC8E;AAC9E,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAA6C;AAAA,IACxF,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmB,OAKvB,MAAS;AAEX,QAAM,aAAa,cAAA;AACnB,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,IAAI;AACtE,QAAM,iBAAiB,cAAc,UAAU,WAAW;AAC1D,QAAM,iBAAiB,SAAS,iBAAiB;AAEjD,YAAU,MAAM;AACd,KAAC,YAAY;AACb,UAAI,CAAC,gBAAgB;AACpB;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,MAAA;AAGD,wBAAkB,CAAA,OAAM;AACvB,YAAI,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AAC9E,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET,OAAO;AACN,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET;AAAA,MACD,CAAC;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3B,cAAc,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAA,MAAK;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAE3B,8BAAkB;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UACF;AAAA,QAAA;AAAA,MACD;AAGD,UAAI,eAAe;AAClB,yBAAiB,UAAU;AAC3B,0BAAkB;AAAA,UACjB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MACF;AAAA,IACD,GAAA;AAAA,EACD,GAAG,CAAC,YAAY,gBAAgB,UAAU,OAAO,aAAa,CAAC;AAE/D,SAAO;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAA,CAAE;AAAA,IAAA;AAAA,EACnD;AAEF;"}
1
+ {"version":3,"file":"useEntitySubTreeLoader.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree.js'\nimport { EntitySubTree } from '../coreComponents/index.js'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(\n\tentity: SugaredQualifiedSingleEntity | undefined,\n\tchildren: ReactNode,\n\tstate?: State,\n): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<\n\t\t{\n\t\t\tentity: SugaredQualifiedSingleEntity\n\t\t\tstate?: State\n\t\t} | undefined\n\t>(undefined)\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t;(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":[],"mappings":";;;;AA4DA,MAAM,cAAc,CAAA;AAEb,MAAM,yBAAyB,CACrC,QACA,UACA,UAC8E;AAC9E,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAA6C;AAAA,IACxF,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmB,OAKvB,MAAS;AAEX,QAAM,aAAa,cAAA;AACnB,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,IAAI;AACtE,QAAM,iBAAiB,cAAc,UAAU,WAAW;AAC1D,QAAM,iBAAiB,SAAS,iBAAiB;AAEjD,YAAU,MAAM;AACd,KAAC,YAAY;AACb,UAAI,CAAC,gBAAgB;AACpB;AAAA,MACD;AAEA,uBAAiB,UAAU;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,MAAA;AAGD,wBAAkB,CAAA,OAAM;AACvB,YAAI,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AAC9E,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET,OAAO;AACN,iBAAO;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UAAA;AAAA,QAET;AAAA,MACD,CAAC;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3B,cAAc,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAA,MAAK;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAE3B,8BAAkB;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UACF;AAAA,QAAA;AAAA,MACD;AAGD,UAAI,eAAe;AAClB,yBAAiB,UAAU;AAC3B,0BAAkB;AAAA,UACjB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MACF;AAAA,IACD,GAAA;AAAA,EACD,GAAG,CAAC,YAAY,gBAAgB,UAAU,OAAO,aAAa,CAAC;AAE/D,SAAO;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAA,CAAE;AAAA,IAAA;AAAA,EACnD;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEnvironment.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEnvironment.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { Environment } from '@contember/binding'\nimport { EnvironmentContext } from './EnvironmentContext'\n\nexport const useEnvironment = (): Environment => {\n\treturn useContext(EnvironmentContext)\n}\n"],"names":["useContext","EnvironmentContext"],"mappings":";;;;AAIO,MAAM,iBAAiB,MAAmB;AAChD,SAAOA,MAAAA,WAAWC,mBAAAA,kBAAkB;AACrC;;"}
1
+ {"version":3,"file":"useEnvironment.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEnvironment.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { Environment } from '@contember/binding'\nimport { EnvironmentContext } from './EnvironmentContext.js'\n\nexport const useEnvironment = (): Environment => {\n\treturn useContext(EnvironmentContext)\n}\n"],"names":["useContext","EnvironmentContext"],"mappings":";;;;AAIO,MAAM,iBAAiB,MAAmB;AAChD,SAAOA,MAAAA,WAAWC,mBAAAA,kBAAkB;AACrC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEnvironment.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEnvironment.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { Environment } from '@contember/binding'\nimport { EnvironmentContext } from './EnvironmentContext'\n\nexport const useEnvironment = (): Environment => {\n\treturn useContext(EnvironmentContext)\n}\n"],"names":[],"mappings":";;AAIO,MAAM,iBAAiB,MAAmB;AAChD,SAAO,WAAW,kBAAkB;AACrC;"}
1
+ {"version":3,"file":"useEnvironment.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEnvironment.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { Environment } from '@contember/binding'\nimport { EnvironmentContext } from './EnvironmentContext.js'\n\nexport const useEnvironment = (): Environment => {\n\treturn useContext(EnvironmentContext)\n}\n"],"names":[],"mappings":";;AAIO,MAAM,iBAAiB,MAAmB;AAChD,SAAO,WAAW,kBAAkB;AACrC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useExtendTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useExtendTree.ts"],"sourcesContent":["import { ReactNode, useCallback } from 'react'\nimport { useAbortController, useIsMounted } from '@contember/react-utils'\nimport { useBindingOperations } from './useBindingOperations'\nimport { TreeRootId } from '@contember/binding'\nimport { ExtendTreeOptions } from '@contember/binding'\nimport { DataBindingExtendAborted } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\nexport const useExtendTree = () => {\n\tconst abort = useAbortController()\n\tconst { extendTree } = useBindingOperations()\n\tconst isMountedRef = useIsMounted()\n\tconst environment = useEnvironment()\n\treturn useCallback(async (newFragment: ReactNode, options?: Omit<ExtendTreeOptions, 'signal'>): Promise<TreeRootId | undefined> => {\n\t\ttry {\n\t\t\tconst newTreeRootId = await extendTree(newFragment, { environment, ...options, signal: abort() })\n\t\t\tif (!isMountedRef.current) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn newTreeRootId\n\t\t} catch (e) {\n\t\t\tif (e === DataBindingExtendAborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}, [abort, environment, extendTree, isMountedRef])\n}\n"],"names":["useAbortController","useBindingOperations","useIsMounted","useEnvironment","useCallback","DataBindingExtendAborted"],"mappings":";;;;;;;AAQO,MAAM,gBAAgB,MAAM;AAClC,QAAM,QAAQA,WAAAA,mBAAA;AACd,QAAM,EAAE,WAAA,IAAeC,0CAAA;AACvB,QAAM,eAAeC,WAAAA,aAAA;AACrB,QAAM,cAAcC,eAAAA,eAAA;AACpB,SAAOC,MAAAA,YAAY,OAAO,aAAwB,YAAiF;AAClI,QAAI;AACH,YAAM,gBAAgB,MAAM,WAAW,aAAa,EAAE,aAAa,GAAG,SAAS,QAAQ,MAAA,GAAS;AAChG,UAAI,CAAC,aAAa,SAAS;AAC1B;AAAA,MACD;AACA,aAAO;AAAA,IACR,SAAS,GAAG;AACX,UAAI,MAAMC,QAAAA,0BAA0B;AACnC;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD,GAAG,CAAC,OAAO,aAAa,YAAY,YAAY,CAAC;AAClD;;"}
1
+ {"version":3,"file":"useExtendTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useExtendTree.ts"],"sourcesContent":["import { ReactNode, useCallback } from 'react'\nimport { useAbortController, useIsMounted } from '@contember/react-utils'\nimport { useBindingOperations } from './useBindingOperations.js'\nimport { TreeRootId } from '@contember/binding'\nimport { ExtendTreeOptions } from '@contember/binding'\nimport { DataBindingExtendAborted } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment.js'\n\nexport const useExtendTree = () => {\n\tconst abort = useAbortController()\n\tconst { extendTree } = useBindingOperations()\n\tconst isMountedRef = useIsMounted()\n\tconst environment = useEnvironment()\n\treturn useCallback(async (newFragment: ReactNode, options?: Omit<ExtendTreeOptions, 'signal'>): Promise<TreeRootId | undefined> => {\n\t\ttry {\n\t\t\tconst newTreeRootId = await extendTree(newFragment, { environment, ...options, signal: abort() })\n\t\t\tif (!isMountedRef.current) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn newTreeRootId\n\t\t} catch (e) {\n\t\t\tif (e === DataBindingExtendAborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}, [abort, environment, extendTree, isMountedRef])\n}\n"],"names":["useAbortController","useBindingOperations","useIsMounted","useEnvironment","useCallback","DataBindingExtendAborted"],"mappings":";;;;;;;AAQO,MAAM,gBAAgB,MAAM;AAClC,QAAM,QAAQA,WAAAA,mBAAA;AACd,QAAM,EAAE,WAAA,IAAeC,0CAAA;AACvB,QAAM,eAAeC,WAAAA,aAAA;AACrB,QAAM,cAAcC,eAAAA,eAAA;AACpB,SAAOC,MAAAA,YAAY,OAAO,aAAwB,YAAiF;AAClI,QAAI;AACH,YAAM,gBAAgB,MAAM,WAAW,aAAa,EAAE,aAAa,GAAG,SAAS,QAAQ,MAAA,GAAS;AAChG,UAAI,CAAC,aAAa,SAAS;AAC1B;AAAA,MACD;AACA,aAAO;AAAA,IACR,SAAS,GAAG;AACX,UAAI,MAAMC,QAAAA,0BAA0B;AACnC;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD,GAAG,CAAC,OAAO,aAAa,YAAY,YAAY,CAAC;AAClD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useExtendTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useExtendTree.ts"],"sourcesContent":["import { ReactNode, useCallback } from 'react'\nimport { useAbortController, useIsMounted } from '@contember/react-utils'\nimport { useBindingOperations } from './useBindingOperations'\nimport { TreeRootId } from '@contember/binding'\nimport { ExtendTreeOptions } from '@contember/binding'\nimport { DataBindingExtendAborted } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\nexport const useExtendTree = () => {\n\tconst abort = useAbortController()\n\tconst { extendTree } = useBindingOperations()\n\tconst isMountedRef = useIsMounted()\n\tconst environment = useEnvironment()\n\treturn useCallback(async (newFragment: ReactNode, options?: Omit<ExtendTreeOptions, 'signal'>): Promise<TreeRootId | undefined> => {\n\t\ttry {\n\t\t\tconst newTreeRootId = await extendTree(newFragment, { environment, ...options, signal: abort() })\n\t\t\tif (!isMountedRef.current) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn newTreeRootId\n\t\t} catch (e) {\n\t\t\tif (e === DataBindingExtendAborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}, [abort, environment, extendTree, isMountedRef])\n}\n"],"names":[],"mappings":";;;;;AAQO,MAAM,gBAAgB,MAAM;AAClC,QAAM,QAAQ,mBAAA;AACd,QAAM,EAAE,WAAA,IAAe,qBAAA;AACvB,QAAM,eAAe,aAAA;AACrB,QAAM,cAAc,eAAA;AACpB,SAAO,YAAY,OAAO,aAAwB,YAAiF;AAClI,QAAI;AACH,YAAM,gBAAgB,MAAM,WAAW,aAAa,EAAE,aAAa,GAAG,SAAS,QAAQ,MAAA,GAAS;AAChG,UAAI,CAAC,aAAa,SAAS;AAC1B;AAAA,MACD;AACA,aAAO;AAAA,IACR,SAAS,GAAG;AACX,UAAI,MAAM,0BAA0B;AACnC;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD,GAAG,CAAC,OAAO,aAAa,YAAY,YAAY,CAAC;AAClD;"}
1
+ {"version":3,"file":"useExtendTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useExtendTree.ts"],"sourcesContent":["import { ReactNode, useCallback } from 'react'\nimport { useAbortController, useIsMounted } from '@contember/react-utils'\nimport { useBindingOperations } from './useBindingOperations.js'\nimport { TreeRootId } from '@contember/binding'\nimport { ExtendTreeOptions } from '@contember/binding'\nimport { DataBindingExtendAborted } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment.js'\n\nexport const useExtendTree = () => {\n\tconst abort = useAbortController()\n\tconst { extendTree } = useBindingOperations()\n\tconst isMountedRef = useIsMounted()\n\tconst environment = useEnvironment()\n\treturn useCallback(async (newFragment: ReactNode, options?: Omit<ExtendTreeOptions, 'signal'>): Promise<TreeRootId | undefined> => {\n\t\ttry {\n\t\t\tconst newTreeRootId = await extendTree(newFragment, { environment, ...options, signal: abort() })\n\t\t\tif (!isMountedRef.current) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn newTreeRootId\n\t\t} catch (e) {\n\t\t\tif (e === DataBindingExtendAborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}, [abort, environment, extendTree, isMountedRef])\n}\n"],"names":[],"mappings":";;;;;AAQO,MAAM,gBAAgB,MAAM;AAClC,QAAM,QAAQ,mBAAA;AACd,QAAM,EAAE,WAAA,IAAe,qBAAA;AACvB,QAAM,eAAe,aAAA;AACrB,QAAM,cAAc,eAAA;AACpB,SAAO,YAAY,OAAO,aAAwB,YAAiF;AAClI,QAAI;AACH,YAAM,gBAAgB,MAAM,WAAW,aAAa,EAAE,aAAa,GAAG,SAAS,QAAQ,MAAA,GAAS;AAChG,UAAI,CAAC,aAAa,SAAS;AAC1B;AAAA,MACD;AACA,aAAO;AAAA,IACR,SAAS,GAAG;AACX,UAAI,MAAM,0BAA0B;AACnC;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD,GAAG,CAAC,OAAO,aAAa,YAAY,YAAY,CAAC;AAClD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useField.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useField.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { FieldAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { FieldValue, SugaredRelativeSingleField } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField'\n\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): FieldAccessor<Value>\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined {\n\tconst relativeSingleField = useDesugaredRelativeSingleField(sugaredRelativeSingleField)\n\tuseConstantValueInvariant(\n\t\t!!relativeSingleField,\n\t\t'useField: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getField = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getField<Value>(relativeSingleField!)\n\t}, [entityKey, getEntityByKey, relativeSingleField])\n\n\tif (relativeSingleField) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleField.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [field, { update }] = useAccessorUpdateSubscription(getField)\n\n\t\tif (relativeSingleField.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn field\n\t}\n\treturn undefined\n}\n\nexport { useField }\n"],"names":["useDesugaredRelativeSingleField","useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useConstantLengthInvariant","useAccessorUpdateSubscription","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAeA,SAAS,SACR,4BACmC;AACnC,QAAM,sBAAsBA,gCAAAA,gCAAgC,0BAA0B;AACtFC,aAAAA;AAAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAYC,aAAAA,aAAA;AAClB,QAAM,iBAAiBC,kBAAAA,kBAAA;AACvB,QAAM,WAAWC,MAAAA,YAAY,MAAM;AAClC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,SAAgB,mBAAoB;AAAA,EACnD,GAAG,CAAC,WAAW,gBAAgB,mBAAmB,CAAC;AAEnD,MAAI,qBAAqB;AACxBC,eAAAA;AAAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,IAAA;AAED,UAAM,CAAC,OAAO,EAAE,QAAQ,IAAIC,8BAAAA,8BAA8B,QAAQ;AAElE,QAAI,oBAAoB,mBAAmB,QAAQ;AAClDC,4BAAAA,sBAAsB,oBAAoB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC9E;AAEA,WAAO;AAAA,EACR;AACA,SAAO;AACR;;"}
1
+ {"version":3,"file":"useField.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useField.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index.js'\nimport type { FieldAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents/index.js'\nimport type { FieldValue, SugaredRelativeSingleField } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription.js'\nimport { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField.js'\n\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): FieldAccessor<Value>\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined {\n\tconst relativeSingleField = useDesugaredRelativeSingleField(sugaredRelativeSingleField)\n\tuseConstantValueInvariant(\n\t\t!!relativeSingleField,\n\t\t'useField: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getField = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getField<Value>(relativeSingleField!)\n\t}, [entityKey, getEntityByKey, relativeSingleField])\n\n\tif (relativeSingleField) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleField.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [field, { update }] = useAccessorUpdateSubscription(getField)\n\n\t\tif (relativeSingleField.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn field\n\t}\n\treturn undefined\n}\n\nexport { useField }\n"],"names":["useDesugaredRelativeSingleField","useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useConstantLengthInvariant","useAccessorUpdateSubscription","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAeA,SAAS,SACR,4BACmC;AACnC,QAAM,sBAAsBA,gCAAAA,gCAAgC,0BAA0B;AACtFC,aAAAA;AAAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAYC,aAAAA,aAAA;AAClB,QAAM,iBAAiBC,kBAAAA,kBAAA;AACvB,QAAM,WAAWC,MAAAA,YAAY,MAAM;AAClC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,SAAgB,mBAAoB;AAAA,EACnD,GAAG,CAAC,WAAW,gBAAgB,mBAAmB,CAAC;AAEnD,MAAI,qBAAqB;AACxBC,eAAAA;AAAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,IAAA;AAED,UAAM,CAAC,OAAO,EAAE,QAAQ,IAAIC,8BAAAA,8BAA8B,QAAQ;AAElE,QAAI,oBAAoB,mBAAmB,QAAQ;AAClDC,4BAAAA,sBAAsB,oBAAoB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC9E;AAEA,WAAO;AAAA,EACR;AACA,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useField.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useField.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { FieldAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { FieldValue, SugaredRelativeSingleField } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField'\n\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): FieldAccessor<Value>\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined {\n\tconst relativeSingleField = useDesugaredRelativeSingleField(sugaredRelativeSingleField)\n\tuseConstantValueInvariant(\n\t\t!!relativeSingleField,\n\t\t'useField: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getField = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getField<Value>(relativeSingleField!)\n\t}, [entityKey, getEntityByKey, relativeSingleField])\n\n\tif (relativeSingleField) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleField.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [field, { update }] = useAccessorUpdateSubscription(getField)\n\n\t\tif (relativeSingleField.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn field\n\t}\n\treturn undefined\n}\n\nexport { useField }\n"],"names":[],"mappings":";;;;;;;AAeA,SAAS,SACR,4BACmC;AACnC,QAAM,sBAAsB,gCAAgC,0BAA0B;AACtF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAY,aAAA;AAClB,QAAM,iBAAiB,kBAAA;AACvB,QAAM,WAAW,YAAY,MAAM;AAClC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,SAAgB,mBAAoB;AAAA,EACnD,GAAG,CAAC,WAAW,gBAAgB,mBAAmB,CAAC;AAEnD,MAAI,qBAAqB;AACxB;AAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,IAAA;AAED,UAAM,CAAC,OAAO,EAAE,QAAQ,IAAI,8BAA8B,QAAQ;AAElE,QAAI,oBAAoB,mBAAmB,QAAQ;AAClD,4BAAsB,oBAAoB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC9E;AAEA,WAAO;AAAA,EACR;AACA,SAAO;AACR;"}
1
+ {"version":3,"file":"useField.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useField.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index.js'\nimport type { FieldAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents/index.js'\nimport type { FieldValue, SugaredRelativeSingleField } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription.js'\nimport { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField.js'\n\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): FieldAccessor<Value>\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined {\n\tconst relativeSingleField = useDesugaredRelativeSingleField(sugaredRelativeSingleField)\n\tuseConstantValueInvariant(\n\t\t!!relativeSingleField,\n\t\t'useField: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getField = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getField<Value>(relativeSingleField!)\n\t}, [entityKey, getEntityByKey, relativeSingleField])\n\n\tif (relativeSingleField) {\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleField.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\tconst [field, { update }] = useAccessorUpdateSubscription(getField)\n\n\t\tif (relativeSingleField.hasOneRelationPath.length) {\n\t\t\tuseOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn field\n\t}\n\treturn undefined\n}\n\nexport { useField }\n"],"names":[],"mappings":";;;;;;;AAeA,SAAS,SACR,4BACmC;AACnC,QAAM,sBAAsB,gCAAgC,0BAA0B;AACtF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAY,aAAA;AAClB,QAAM,iBAAiB,kBAAA;AACvB,QAAM,WAAW,YAAY,MAAM;AAClC,UAAM,SAAS,eAAe,SAAS;AACvC,WAAO,OAAO,SAAgB,mBAAoB;AAAA,EACnD,GAAG,CAAC,WAAW,gBAAgB,mBAAmB,CAAC;AAEnD,MAAI,qBAAqB;AACxB;AAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,IAAA;AAED,UAAM,CAAC,OAAO,EAAE,QAAQ,IAAI,8BAA8B,QAAQ;AAElE,QAAI,oBAAoB,mBAAmB,QAAQ;AAClD,4BAAsB,oBAAoB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAC9E;AAEA,WAAO;AAAA,EACR;AACA,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityByKey.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts"],"sourcesContent":["import type { GetEntityByKey } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const useGetEntityByKey = (): GetEntityByKey => useBindingOperations().getEntityByKey\n"],"names":["useBindingOperations"],"mappings":";;;AAGO,MAAM,oBAAoB,MAAsBA,qBAAAA,uBAAuB;;"}
1
+ {"version":3,"file":"useGetEntityByKey.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts"],"sourcesContent":["import type { GetEntityByKey } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations.js'\n\nexport const useGetEntityByKey = (): GetEntityByKey => useBindingOperations().getEntityByKey\n"],"names":["useBindingOperations"],"mappings":";;;AAGO,MAAM,oBAAoB,MAAsBA,qBAAAA,uBAAuB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityByKey.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts"],"sourcesContent":["import type { GetEntityByKey } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const useGetEntityByKey = (): GetEntityByKey => useBindingOperations().getEntityByKey\n"],"names":[],"mappings":";AAGO,MAAM,oBAAoB,MAAsB,uBAAuB;"}
1
+ {"version":3,"file":"useGetEntityByKey.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityByKey.ts"],"sourcesContent":["import type { GetEntityByKey } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations.js'\n\nexport const useGetEntityByKey = (): GetEntityByKey => useBindingOperations().getEntityByKey\n"],"names":[],"mappings":";AAGO,MAAM,oBAAoB,MAAsB,uBAAuB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntityListSubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityListAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntityListSubTree = useBindingOperations().getEntityListSubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntityListSubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntityListSubTree, treeRootId],\n\t)\n}\n"],"names":["useEnvironment","useBindingOperations","useTreeRootId","useCallback"],"mappings":";;;;;;AAOO,MAAM,0BAA0B,MAGZ;AAC1B,QAAM,cAAcA,eAAAA,eAAA;AACpB,QAAM,uBAAuBC,qBAAAA,uBAAuB;AACpD,QAAM,aAAaC,cAAAA,cAAA;AAEnB,SAAOC,MAAAA;AAAAA,IACN,CACC,sBACG,WACC,qBAAqB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IACtG,CAAC,aAAa,sBAAsB,UAAU;AAAA,EAAA;AAEhD;;"}
1
+ {"version":3,"file":"useGetEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations.js'\nimport { useEnvironment } from './useEnvironment.js'\nimport { useTreeRootId } from './useTreeRootId.js'\n\nexport const useGetEntityListSubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityListAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntityListSubTree = useBindingOperations().getEntityListSubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntityListSubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntityListSubTree, treeRootId],\n\t)\n}\n"],"names":["useEnvironment","useBindingOperations","useTreeRootId","useCallback"],"mappings":";;;;;;AAOO,MAAM,0BAA0B,MAGZ;AAC1B,QAAM,cAAcA,eAAAA,eAAA;AACpB,QAAM,uBAAuBC,qBAAAA,uBAAuB;AACpD,QAAM,aAAaC,cAAAA,cAAA;AAEnB,SAAOC,MAAAA;AAAAA,IACN,CACC,sBACG,WACC,qBAAqB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IACtG,CAAC,aAAa,sBAAsB,UAAU;AAAA,EAAA;AAEhD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntityListSubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityListAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntityListSubTree = useBindingOperations().getEntityListSubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntityListSubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntityListSubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,0BAA0B,MAGZ;AAC1B,QAAM,cAAc,eAAA;AACpB,QAAM,uBAAuB,uBAAuB;AACpD,QAAM,aAAa,cAAA;AAEnB,SAAO;AAAA,IACN,CACC,sBACG,WACC,qBAAqB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IACtG,CAAC,aAAa,sBAAsB,UAAU;AAAA,EAAA;AAEhD;"}
1
+ {"version":3,"file":"useGetEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations.js'\nimport { useEnvironment } from './useEnvironment.js'\nimport { useTreeRootId } from './useTreeRootId.js'\n\nexport const useGetEntityListSubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityListAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntityListSubTree = useBindingOperations().getEntityListSubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntityListSubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntityListSubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,0BAA0B,MAGZ;AAC1B,QAAM,cAAc,eAAA;AACpB,QAAM,uBAAuB,uBAAuB;AACpD,QAAM,aAAa,cAAA;AAEnB,SAAO;AAAA,IACN,CACC,sBACG,WACC,qBAAqB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IACtG,CAAC,aAAa,sBAAsB,UAAU;AAAA,EAAA;AAEhD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntitySubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntitySubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntitySubTree = useBindingOperations().getEntitySubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntitySubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntitySubTree, treeRootId],\n\t)\n}\n"],"names":["useEnvironment","useBindingOperations","useTreeRootId","useCallback"],"mappings":";;;;;;AAOO,MAAM,sBAAsB,MAGZ;AACtB,QAAM,cAAcA,eAAAA,eAAA;AACpB,QAAM,mBAAmBC,qBAAAA,uBAAuB;AAChD,QAAM,aAAaC,cAAAA,cAAA;AAEnB,SAAOC,MAAAA;AAAAA,IACN,CACC,sBACG,WACC,iBAAiB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IAClG,CAAC,aAAa,kBAAkB,UAAU;AAAA,EAAA;AAE5C;;"}
1
+ {"version":3,"file":"useGetEntitySubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations.js'\nimport { useEnvironment } from './useEnvironment.js'\nimport { useTreeRootId } from './useTreeRootId.js'\n\nexport const useGetEntitySubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntitySubTree = useBindingOperations().getEntitySubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntitySubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntitySubTree, treeRootId],\n\t)\n}\n"],"names":["useEnvironment","useBindingOperations","useTreeRootId","useCallback"],"mappings":";;;;;;AAOO,MAAM,sBAAsB,MAGZ;AACtB,QAAM,cAAcA,eAAAA,eAAA;AACpB,QAAM,mBAAmBC,qBAAAA,uBAAuB;AAChD,QAAM,aAAaC,cAAAA,cAAA;AAEnB,SAAOC,MAAAA;AAAAA,IACN,CACC,sBACG,WACC,iBAAiB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IAClG,CAAC,aAAa,kBAAkB,UAAU;AAAA,EAAA;AAE5C;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntitySubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntitySubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntitySubTree = useBindingOperations().getEntitySubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntitySubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntitySubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,sBAAsB,MAGZ;AACtB,QAAM,cAAc,eAAA;AACpB,QAAM,mBAAmB,uBAAuB;AAChD,QAAM,aAAa,cAAA;AAEnB,SAAO;AAAA,IACN,CACC,sBACG,WACC,iBAAiB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IAClG,CAAC,aAAa,kBAAkB,UAAU;AAAA,EAAA;AAE5C;"}
1
+ {"version":3,"file":"useGetEntitySubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useGetEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations.js'\nimport { useEnvironment } from './useEnvironment.js'\nimport { useTreeRootId } from './useTreeRootId.js'\n\nexport const useGetEntitySubTree = (): (\n\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityAccessor => {\n\tconst environment = useEnvironment()\n\tconst getEntitySubTree = useBindingOperations().getEntitySubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntitySubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntitySubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,sBAAsB,MAGZ;AACtB,QAAM,cAAc,eAAA;AACpB,QAAM,mBAAmB,uBAAuB;AAChD,QAAM,aAAa,cAAA;AAEnB,SAAO;AAAA,IACN,CACC,sBACG,WACC,iBAAiB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IAClG,CAAC,aAAa,kBAAkB,UAAU;AAAA,EAAA;AAE5C;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useHasEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useHasEntity.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useHasEntity = (): boolean => {\n\treturn useContext(EntityKeyContext) !== undefined\n}\n"],"names":["useContext","EntityKeyContext"],"mappings":";;;;AAGO,MAAM,eAAe,MAAe;AAC1C,SAAOA,MAAAA,WAAWC,iBAAAA,gBAAgB,MAAM;AACzC;;"}
1
+ {"version":3,"file":"useHasEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useHasEntity.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext.js'\n\nexport const useHasEntity = (): boolean => {\n\treturn useContext(EntityKeyContext) !== undefined\n}\n"],"names":["useContext","EntityKeyContext"],"mappings":";;;;AAGO,MAAM,eAAe,MAAe;AAC1C,SAAOA,MAAAA,WAAWC,iBAAAA,gBAAgB,MAAM;AACzC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useHasEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useHasEntity.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useHasEntity = (): boolean => {\n\treturn useContext(EntityKeyContext) !== undefined\n}\n"],"names":[],"mappings":";;AAGO,MAAM,eAAe,MAAe;AAC1C,SAAO,WAAW,gBAAgB,MAAM;AACzC;"}
1
+ {"version":3,"file":"useHasEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useHasEntity.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext.js'\n\nexport const useHasEntity = (): boolean => {\n\treturn useContext(EntityKeyContext) !== undefined\n}\n"],"names":[],"mappings":";;AAGO,MAAM,eAAe,MAAe;AAC1C,SAAO,WAAW,gBAAgB,MAAM;AACzC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePersist.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/usePersist.ts"],"sourcesContent":["import type { Persist } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const usePersist = (): Persist => useBindingOperations().persist\n"],"names":["useBindingOperations"],"mappings":";;;AAGO,MAAM,aAAa,MAAeA,qBAAAA,uBAAuB;;"}
1
+ {"version":3,"file":"usePersist.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/usePersist.ts"],"sourcesContent":["import type { Persist } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations.js'\n\nexport const usePersist = (): Persist => useBindingOperations().persist\n"],"names":["useBindingOperations"],"mappings":";;;AAGO,MAAM,aAAa,MAAeA,qBAAAA,uBAAuB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePersist.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/usePersist.ts"],"sourcesContent":["import type { Persist } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations'\n\nexport const usePersist = (): Persist => useBindingOperations().persist\n"],"names":[],"mappings":";AAGO,MAAM,aAAa,MAAe,uBAAuB;"}
1
+ {"version":3,"file":"usePersist.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/usePersist.ts"],"sourcesContent":["import type { Persist } from '@contember/binding'\nimport { useBindingOperations } from './useBindingOperations.js'\n\nexport const usePersist = (): Persist => useBindingOperations().persist\n"],"names":[],"mappings":";AAGO,MAAM,aAAa,MAAe,uBAAuB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTreeRootId.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useTreeRootId.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport const useTreeRootId = (): TreeRootId | undefined => useContext(TreeRootIdContext)\n"],"names":["useContext","TreeRootIdContext"],"mappings":";;;;AAIO,MAAM,gBAAgB,MAA8BA,MAAAA,WAAWC,kBAAAA,iBAAiB;;"}
1
+ {"version":3,"file":"useTreeRootId.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useTreeRootId.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext.js'\n\nexport const useTreeRootId = (): TreeRootId | undefined => useContext(TreeRootIdContext)\n"],"names":["useContext","TreeRootIdContext"],"mappings":";;;;AAIO,MAAM,gBAAgB,MAA8BA,MAAAA,WAAWC,kBAAAA,iBAAiB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTreeRootId.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useTreeRootId.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport const useTreeRootId = (): TreeRootId | undefined => useContext(TreeRootIdContext)\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB,MAA8B,WAAW,iBAAiB;"}
1
+ {"version":3,"file":"useTreeRootId.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useTreeRootId.ts"],"sourcesContent":["import { useContext } from 'react'\nimport type { TreeRootId } from '@contember/binding'\nimport { TreeRootIdContext } from './TreeRootIdContext.js'\n\nexport const useTreeRootId = (): TreeRootId | undefined => useContext(TreeRootIdContext)\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB,MAA8B,WAAW,iBAAiB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SetOrderFieldOnCreate.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx"],"sourcesContent":["import type { Input } from '@contember/client'\nimport type {\n\tSugaredOrderBy,\n\tSugaredQualifiedEntityList,\n\tSugaredRelativeSingleField,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n} from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents'\nimport { SugaredField } from '../helperComponents'\nimport { addEntityAtIndex } from './addEntityAtIndex'\n\nexport interface SetOrderFieldOnCreateOwnProps {\n\torderField: SugaredRelativeSingleField | string\n\tnewOrderFieldValue?: number\n}\n\nexport interface SetOrderFieldOnCreateProps extends SetOrderFieldOnCreateOwnProps, Pick<SugaredUnconstrainedQualifiedSingleEntity, 'entity'> {}\n\nexport const SetOrderFieldOnCreate = Component<SetOrderFieldOnCreateProps>(\n\t() => null,\n\t({ orderField, newOrderFieldValue, entity }, environment) => {\n\t\tconst desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment)\n\t\tconst getOrderBy = (order: 'asc' | 'desc'): SugaredOrderBy => [\n\t\t\tdesugaredOrderField.hasOneRelationPath\n\t\t\t\t.map(relation => relation.field)\n\t\t\t\t.reduceRight(\n\t\t\t\t\t(accumulator, currentValue) => ({\n\t\t\t\t\t\t[currentValue]: accumulator,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\t[desugaredOrderField.field]: order,\n\t\t\t\t\t} as Input.OrderBy<`${Input.OrderDirection}`>,\n\t\t\t\t),\n\t\t]\n\n\t\tif (newOrderFieldValue === undefined) {\n\t\t\tconst qel: SugaredQualifiedEntityList = {\n\t\t\t\tentities: entity,\n\t\t\t\texpectedMutation: 'none',\n\t\t\t\tlimit: 1,\n\t\t\t\torderBy: getOrderBy('desc'),\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={entity}\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t\tconst listSubTree = bindingOperations.getEntityListSubTree(qel)\n\t\t\t\t\t\t\tconst entities = Array.from(listSubTree)\n\t\t\t\t\t\t\tconst newOrderFieldValue = !entities.length\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: (entities[0].getField<number>(desugaredOrderField).value ?? 0) + 1\n\t\t\t\t\t\t\tgetAccessor().getField<number>(desugaredOrderField).updateValue(newOrderFieldValue)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntitySubTree>\n\t\t\t\t\t<EntityListSubTree {...qel}>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntityListSubTree>\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Field field={desugaredOrderField} defaultValue={newOrderFieldValue} isNonbearing />\n\t\t\t\t<EntityListSubTree\n\t\t\t\t\tentities={entity}\n\t\t\t\t\texpectedMutation=\"anyMutation\"\n\t\t\t\t\torderBy={getOrderBy('asc')}\n\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t// We're creating a new entity which adjusts the numbering of the other ones if applicable\n\t\t\t\t\t\t// and then deleting it again which leaves a hole for newOrderFieldValue that is set above.\n\t\t\t\t\t\tlet newEntityKey: string | undefined\n\t\t\t\t\t\taddEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, getNewEntity => {\n\t\t\t\t\t\t\tnewEntityKey = getNewEntity().key\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewEntityKey && bindingOperations.getEntityByKey(newEntityKey).deleteEntity()\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t</EntityListSubTree>\n\t\t\t</>\n\t\t)\n\t},\n\t'SetOrderFieldOnCreate',\n)\n"],"names":["Component","QueryLanguage","jsxs","Fragment","jsx","EntitySubTree","newOrderFieldValue","SugaredField","EntityListSubTree","Field","addEntityAtIndex"],"mappings":";;;;;;;;;;AAmBO,MAAM,wBAAwBA,UAAAA;AAAAA,EACpC,MAAM;AAAA,EACN,CAAC,EAAE,YAAY,oBAAoB,OAAA,GAAU,gBAAgB;AAC5D,UAAM,sBAAsBC,QAAAA,cAAc,2BAA2B,YAAY,WAAW;AAC5F,UAAM,aAAa,CAAC,UAA0C;AAAA,MAC7D,oBAAoB,mBAClB,IAAI,CAAA,aAAY,SAAS,KAAK,EAC9B;AAAA,QACA,CAAC,aAAa,kBAAkB;AAAA,UAC/B,CAAC,YAAY,GAAG;AAAA,QAAA;AAAA,QAEjB;AAAA,UACC,CAAC,oBAAoB,KAAK,GAAG;AAAA,QAAA;AAAA,MAC9B;AAAA,IACD;AAGF,QAAI,uBAAuB,QAAW;AACrC,YAAM,MAAkC;AAAA,QACvC,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,OAAO;AAAA,QACP,SAAS,WAAW,MAAM;AAAA,MAAA;AAE3B,aACCC,2BAAAA,KAAAC,qBAAA,EACC,UAAA;AAAA,QAAAC,2BAAAA;AAAAA,UAACC,cAAAA;AAAAA,UAAA;AAAA,YACA;AAAA,YACA,YAAU;AAAA,YACV,iBAAiB,CAAC,aAAa,sBAAsB;AACpD,oBAAM,cAAc,kBAAkB,qBAAqB,GAAG;AAC9D,oBAAM,WAAW,MAAM,KAAK,WAAW;AACvC,oBAAMC,sBAAqB,CAAC,SAAS,SAClC,KACC,SAAS,CAAC,EAAE,SAAiB,mBAAmB,EAAE,SAAS,KAAK;AACpE,0BAAA,EAAc,SAAiB,mBAAmB,EAAE,YAAYA,mBAAkB;AAAA,YACnF;AAAA,YAEA,UAAAF,2BAAAA,IAACG,aAAAA,cAAA,EAAa,OAAO,WAAA,CAAY;AAAA,UAAA;AAAA,QAAA;AAAA,QAElCH,2BAAAA,IAACI,kBAAAA,qBAAmB,GAAG,KACtB,yCAACD,aAAAA,cAAA,EAAa,OAAO,YAAY,EAAA,CAClC;AAAA,MAAA,GACD;AAAA,IAEF;AACA,WACCL,2BAAAA,KAAAC,qBAAA,EACC,UAAA;AAAA,MAAAC,+BAACK,MAAAA,SAAM,OAAO,qBAAqB,cAAc,oBAAoB,cAAY,MAAC;AAAA,MAClFL,2BAAAA;AAAAA,QAACI,kBAAAA;AAAAA,QAAA;AAAA,UACA,UAAU;AAAA,UACV,kBAAiB;AAAA,UACjB,SAAS,WAAW,KAAK;AAAA,UACzB,iBAAiB,CAAC,aAAa,sBAAsB;AAGpD,gBAAI;AACJE,6BAAAA,iBAAiB,YAAA,GAAe,qBAAqB,oBAAoB,CAAA,iBAAgB;AACxF,6BAAe,eAAe;AAAA,YAC/B,CAAC;AACD,4BAAgB,kBAAkB,eAAe,YAAY,EAAE,aAAA;AAAA,UAChE;AAAA,UAEA,UAAAN,2BAAAA,IAACG,aAAAA,cAAA,EAAa,OAAO,WAAA,CAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAClC,GACD;AAAA,EAEF;AAAA,EACA;AACD;;"}
1
+ {"version":3,"file":"SetOrderFieldOnCreate.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx"],"sourcesContent":["import type { Input } from '@contember/client'\nimport type {\n\tSugaredOrderBy,\n\tSugaredQualifiedEntityList,\n\tSugaredRelativeSingleField,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n} from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents/index.js'\nimport { SugaredField } from '../helperComponents/index.js'\nimport { addEntityAtIndex } from './addEntityAtIndex.js'\n\nexport interface SetOrderFieldOnCreateOwnProps {\n\torderField: SugaredRelativeSingleField | string\n\tnewOrderFieldValue?: number\n}\n\nexport interface SetOrderFieldOnCreateProps extends SetOrderFieldOnCreateOwnProps, Pick<SugaredUnconstrainedQualifiedSingleEntity, 'entity'> {}\n\nexport const SetOrderFieldOnCreate = Component<SetOrderFieldOnCreateProps>(\n\t() => null,\n\t({ orderField, newOrderFieldValue, entity }, environment) => {\n\t\tconst desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment)\n\t\tconst getOrderBy = (order: 'asc' | 'desc'): SugaredOrderBy => [\n\t\t\tdesugaredOrderField.hasOneRelationPath\n\t\t\t\t.map(relation => relation.field)\n\t\t\t\t.reduceRight(\n\t\t\t\t\t(accumulator, currentValue) => ({\n\t\t\t\t\t\t[currentValue]: accumulator,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\t[desugaredOrderField.field]: order,\n\t\t\t\t\t} as Input.OrderBy<`${Input.OrderDirection}`>,\n\t\t\t\t),\n\t\t]\n\n\t\tif (newOrderFieldValue === undefined) {\n\t\t\tconst qel: SugaredQualifiedEntityList = {\n\t\t\t\tentities: entity,\n\t\t\t\texpectedMutation: 'none',\n\t\t\t\tlimit: 1,\n\t\t\t\torderBy: getOrderBy('desc'),\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={entity}\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t\tconst listSubTree = bindingOperations.getEntityListSubTree(qel)\n\t\t\t\t\t\t\tconst entities = Array.from(listSubTree)\n\t\t\t\t\t\t\tconst newOrderFieldValue = !entities.length\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: (entities[0].getField<number>(desugaredOrderField).value ?? 0) + 1\n\t\t\t\t\t\t\tgetAccessor().getField<number>(desugaredOrderField).updateValue(newOrderFieldValue)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntitySubTree>\n\t\t\t\t\t<EntityListSubTree {...qel}>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntityListSubTree>\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Field field={desugaredOrderField} defaultValue={newOrderFieldValue} isNonbearing />\n\t\t\t\t<EntityListSubTree\n\t\t\t\t\tentities={entity}\n\t\t\t\t\texpectedMutation=\"anyMutation\"\n\t\t\t\t\torderBy={getOrderBy('asc')}\n\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t// We're creating a new entity which adjusts the numbering of the other ones if applicable\n\t\t\t\t\t\t// and then deleting it again which leaves a hole for newOrderFieldValue that is set above.\n\t\t\t\t\t\tlet newEntityKey: string | undefined\n\t\t\t\t\t\taddEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, getNewEntity => {\n\t\t\t\t\t\t\tnewEntityKey = getNewEntity().key\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewEntityKey && bindingOperations.getEntityByKey(newEntityKey).deleteEntity()\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t</EntityListSubTree>\n\t\t\t</>\n\t\t)\n\t},\n\t'SetOrderFieldOnCreate',\n)\n"],"names":["Component","QueryLanguage","jsxs","Fragment","jsx","EntitySubTree","newOrderFieldValue","SugaredField","EntityListSubTree","Field","addEntityAtIndex"],"mappings":";;;;;;;;;;AAmBO,MAAM,wBAAwBA,UAAAA;AAAAA,EACpC,MAAM;AAAA,EACN,CAAC,EAAE,YAAY,oBAAoB,OAAA,GAAU,gBAAgB;AAC5D,UAAM,sBAAsBC,QAAAA,cAAc,2BAA2B,YAAY,WAAW;AAC5F,UAAM,aAAa,CAAC,UAA0C;AAAA,MAC7D,oBAAoB,mBAClB,IAAI,CAAA,aAAY,SAAS,KAAK,EAC9B;AAAA,QACA,CAAC,aAAa,kBAAkB;AAAA,UAC/B,CAAC,YAAY,GAAG;AAAA,QAAA;AAAA,QAEjB;AAAA,UACC,CAAC,oBAAoB,KAAK,GAAG;AAAA,QAAA;AAAA,MAC9B;AAAA,IACD;AAGF,QAAI,uBAAuB,QAAW;AACrC,YAAM,MAAkC;AAAA,QACvC,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,OAAO;AAAA,QACP,SAAS,WAAW,MAAM;AAAA,MAAA;AAE3B,aACCC,2BAAAA,KAAAC,qBAAA,EACC,UAAA;AAAA,QAAAC,2BAAAA;AAAAA,UAACC,cAAAA;AAAAA,UAAA;AAAA,YACA;AAAA,YACA,YAAU;AAAA,YACV,iBAAiB,CAAC,aAAa,sBAAsB;AACpD,oBAAM,cAAc,kBAAkB,qBAAqB,GAAG;AAC9D,oBAAM,WAAW,MAAM,KAAK,WAAW;AACvC,oBAAMC,sBAAqB,CAAC,SAAS,SAClC,KACC,SAAS,CAAC,EAAE,SAAiB,mBAAmB,EAAE,SAAS,KAAK;AACpE,0BAAA,EAAc,SAAiB,mBAAmB,EAAE,YAAYA,mBAAkB;AAAA,YACnF;AAAA,YAEA,UAAAF,2BAAAA,IAACG,aAAAA,cAAA,EAAa,OAAO,WAAA,CAAY;AAAA,UAAA;AAAA,QAAA;AAAA,QAElCH,2BAAAA,IAACI,kBAAAA,qBAAmB,GAAG,KACtB,yCAACD,aAAAA,cAAA,EAAa,OAAO,YAAY,EAAA,CAClC;AAAA,MAAA,GACD;AAAA,IAEF;AACA,WACCL,2BAAAA,KAAAC,qBAAA,EACC,UAAA;AAAA,MAAAC,+BAACK,MAAAA,SAAM,OAAO,qBAAqB,cAAc,oBAAoB,cAAY,MAAC;AAAA,MAClFL,2BAAAA;AAAAA,QAACI,kBAAAA;AAAAA,QAAA;AAAA,UACA,UAAU;AAAA,UACV,kBAAiB;AAAA,UACjB,SAAS,WAAW,KAAK;AAAA,UACzB,iBAAiB,CAAC,aAAa,sBAAsB;AAGpD,gBAAI;AACJE,6BAAAA,iBAAiB,YAAA,GAAe,qBAAqB,oBAAoB,CAAA,iBAAgB;AACxF,6BAAe,eAAe;AAAA,YAC/B,CAAC;AACD,4BAAgB,kBAAkB,eAAe,YAAY,EAAE,aAAA;AAAA,UAChE;AAAA,UAEA,UAAAN,2BAAAA,IAACG,aAAAA,cAAA,EAAa,OAAO,WAAA,CAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAClC,GACD;AAAA,EAEF;AAAA,EACA;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SetOrderFieldOnCreate.js","sources":["../../../../../packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx"],"sourcesContent":["import type { Input } from '@contember/client'\nimport type {\n\tSugaredOrderBy,\n\tSugaredQualifiedEntityList,\n\tSugaredRelativeSingleField,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n} from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents'\nimport { SugaredField } from '../helperComponents'\nimport { addEntityAtIndex } from './addEntityAtIndex'\n\nexport interface SetOrderFieldOnCreateOwnProps {\n\torderField: SugaredRelativeSingleField | string\n\tnewOrderFieldValue?: number\n}\n\nexport interface SetOrderFieldOnCreateProps extends SetOrderFieldOnCreateOwnProps, Pick<SugaredUnconstrainedQualifiedSingleEntity, 'entity'> {}\n\nexport const SetOrderFieldOnCreate = Component<SetOrderFieldOnCreateProps>(\n\t() => null,\n\t({ orderField, newOrderFieldValue, entity }, environment) => {\n\t\tconst desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment)\n\t\tconst getOrderBy = (order: 'asc' | 'desc'): SugaredOrderBy => [\n\t\t\tdesugaredOrderField.hasOneRelationPath\n\t\t\t\t.map(relation => relation.field)\n\t\t\t\t.reduceRight(\n\t\t\t\t\t(accumulator, currentValue) => ({\n\t\t\t\t\t\t[currentValue]: accumulator,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\t[desugaredOrderField.field]: order,\n\t\t\t\t\t} as Input.OrderBy<`${Input.OrderDirection}`>,\n\t\t\t\t),\n\t\t]\n\n\t\tif (newOrderFieldValue === undefined) {\n\t\t\tconst qel: SugaredQualifiedEntityList = {\n\t\t\t\tentities: entity,\n\t\t\t\texpectedMutation: 'none',\n\t\t\t\tlimit: 1,\n\t\t\t\torderBy: getOrderBy('desc'),\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={entity}\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t\tconst listSubTree = bindingOperations.getEntityListSubTree(qel)\n\t\t\t\t\t\t\tconst entities = Array.from(listSubTree)\n\t\t\t\t\t\t\tconst newOrderFieldValue = !entities.length\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: (entities[0].getField<number>(desugaredOrderField).value ?? 0) + 1\n\t\t\t\t\t\t\tgetAccessor().getField<number>(desugaredOrderField).updateValue(newOrderFieldValue)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntitySubTree>\n\t\t\t\t\t<EntityListSubTree {...qel}>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntityListSubTree>\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Field field={desugaredOrderField} defaultValue={newOrderFieldValue} isNonbearing />\n\t\t\t\t<EntityListSubTree\n\t\t\t\t\tentities={entity}\n\t\t\t\t\texpectedMutation=\"anyMutation\"\n\t\t\t\t\torderBy={getOrderBy('asc')}\n\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t// We're creating a new entity which adjusts the numbering of the other ones if applicable\n\t\t\t\t\t\t// and then deleting it again which leaves a hole for newOrderFieldValue that is set above.\n\t\t\t\t\t\tlet newEntityKey: string | undefined\n\t\t\t\t\t\taddEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, getNewEntity => {\n\t\t\t\t\t\t\tnewEntityKey = getNewEntity().key\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewEntityKey && bindingOperations.getEntityByKey(newEntityKey).deleteEntity()\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t</EntityListSubTree>\n\t\t\t</>\n\t\t)\n\t},\n\t'SetOrderFieldOnCreate',\n)\n"],"names":["newOrderFieldValue"],"mappings":";;;;;;;;AAmBO,MAAM,wBAAwB;AAAA,EACpC,MAAM;AAAA,EACN,CAAC,EAAE,YAAY,oBAAoB,OAAA,GAAU,gBAAgB;AAC5D,UAAM,sBAAsB,cAAc,2BAA2B,YAAY,WAAW;AAC5F,UAAM,aAAa,CAAC,UAA0C;AAAA,MAC7D,oBAAoB,mBAClB,IAAI,CAAA,aAAY,SAAS,KAAK,EAC9B;AAAA,QACA,CAAC,aAAa,kBAAkB;AAAA,UAC/B,CAAC,YAAY,GAAG;AAAA,QAAA;AAAA,QAEjB;AAAA,UACC,CAAC,oBAAoB,KAAK,GAAG;AAAA,QAAA;AAAA,MAC9B;AAAA,IACD;AAGF,QAAI,uBAAuB,QAAW;AACrC,YAAM,MAAkC;AAAA,QACvC,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,OAAO;AAAA,QACP,SAAS,WAAW,MAAM;AAAA,MAAA;AAE3B,aACC,qBAAA,UAAA,EACC,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACA;AAAA,YACA,YAAU;AAAA,YACV,iBAAiB,CAAC,aAAa,sBAAsB;AACpD,oBAAM,cAAc,kBAAkB,qBAAqB,GAAG;AAC9D,oBAAM,WAAW,MAAM,KAAK,WAAW;AACvC,oBAAMA,sBAAqB,CAAC,SAAS,SAClC,KACC,SAAS,CAAC,EAAE,SAAiB,mBAAmB,EAAE,SAAS,KAAK;AACpE,0BAAA,EAAc,SAAiB,mBAAmB,EAAE,YAAYA,mBAAkB;AAAA,YACnF;AAAA,YAEA,UAAA,oBAAC,cAAA,EAAa,OAAO,WAAA,CAAY;AAAA,UAAA;AAAA,QAAA;AAAA,QAElC,oBAAC,qBAAmB,GAAG,KACtB,8BAAC,cAAA,EAAa,OAAO,YAAY,EAAA,CAClC;AAAA,MAAA,GACD;AAAA,IAEF;AACA,WACC,qBAAA,UAAA,EACC,UAAA;AAAA,MAAA,oBAAC,SAAM,OAAO,qBAAqB,cAAc,oBAAoB,cAAY,MAAC;AAAA,MAClF;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,UAAU;AAAA,UACV,kBAAiB;AAAA,UACjB,SAAS,WAAW,KAAK;AAAA,UACzB,iBAAiB,CAAC,aAAa,sBAAsB;AAGpD,gBAAI;AACJ,6BAAiB,YAAA,GAAe,qBAAqB,oBAAoB,CAAA,iBAAgB;AACxF,6BAAe,eAAe;AAAA,YAC/B,CAAC;AACD,4BAAgB,kBAAkB,eAAe,YAAY,EAAE,aAAA;AAAA,UAChE;AAAA,UAEA,UAAA,oBAAC,cAAA,EAAa,OAAO,WAAA,CAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAClC,GACD;AAAA,EAEF;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"SetOrderFieldOnCreate.js","sources":["../../../../../packages/react-binding/src/accessorSorting/SetOrderFieldOnCreate.tsx"],"sourcesContent":["import type { Input } from '@contember/client'\nimport type {\n\tSugaredOrderBy,\n\tSugaredQualifiedEntityList,\n\tSugaredRelativeSingleField,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n} from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents/index.js'\nimport { SugaredField } from '../helperComponents/index.js'\nimport { addEntityAtIndex } from './addEntityAtIndex.js'\n\nexport interface SetOrderFieldOnCreateOwnProps {\n\torderField: SugaredRelativeSingleField | string\n\tnewOrderFieldValue?: number\n}\n\nexport interface SetOrderFieldOnCreateProps extends SetOrderFieldOnCreateOwnProps, Pick<SugaredUnconstrainedQualifiedSingleEntity, 'entity'> {}\n\nexport const SetOrderFieldOnCreate = Component<SetOrderFieldOnCreateProps>(\n\t() => null,\n\t({ orderField, newOrderFieldValue, entity }, environment) => {\n\t\tconst desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment)\n\t\tconst getOrderBy = (order: 'asc' | 'desc'): SugaredOrderBy => [\n\t\t\tdesugaredOrderField.hasOneRelationPath\n\t\t\t\t.map(relation => relation.field)\n\t\t\t\t.reduceRight(\n\t\t\t\t\t(accumulator, currentValue) => ({\n\t\t\t\t\t\t[currentValue]: accumulator,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\t[desugaredOrderField.field]: order,\n\t\t\t\t\t} as Input.OrderBy<`${Input.OrderDirection}`>,\n\t\t\t\t),\n\t\t]\n\n\t\tif (newOrderFieldValue === undefined) {\n\t\t\tconst qel: SugaredQualifiedEntityList = {\n\t\t\t\tentities: entity,\n\t\t\t\texpectedMutation: 'none',\n\t\t\t\tlimit: 1,\n\t\t\t\torderBy: getOrderBy('desc'),\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={entity}\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t\tconst listSubTree = bindingOperations.getEntityListSubTree(qel)\n\t\t\t\t\t\t\tconst entities = Array.from(listSubTree)\n\t\t\t\t\t\t\tconst newOrderFieldValue = !entities.length\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: (entities[0].getField<number>(desugaredOrderField).value ?? 0) + 1\n\t\t\t\t\t\t\tgetAccessor().getField<number>(desugaredOrderField).updateValue(newOrderFieldValue)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntitySubTree>\n\t\t\t\t\t<EntityListSubTree {...qel}>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntityListSubTree>\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Field field={desugaredOrderField} defaultValue={newOrderFieldValue} isNonbearing />\n\t\t\t\t<EntityListSubTree\n\t\t\t\t\tentities={entity}\n\t\t\t\t\texpectedMutation=\"anyMutation\"\n\t\t\t\t\torderBy={getOrderBy('asc')}\n\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t// We're creating a new entity which adjusts the numbering of the other ones if applicable\n\t\t\t\t\t\t// and then deleting it again which leaves a hole for newOrderFieldValue that is set above.\n\t\t\t\t\t\tlet newEntityKey: string | undefined\n\t\t\t\t\t\taddEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, getNewEntity => {\n\t\t\t\t\t\t\tnewEntityKey = getNewEntity().key\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewEntityKey && bindingOperations.getEntityByKey(newEntityKey).deleteEntity()\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t</EntityListSubTree>\n\t\t\t</>\n\t\t)\n\t},\n\t'SetOrderFieldOnCreate',\n)\n"],"names":["newOrderFieldValue"],"mappings":";;;;;;;;AAmBO,MAAM,wBAAwB;AAAA,EACpC,MAAM;AAAA,EACN,CAAC,EAAE,YAAY,oBAAoB,OAAA,GAAU,gBAAgB;AAC5D,UAAM,sBAAsB,cAAc,2BAA2B,YAAY,WAAW;AAC5F,UAAM,aAAa,CAAC,UAA0C;AAAA,MAC7D,oBAAoB,mBAClB,IAAI,CAAA,aAAY,SAAS,KAAK,EAC9B;AAAA,QACA,CAAC,aAAa,kBAAkB;AAAA,UAC/B,CAAC,YAAY,GAAG;AAAA,QAAA;AAAA,QAEjB;AAAA,UACC,CAAC,oBAAoB,KAAK,GAAG;AAAA,QAAA;AAAA,MAC9B;AAAA,IACD;AAGF,QAAI,uBAAuB,QAAW;AACrC,YAAM,MAAkC;AAAA,QACvC,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,OAAO;AAAA,QACP,SAAS,WAAW,MAAM;AAAA,MAAA;AAE3B,aACC,qBAAA,UAAA,EACC,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACA;AAAA,YACA,YAAU;AAAA,YACV,iBAAiB,CAAC,aAAa,sBAAsB;AACpD,oBAAM,cAAc,kBAAkB,qBAAqB,GAAG;AAC9D,oBAAM,WAAW,MAAM,KAAK,WAAW;AACvC,oBAAMA,sBAAqB,CAAC,SAAS,SAClC,KACC,SAAS,CAAC,EAAE,SAAiB,mBAAmB,EAAE,SAAS,KAAK;AACpE,0BAAA,EAAc,SAAiB,mBAAmB,EAAE,YAAYA,mBAAkB;AAAA,YACnF;AAAA,YAEA,UAAA,oBAAC,cAAA,EAAa,OAAO,WAAA,CAAY;AAAA,UAAA;AAAA,QAAA;AAAA,QAElC,oBAAC,qBAAmB,GAAG,KACtB,8BAAC,cAAA,EAAa,OAAO,YAAY,EAAA,CAClC;AAAA,MAAA,GACD;AAAA,IAEF;AACA,WACC,qBAAA,UAAA,EACC,UAAA;AAAA,MAAA,oBAAC,SAAM,OAAO,qBAAqB,cAAc,oBAAoB,cAAY,MAAC;AAAA,MAClF;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,UAAU;AAAA,UACV,kBAAiB;AAAA,UACjB,SAAS,WAAW,KAAK;AAAA,UACzB,iBAAiB,CAAC,aAAa,sBAAsB;AAGpD,gBAAI;AACJ,6BAAiB,YAAA,GAAe,qBAAqB,oBAAoB,CAAA,iBAAgB;AACxF,6BAAe,eAAe;AAAA,YAC/B,CAAC;AACD,4BAAgB,kBAAkB,eAAe,YAAY,EAAE,aAAA;AAAA,UAChE;AAAA,UAEA,UAAA,oBAAC,cAAA,EAAa,OAAO,WAAA,CAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAClC,GACD;AAAA,EAEF;AAAA,EACA;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"addEntityAtIndex.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/addEntityAtIndex.ts"],"sourcesContent":["import { repairEntitiesOrder } from './repairEntitiesOrder'\nimport { sortEntities } from './sortEntities'\nimport { EntityAccessor, EntityListAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const addEntityAtIndex = (\n\tentityList: EntityListAccessor,\n\tsortableByField: RelativeSingleField,\n\tindex: number,\n\tpreprocess?: EntityAccessor.BatchUpdatesHandler,\n) => {\n\tconst sortedEntities = sortEntities(Array.from(entityList), sortableByField)\n\n\tentityList.createNewEntity((getNewlyAdded, options) => {\n\t\tlet newlyAdded = getNewlyAdded()\n\n\t\tconst sortableField = newlyAdded.getField<number>(sortableByField)\n\n\t\tsortableField.updateValue(index)\n\t\tnewlyAdded = getNewlyAdded()\n\n\t\tsortedEntities.splice(index, 0, newlyAdded)\n\t\trepairEntitiesOrder(sortableByField, sortedEntities)\n\n\t\tpreprocess?.(getNewlyAdded, options)\n\t})\n}\n"],"names":["sortEntities","repairEntitiesOrder"],"mappings":";;;;AAIO,MAAM,mBAAmB,CAC/B,YACA,iBACA,OACA,eACI;AACJ,QAAM,iBAAiBA,aAAAA,aAAa,MAAM,KAAK,UAAU,GAAG,eAAe;AAE3E,aAAW,gBAAgB,CAAC,eAAe,YAAY;AACtD,QAAI,aAAa,cAAA;AAEjB,UAAM,gBAAgB,WAAW,SAAiB,eAAe;AAEjE,kBAAc,YAAY,KAAK;AAC/B,iBAAa,cAAA;AAEb,mBAAe,OAAO,OAAO,GAAG,UAAU;AAC1CC,wBAAAA,oBAAoB,iBAAiB,cAAc;AAEnD,iBAAa,eAAe,OAAO;AAAA,EACpC,CAAC;AACF;;"}
1
+ {"version":3,"file":"addEntityAtIndex.cjs","sources":["../../../../../packages/react-binding/src/accessorSorting/addEntityAtIndex.ts"],"sourcesContent":["import { repairEntitiesOrder } from './repairEntitiesOrder.js'\nimport { sortEntities } from './sortEntities.js'\nimport { EntityAccessor, EntityListAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const addEntityAtIndex = (\n\tentityList: EntityListAccessor,\n\tsortableByField: RelativeSingleField,\n\tindex: number,\n\tpreprocess?: EntityAccessor.BatchUpdatesHandler,\n) => {\n\tconst sortedEntities = sortEntities(Array.from(entityList), sortableByField)\n\n\tentityList.createNewEntity((getNewlyAdded, options) => {\n\t\tlet newlyAdded = getNewlyAdded()\n\n\t\tconst sortableField = newlyAdded.getField<number>(sortableByField)\n\n\t\tsortableField.updateValue(index)\n\t\tnewlyAdded = getNewlyAdded()\n\n\t\tsortedEntities.splice(index, 0, newlyAdded)\n\t\trepairEntitiesOrder(sortableByField, sortedEntities)\n\n\t\tpreprocess?.(getNewlyAdded, options)\n\t})\n}\n"],"names":["sortEntities","repairEntitiesOrder"],"mappings":";;;;AAIO,MAAM,mBAAmB,CAC/B,YACA,iBACA,OACA,eACI;AACJ,QAAM,iBAAiBA,aAAAA,aAAa,MAAM,KAAK,UAAU,GAAG,eAAe;AAE3E,aAAW,gBAAgB,CAAC,eAAe,YAAY;AACtD,QAAI,aAAa,cAAA;AAEjB,UAAM,gBAAgB,WAAW,SAAiB,eAAe;AAEjE,kBAAc,YAAY,KAAK;AAC/B,iBAAa,cAAA;AAEb,mBAAe,OAAO,OAAO,GAAG,UAAU;AAC1CC,wBAAAA,oBAAoB,iBAAiB,cAAc;AAEnD,iBAAa,eAAe,OAAO;AAAA,EACpC,CAAC;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"addEntityAtIndex.js","sources":["../../../../../packages/react-binding/src/accessorSorting/addEntityAtIndex.ts"],"sourcesContent":["import { repairEntitiesOrder } from './repairEntitiesOrder'\nimport { sortEntities } from './sortEntities'\nimport { EntityAccessor, EntityListAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const addEntityAtIndex = (\n\tentityList: EntityListAccessor,\n\tsortableByField: RelativeSingleField,\n\tindex: number,\n\tpreprocess?: EntityAccessor.BatchUpdatesHandler,\n) => {\n\tconst sortedEntities = sortEntities(Array.from(entityList), sortableByField)\n\n\tentityList.createNewEntity((getNewlyAdded, options) => {\n\t\tlet newlyAdded = getNewlyAdded()\n\n\t\tconst sortableField = newlyAdded.getField<number>(sortableByField)\n\n\t\tsortableField.updateValue(index)\n\t\tnewlyAdded = getNewlyAdded()\n\n\t\tsortedEntities.splice(index, 0, newlyAdded)\n\t\trepairEntitiesOrder(sortableByField, sortedEntities)\n\n\t\tpreprocess?.(getNewlyAdded, options)\n\t})\n}\n"],"names":[],"mappings":";;AAIO,MAAM,mBAAmB,CAC/B,YACA,iBACA,OACA,eACI;AACJ,QAAM,iBAAiB,aAAa,MAAM,KAAK,UAAU,GAAG,eAAe;AAE3E,aAAW,gBAAgB,CAAC,eAAe,YAAY;AACtD,QAAI,aAAa,cAAA;AAEjB,UAAM,gBAAgB,WAAW,SAAiB,eAAe;AAEjE,kBAAc,YAAY,KAAK;AAC/B,iBAAa,cAAA;AAEb,mBAAe,OAAO,OAAO,GAAG,UAAU;AAC1C,wBAAoB,iBAAiB,cAAc;AAEnD,iBAAa,eAAe,OAAO;AAAA,EACpC,CAAC;AACF;"}
1
+ {"version":3,"file":"addEntityAtIndex.js","sources":["../../../../../packages/react-binding/src/accessorSorting/addEntityAtIndex.ts"],"sourcesContent":["import { repairEntitiesOrder } from './repairEntitiesOrder.js'\nimport { sortEntities } from './sortEntities.js'\nimport { EntityAccessor, EntityListAccessor, RelativeSingleField } from '@contember/binding'\n\nexport const addEntityAtIndex = (\n\tentityList: EntityListAccessor,\n\tsortableByField: RelativeSingleField,\n\tindex: number,\n\tpreprocess?: EntityAccessor.BatchUpdatesHandler,\n) => {\n\tconst sortedEntities = sortEntities(Array.from(entityList), sortableByField)\n\n\tentityList.createNewEntity((getNewlyAdded, options) => {\n\t\tlet newlyAdded = getNewlyAdded()\n\n\t\tconst sortableField = newlyAdded.getField<number>(sortableByField)\n\n\t\tsortableField.updateValue(index)\n\t\tnewlyAdded = getNewlyAdded()\n\n\t\tsortedEntities.splice(index, 0, newlyAdded)\n\t\trepairEntitiesOrder(sortableByField, sortedEntities)\n\n\t\tpreprocess?.(getNewlyAdded, options)\n\t})\n}\n"],"names":[],"mappings":";;AAIO,MAAM,mBAAmB,CAC/B,YACA,iBACA,OACA,eACI;AACJ,QAAM,iBAAiB,aAAa,MAAM,KAAK,UAAU,GAAG,eAAe;AAE3E,aAAW,gBAAgB,CAAC,eAAe,YAAY;AACtD,QAAI,aAAa,cAAA;AAEjB,UAAM,gBAAgB,WAAW,SAAiB,eAAe;AAEjE,kBAAc,YAAY,KAAK;AAC/B,iBAAa,cAAA;AAEb,mBAAe,OAAO,OAAO,GAAG,UAAU;AAC1C,wBAAoB,iBAAiB,cAAc;AAEnD,iBAAa,eAAe,OAAO;AAAA,EACpC,CAAC;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AccessorTree.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTree.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { BindingOperationsProvider, EnvironmentContext, TreeRootIdProvider } from '../accessorPropagation'\nimport type { AccessorTreeState } from './AccessorTreeState'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext'\nimport { DirtinessContext } from './DirtinessContext'\nimport { MutationStateContext } from './MutationStateContext'\nimport { EntityKeyContext } from '../accessorPropagation/EntityKeyContext'\n\nexport interface AccessorTreeProps {\n\tstate: AccessorTreeState\n\tchildren: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const AccessorTree = ({ state, children }: AccessorTreeProps) => {\n\tconst stateData = state.name === 'initialized' ? state.data : {\n\t\thasUnpersistedChanges: false,\n\t\tisMutating: false,\n\t\tbindingOperations: undefined,\n\t}\n\treturn (\n\t\t<TreeRootIdProvider treeRootId={undefined}>\n\t\t\t<EntityKeyContext.Provider value={undefined}>\n\t\t\t\t<EnvironmentContext.Provider value={state.environment}>\n\t\t\t\t\t<AccessorTreeStateContext.Provider value={state}>\n\t\t\t\t\t\t<DirtinessContext.Provider value={stateData.hasUnpersistedChanges}>\n\t\t\t\t\t\t\t<MutationStateContext.Provider value={stateData.isMutating}>\n\t\t\t\t\t\t\t\t<BindingOperationsProvider bindingOperations={stateData.bindingOperations}>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</BindingOperationsProvider>\n\t\t\t\t\t\t\t</MutationStateContext.Provider>\n\t\t\t\t\t\t</DirtinessContext.Provider>\n\t\t\t\t\t</AccessorTreeStateContext.Provider>\n\t\t\t\t</EnvironmentContext.Provider>\n\t\t\t</EntityKeyContext.Provider>\n\t\t</TreeRootIdProvider>\n\t)\n}\n\nAccessorTree.displayName = 'AccessorTree'\n"],"names":["jsx","TreeRootIdProvider","EntityKeyContext","EnvironmentContext","AccessorTreeStateContext","DirtinessContext","MutationStateContext","BindingOperationsProvider"],"mappings":";;;;;;;;;;AAgBO,MAAM,eAAe,CAAC,EAAE,OAAO,eAAkC;AACvE,QAAM,YAAY,MAAM,SAAS,gBAAgB,MAAM,OAAO;AAAA,IAC7D,uBAAuB;AAAA,IACvB,YAAY;AAAA,IACZ,mBAAmB;AAAA,EAAA;AAEpB,SACCA,2BAAAA,IAACC,mBAAAA,sBAAmB,YAAY,QAC/B,yCAACC,iBAAAA,iBAAiB,UAAjB,EAA0B,OAAO,QACjC,UAAAF,2BAAAA,IAACG,mBAAAA,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,aACzC,yCAACC,yBAAAA,yBAAyB,UAAzB,EAAkC,OAAO,OACzC,UAAAJ,2BAAAA,IAACK,iBAAAA,iBAAiB,UAAjB,EAA0B,OAAO,UAAU,uBAC3C,yCAACC,qBAAAA,qBAAqB,UAArB,EAA8B,OAAO,UAAU,YAC/C,yCAACC,0BAAAA,2BAAA,EAA0B,mBAAmB,UAAU,mBACtD,SAAA,CACF,GACD,EAAA,CACD,EAAA,CACD,GACD,EAAA,CACD,EAAA,CACD;AAEF;AAEA,aAAa,cAAc;;"}
1
+ {"version":3,"file":"AccessorTree.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTree.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { BindingOperationsProvider, EnvironmentContext, TreeRootIdProvider } from '../accessorPropagation/index.js'\nimport type { AccessorTreeState } from './AccessorTreeState.js'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext.js'\nimport { DirtinessContext } from './DirtinessContext.js'\nimport { MutationStateContext } from './MutationStateContext.js'\nimport { EntityKeyContext } from '../accessorPropagation/EntityKeyContext.js'\n\nexport interface AccessorTreeProps {\n\tstate: AccessorTreeState\n\tchildren: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const AccessorTree = ({ state, children }: AccessorTreeProps) => {\n\tconst stateData = state.name === 'initialized' ? state.data : {\n\t\thasUnpersistedChanges: false,\n\t\tisMutating: false,\n\t\tbindingOperations: undefined,\n\t}\n\treturn (\n\t\t<TreeRootIdProvider treeRootId={undefined}>\n\t\t\t<EntityKeyContext.Provider value={undefined}>\n\t\t\t\t<EnvironmentContext.Provider value={state.environment}>\n\t\t\t\t\t<AccessorTreeStateContext.Provider value={state}>\n\t\t\t\t\t\t<DirtinessContext.Provider value={stateData.hasUnpersistedChanges}>\n\t\t\t\t\t\t\t<MutationStateContext.Provider value={stateData.isMutating}>\n\t\t\t\t\t\t\t\t<BindingOperationsProvider bindingOperations={stateData.bindingOperations}>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</BindingOperationsProvider>\n\t\t\t\t\t\t\t</MutationStateContext.Provider>\n\t\t\t\t\t\t</DirtinessContext.Provider>\n\t\t\t\t\t</AccessorTreeStateContext.Provider>\n\t\t\t\t</EnvironmentContext.Provider>\n\t\t\t</EntityKeyContext.Provider>\n\t\t</TreeRootIdProvider>\n\t)\n}\n\nAccessorTree.displayName = 'AccessorTree'\n"],"names":["jsx","TreeRootIdProvider","EntityKeyContext","EnvironmentContext","AccessorTreeStateContext","DirtinessContext","MutationStateContext","BindingOperationsProvider"],"mappings":";;;;;;;;;;AAgBO,MAAM,eAAe,CAAC,EAAE,OAAO,eAAkC;AACvE,QAAM,YAAY,MAAM,SAAS,gBAAgB,MAAM,OAAO;AAAA,IAC7D,uBAAuB;AAAA,IACvB,YAAY;AAAA,IACZ,mBAAmB;AAAA,EAAA;AAEpB,SACCA,2BAAAA,IAACC,mBAAAA,sBAAmB,YAAY,QAC/B,yCAACC,iBAAAA,iBAAiB,UAAjB,EAA0B,OAAO,QACjC,UAAAF,2BAAAA,IAACG,mBAAAA,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,aACzC,yCAACC,yBAAAA,yBAAyB,UAAzB,EAAkC,OAAO,OACzC,UAAAJ,2BAAAA,IAACK,iBAAAA,iBAAiB,UAAjB,EAA0B,OAAO,UAAU,uBAC3C,yCAACC,qBAAAA,qBAAqB,UAArB,EAA8B,OAAO,UAAU,YAC/C,yCAACC,0BAAAA,2BAAA,EAA0B,mBAAmB,UAAU,mBACtD,SAAA,CACF,GACD,EAAA,CACD,EAAA,CACD,GACD,EAAA,CACD,EAAA,CACD;AAEF;AAEA,aAAa,cAAc;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AccessorTree.js","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTree.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { BindingOperationsProvider, EnvironmentContext, TreeRootIdProvider } from '../accessorPropagation'\nimport type { AccessorTreeState } from './AccessorTreeState'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext'\nimport { DirtinessContext } from './DirtinessContext'\nimport { MutationStateContext } from './MutationStateContext'\nimport { EntityKeyContext } from '../accessorPropagation/EntityKeyContext'\n\nexport interface AccessorTreeProps {\n\tstate: AccessorTreeState\n\tchildren: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const AccessorTree = ({ state, children }: AccessorTreeProps) => {\n\tconst stateData = state.name === 'initialized' ? state.data : {\n\t\thasUnpersistedChanges: false,\n\t\tisMutating: false,\n\t\tbindingOperations: undefined,\n\t}\n\treturn (\n\t\t<TreeRootIdProvider treeRootId={undefined}>\n\t\t\t<EntityKeyContext.Provider value={undefined}>\n\t\t\t\t<EnvironmentContext.Provider value={state.environment}>\n\t\t\t\t\t<AccessorTreeStateContext.Provider value={state}>\n\t\t\t\t\t\t<DirtinessContext.Provider value={stateData.hasUnpersistedChanges}>\n\t\t\t\t\t\t\t<MutationStateContext.Provider value={stateData.isMutating}>\n\t\t\t\t\t\t\t\t<BindingOperationsProvider bindingOperations={stateData.bindingOperations}>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</BindingOperationsProvider>\n\t\t\t\t\t\t\t</MutationStateContext.Provider>\n\t\t\t\t\t\t</DirtinessContext.Provider>\n\t\t\t\t\t</AccessorTreeStateContext.Provider>\n\t\t\t\t</EnvironmentContext.Provider>\n\t\t\t</EntityKeyContext.Provider>\n\t\t</TreeRootIdProvider>\n\t)\n}\n\nAccessorTree.displayName = 'AccessorTree'\n"],"names":[],"mappings":";;;;;;;;AAgBO,MAAM,eAAe,CAAC,EAAE,OAAO,eAAkC;AACvE,QAAM,YAAY,MAAM,SAAS,gBAAgB,MAAM,OAAO;AAAA,IAC7D,uBAAuB;AAAA,IACvB,YAAY;AAAA,IACZ,mBAAmB;AAAA,EAAA;AAEpB,SACC,oBAAC,sBAAmB,YAAY,QAC/B,8BAAC,iBAAiB,UAAjB,EAA0B,OAAO,QACjC,UAAA,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,aACzC,8BAAC,yBAAyB,UAAzB,EAAkC,OAAO,OACzC,UAAA,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,UAAU,uBAC3C,8BAAC,qBAAqB,UAArB,EAA8B,OAAO,UAAU,YAC/C,8BAAC,2BAAA,EAA0B,mBAAmB,UAAU,mBACtD,SAAA,CACF,GACD,EAAA,CACD,EAAA,CACD,GACD,EAAA,CACD,EAAA,CACD;AAEF;AAEA,aAAa,cAAc;"}
1
+ {"version":3,"file":"AccessorTree.js","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTree.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { BindingOperationsProvider, EnvironmentContext, TreeRootIdProvider } from '../accessorPropagation/index.js'\nimport type { AccessorTreeState } from './AccessorTreeState.js'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext.js'\nimport { DirtinessContext } from './DirtinessContext.js'\nimport { MutationStateContext } from './MutationStateContext.js'\nimport { EntityKeyContext } from '../accessorPropagation/EntityKeyContext.js'\n\nexport interface AccessorTreeProps {\n\tstate: AccessorTreeState\n\tchildren: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const AccessorTree = ({ state, children }: AccessorTreeProps) => {\n\tconst stateData = state.name === 'initialized' ? state.data : {\n\t\thasUnpersistedChanges: false,\n\t\tisMutating: false,\n\t\tbindingOperations: undefined,\n\t}\n\treturn (\n\t\t<TreeRootIdProvider treeRootId={undefined}>\n\t\t\t<EntityKeyContext.Provider value={undefined}>\n\t\t\t\t<EnvironmentContext.Provider value={state.environment}>\n\t\t\t\t\t<AccessorTreeStateContext.Provider value={state}>\n\t\t\t\t\t\t<DirtinessContext.Provider value={stateData.hasUnpersistedChanges}>\n\t\t\t\t\t\t\t<MutationStateContext.Provider value={stateData.isMutating}>\n\t\t\t\t\t\t\t\t<BindingOperationsProvider bindingOperations={stateData.bindingOperations}>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</BindingOperationsProvider>\n\t\t\t\t\t\t\t</MutationStateContext.Provider>\n\t\t\t\t\t\t</DirtinessContext.Provider>\n\t\t\t\t\t</AccessorTreeStateContext.Provider>\n\t\t\t\t</EnvironmentContext.Provider>\n\t\t\t</EntityKeyContext.Provider>\n\t\t</TreeRootIdProvider>\n\t)\n}\n\nAccessorTree.displayName = 'AccessorTree'\n"],"names":[],"mappings":";;;;;;;;AAgBO,MAAM,eAAe,CAAC,EAAE,OAAO,eAAkC;AACvE,QAAM,YAAY,MAAM,SAAS,gBAAgB,MAAM,OAAO;AAAA,IAC7D,uBAAuB;AAAA,IACvB,YAAY;AAAA,IACZ,mBAAmB;AAAA,EAAA;AAEpB,SACC,oBAAC,sBAAmB,YAAY,QAC/B,8BAAC,iBAAiB,UAAjB,EAA0B,OAAO,QACjC,UAAA,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,aACzC,8BAAC,yBAAyB,UAAzB,EAAkC,OAAO,OACzC,UAAA,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,UAAU,uBAC3C,8BAAC,qBAAqB,UAArB,EAA8B,OAAO,UAAU,YAC/C,8BAAC,2BAAA,EAA0B,mBAAmB,UAAU,mBACtD,SAAA,CACF,GACD,EAAA,CACD,EAAA,CACD,GACD,EAAA,CACD,EAAA,CACD;AAEF;AAEA,aAAa,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AccessorTreeStateContext.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTreeStateContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport { AccessorTreeState } from './AccessorTreeState'\n\nexport const AccessorTreeStateContext = createContext<AccessorTreeState | undefined>(undefined)\n"],"names":["createContext"],"mappings":";;;AAGO,MAAM,2BAA2BA,MAAAA,cAA6C,MAAS;;"}
1
+ {"version":3,"file":"AccessorTreeStateContext.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTreeStateContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport { AccessorTreeState } from './AccessorTreeState.js'\n\nexport const AccessorTreeStateContext = createContext<AccessorTreeState | undefined>(undefined)\n"],"names":["createContext"],"mappings":";;;AAGO,MAAM,2BAA2BA,MAAAA,cAA6C,MAAS;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AccessorTreeStateContext.js","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTreeStateContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport { AccessorTreeState } from './AccessorTreeState'\n\nexport const AccessorTreeStateContext = createContext<AccessorTreeState | undefined>(undefined)\n"],"names":[],"mappings":";AAGO,MAAM,2BAA2B,cAA6C,MAAS;"}
1
+ {"version":3,"file":"AccessorTreeStateContext.js","sources":["../../../../../packages/react-binding/src/accessorTree/AccessorTreeStateContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport { AccessorTreeState } from './AccessorTreeState.js'\n\nexport const AccessorTreeStateContext = createContext<AccessorTreeState | undefined>(undefined)\n"],"names":[],"mappings":";AAGO,MAAM,2BAA2B,cAA6C,MAAS;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAccessorTreeState.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/useAccessorTreeState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext'\nimport { BindingError } from '@contember/binding'\n\nexport const useAccessorTreeState = () => {\n\tconst state = useContext(AccessorTreeStateContext)\n\tif (!state) {\n\t\tthrow new BindingError()\n\t}\n\treturn state\n}\n"],"names":["useContext","AccessorTreeStateContext","BindingError"],"mappings":";;;;;AAIO,MAAM,uBAAuB,MAAM;AACzC,QAAM,QAAQA,MAAAA,WAAWC,iDAAwB;AACjD,MAAI,CAAC,OAAO;AACX,UAAM,IAAIC,QAAAA,aAAA;AAAA,EACX;AACA,SAAO;AACR;;"}
1
+ {"version":3,"file":"useAccessorTreeState.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/useAccessorTreeState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext.js'\nimport { BindingError } from '@contember/binding'\n\nexport const useAccessorTreeState = () => {\n\tconst state = useContext(AccessorTreeStateContext)\n\tif (!state) {\n\t\tthrow new BindingError()\n\t}\n\treturn state\n}\n"],"names":["useContext","AccessorTreeStateContext","BindingError"],"mappings":";;;;;AAIO,MAAM,uBAAuB,MAAM;AACzC,QAAM,QAAQA,MAAAA,WAAWC,iDAAwB;AACjD,MAAI,CAAC,OAAO;AACX,UAAM,IAAIC,QAAAA,aAAA;AAAA,EACX;AACA,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAccessorTreeState.js","sources":["../../../../../packages/react-binding/src/accessorTree/useAccessorTreeState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext'\nimport { BindingError } from '@contember/binding'\n\nexport const useAccessorTreeState = () => {\n\tconst state = useContext(AccessorTreeStateContext)\n\tif (!state) {\n\t\tthrow new BindingError()\n\t}\n\treturn state\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,uBAAuB,MAAM;AACzC,QAAM,QAAQ,WAAW,wBAAwB;AACjD,MAAI,CAAC,OAAO;AACX,UAAM,IAAI,aAAA;AAAA,EACX;AACA,SAAO;AACR;"}
1
+ {"version":3,"file":"useAccessorTreeState.js","sources":["../../../../../packages/react-binding/src/accessorTree/useAccessorTreeState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { AccessorTreeStateContext } from './AccessorTreeStateContext.js'\nimport { BindingError } from '@contember/binding'\n\nexport const useAccessorTreeState = () => {\n\tconst state = useContext(AccessorTreeStateContext)\n\tif (!state) {\n\t\tthrow new BindingError()\n\t}\n\treturn state\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,uBAAuB,MAAM;AACzC,QAAM,QAAQ,WAAW,wBAAwB;AACjD,MAAI,CAAC,OAAO;AACX,UAAM,IAAI,aAAA;AAAA,EACX;AACA,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDataBinding.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/useDataBinding.ts"],"sourcesContent":["import { GraphQlClientError, useCurrentContentGraphQlClient, useCurrentSystemGraphQlClient, useTenantGraphQlClient } from '@contember/react-client'\nimport { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport type { TreeRootAccessor } from '@contember/binding'\nimport { DataBinding, Environment, TreeStore } from '@contember/binding'\nimport type { AccessorTreeState } from './AccessorTreeState'\nimport { useIsMounted } from '@contember/react-utils'\nimport { MarkerTreeGenerator } from '../markers'\nimport ReactDOM from 'react-dom'\nimport { useEnvironmentWithSchema } from './useEnvironmentWithSchema'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport const useDataBinding = ({\n\tchildren,\n\trefreshOnPersist,\n\tskipStateUpdateAfterPersist,\n}: {\n\tchildren?: ReactNode\n\trefreshOnPersist?: boolean\n\tskipStateUpdateAfterPersist?: boolean\n}): AccessorTreeState => {\n\tconst contentClient = useCurrentContentGraphQlClient()\n\tconst systemClient = useCurrentSystemGraphQlClient()\n\tconst tenantClient = useTenantGraphQlClient()\n\n\tconst environment = useEnvironment()\n\tconst environmentWithSchema = useEnvironmentWithSchema(environment)\n\n\tconst currentTreeStore = useRef<TreeStore>(undefined)\n\tconst isMountedRef = useIsMounted()\n\n\tconst [state, setState] = useState<AccessorTreeState & { binding?: DataBinding<ReactNode> }>({\n\t\tname: 'initializing',\n\t\tenvironment,\n\t})\n\n\tconst resetDataBinding = useCallback((environment: Environment, newStore: boolean) => {\n\t\tconst onUpdate = (data: TreeRootAccessor<ReactNode>, binding: DataBinding<ReactNode>) => {\n\t\t\tif (isMountedRef.current) {\n\t\t\t\tsetState(it =>\n\t\t\t\t\tit.name === 'error' || it.binding !== binding ? it : {\n\t\t\t\t\t\tname: 'initialized',\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tbinding,\n\t\t\t\t\t\tdata,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tconst onError = (error: GraphQlClientError, binding: DataBinding<ReactNode>) => {\n\t\t\tif (isMountedRef.current) {\n\t\t\t\tsetState(it =>\n\t\t\t\t\tit.binding !== binding ? it : {\n\t\t\t\t\t\tname: 'error',\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tbinding,\n\t\t\t\t\t\terror,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tconst onPersistSuccess = () => {\n\t\t\tif (isMountedRef.current && refreshOnPersist) {\n\t\t\t\tresetDataBinding(environment, true)\n\t\t\t}\n\t\t}\n\n\t\tif (currentTreeStore.current === undefined || newStore) {\n\t\t\tcurrentTreeStore.current = new TreeStore(environment.getSchema())\n\t\t}\n\n\t\tconst binding = new DataBinding(\n\t\t\tcontentClient,\n\t\t\tsystemClient,\n\t\t\ttenantClient,\n\t\t\tcurrentTreeStore.current,\n\t\t\tenvironment,\n\t\t\t(node, env) => {\n\t\t\t\tconst gen = new MarkerTreeGenerator(node, env)\n\t\t\t\treturn gen.generate()\n\t\t\t},\n\t\t\tReactDOM.unstable_batchedUpdates,\n\t\t\tonUpdate,\n\t\t\tonError,\n\t\t\tonPersistSuccess,\n\t\t\t{\n\t\t\t\tskipStateUpdateAfterPersist: skipStateUpdateAfterPersist ?? false,\n\t\t\t},\n\t\t)\n\t\tsetState({ binding, environment, name: 'initializing' })\n\t}, [contentClient, systemClient, tenantClient, isMountedRef, refreshOnPersist, skipStateUpdateAfterPersist])\n\n\tuseEffect(() => {\n\t\tif (environmentWithSchema) {\n\t\t\tresetDataBinding(environmentWithSchema, false)\n\t\t}\n\t}, [resetDataBinding, environmentWithSchema])\n\n\tuseEffect(() => {\n\t\tstate.binding?.extendTree(children)\n\t}, [children, state.binding])\n\n\treturn state\n}\n"],"names":["useCurrentContentGraphQlClient","useCurrentSystemGraphQlClient","useTenantGraphQlClient","useEnvironment","useEnvironmentWithSchema","useRef","useIsMounted","useState","useCallback","environment","binding","TreeStore","DataBinding","MarkerTreeGenerator","useEffect"],"mappings":";;;;;;;;;;AAWO,MAAM,iBAAiB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACD,MAIyB;AACxB,QAAM,gBAAgBA,YAAAA,+BAAA;AACtB,QAAM,eAAeC,YAAAA,8BAAA;AACrB,QAAM,eAAeC,YAAAA,uBAAA;AAErB,QAAM,cAAcC,eAAAA,eAAA;AACpB,QAAM,wBAAwBC,yBAAAA,yBAAyB,WAAW;AAElE,QAAM,mBAAmBC,MAAAA,OAAkB,MAAS;AACpD,QAAM,eAAeC,WAAAA,aAAA;AAErB,QAAM,CAAC,OAAO,QAAQ,IAAIC,eAAmE;AAAA,IAC5F,MAAM;AAAA,IACN;AAAA,EAAA,CACA;AAED,QAAM,mBAAmBC,MAAAA,YAAY,CAACC,cAA0B,aAAsB;AACrF,UAAM,WAAW,CAAC,MAAmCC,aAAoC;AACxF,UAAI,aAAa,SAAS;AACzB;AAAA,UAAS,QACR,GAAG,SAAS,WAAW,GAAG,YAAYA,WAAU,KAAK;AAAA,YACpD,MAAM;AAAA,YACN,aAAAD;AAAAA,YACA,SAAAC;AAAAA,YACA;AAAA,UAAA;AAAA,QACD;AAAA,MAEF;AAAA,IACD;AAEA,UAAM,UAAU,CAAC,OAA2BA,aAAoC;AAC/E,UAAI,aAAa,SAAS;AACzB;AAAA,UAAS,CAAA,OACR,GAAG,YAAYA,WAAU,KAAK;AAAA,YAC7B,MAAM;AAAA,YACN,aAAAD;AAAAA,YACA,SAAAC;AAAAA,YACA;AAAA,UAAA;AAAA,QACD;AAAA,MAEF;AAAA,IACD;AAEA,UAAM,mBAAmB,MAAM;AAC9B,UAAI,aAAa,WAAW,kBAAkB;AAC7C,yBAAiBD,cAAa,IAAI;AAAA,MACnC;AAAA,IACD;AAEA,QAAI,iBAAiB,YAAY,UAAa,UAAU;AACvD,uBAAiB,UAAU,IAAIE,QAAAA,UAAUF,aAAY,WAAW;AAAA,IACjE;AAEA,UAAMC,YAAU,IAAIE,QAAAA;AAAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjBH;AAAAA,MACA,CAAC,MAAM,QAAQ;AACd,cAAM,MAAM,IAAII,wCAAoB,MAAM,GAAG;AAC7C,eAAO,IAAI,SAAA;AAAA,MACZ;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACC,6BAA6B,+BAA+B;AAAA,MAAA;AAAA,IAC7D;AAED,aAAS,EAAA,SAAEH,WAAS,aAAAD,cAAa,MAAM,gBAAgB;AAAA,EACxD,GAAG,CAAC,eAAe,cAAc,cAAc,cAAc,kBAAkB,2BAA2B,CAAC;AAE3GK,QAAAA,UAAU,MAAM;AACf,QAAI,uBAAuB;AAC1B,uBAAiB,uBAAuB,KAAK;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,kBAAkB,qBAAqB,CAAC;AAE5CA,QAAAA,UAAU,MAAM;AACf,UAAM,SAAS,WAAW,QAAQ;AAAA,EACnC,GAAG,CAAC,UAAU,MAAM,OAAO,CAAC;AAE5B,SAAO;AACR;;"}
1
+ {"version":3,"file":"useDataBinding.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/useDataBinding.ts"],"sourcesContent":["import { GraphQlClientError, useCurrentContentGraphQlClient, useCurrentSystemGraphQlClient, useTenantGraphQlClient } from '@contember/react-client'\nimport { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport type { TreeRootAccessor } from '@contember/binding'\nimport { DataBinding, Environment, TreeStore } from '@contember/binding'\nimport type { AccessorTreeState } from './AccessorTreeState.js'\nimport { useIsMounted } from '@contember/react-utils'\nimport { MarkerTreeGenerator } from '../markers/index.js'\nimport ReactDOM from 'react-dom'\nimport { useEnvironmentWithSchema } from './useEnvironmentWithSchema.js'\nimport { useEnvironment } from '../accessorPropagation/index.js'\n\nexport const useDataBinding = ({\n\tchildren,\n\trefreshOnPersist,\n\tskipStateUpdateAfterPersist,\n}: {\n\tchildren?: ReactNode\n\trefreshOnPersist?: boolean\n\tskipStateUpdateAfterPersist?: boolean\n}): AccessorTreeState => {\n\tconst contentClient = useCurrentContentGraphQlClient()\n\tconst systemClient = useCurrentSystemGraphQlClient()\n\tconst tenantClient = useTenantGraphQlClient()\n\n\tconst environment = useEnvironment()\n\tconst environmentWithSchema = useEnvironmentWithSchema(environment)\n\n\tconst currentTreeStore = useRef<TreeStore>(undefined)\n\tconst isMountedRef = useIsMounted()\n\n\tconst [state, setState] = useState<AccessorTreeState & { binding?: DataBinding<ReactNode> }>({\n\t\tname: 'initializing',\n\t\tenvironment,\n\t})\n\n\tconst resetDataBinding = useCallback((environment: Environment, newStore: boolean) => {\n\t\tconst onUpdate = (data: TreeRootAccessor<ReactNode>, binding: DataBinding<ReactNode>) => {\n\t\t\tif (isMountedRef.current) {\n\t\t\t\tsetState(it =>\n\t\t\t\t\tit.name === 'error' || it.binding !== binding ? it : {\n\t\t\t\t\t\tname: 'initialized',\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tbinding,\n\t\t\t\t\t\tdata,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tconst onError = (error: GraphQlClientError, binding: DataBinding<ReactNode>) => {\n\t\t\tif (isMountedRef.current) {\n\t\t\t\tsetState(it =>\n\t\t\t\t\tit.binding !== binding ? it : {\n\t\t\t\t\t\tname: 'error',\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tbinding,\n\t\t\t\t\t\terror,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tconst onPersistSuccess = () => {\n\t\t\tif (isMountedRef.current && refreshOnPersist) {\n\t\t\t\tresetDataBinding(environment, true)\n\t\t\t}\n\t\t}\n\n\t\tif (currentTreeStore.current === undefined || newStore) {\n\t\t\tcurrentTreeStore.current = new TreeStore(environment.getSchema())\n\t\t}\n\n\t\tconst binding = new DataBinding(\n\t\t\tcontentClient,\n\t\t\tsystemClient,\n\t\t\ttenantClient,\n\t\t\tcurrentTreeStore.current,\n\t\t\tenvironment,\n\t\t\t(node, env) => {\n\t\t\t\tconst gen = new MarkerTreeGenerator(node, env)\n\t\t\t\treturn gen.generate()\n\t\t\t},\n\t\t\tReactDOM.unstable_batchedUpdates,\n\t\t\tonUpdate,\n\t\t\tonError,\n\t\t\tonPersistSuccess,\n\t\t\t{\n\t\t\t\tskipStateUpdateAfterPersist: skipStateUpdateAfterPersist ?? false,\n\t\t\t},\n\t\t)\n\t\tsetState({ binding, environment, name: 'initializing' })\n\t}, [contentClient, systemClient, tenantClient, isMountedRef, refreshOnPersist, skipStateUpdateAfterPersist])\n\n\tuseEffect(() => {\n\t\tif (environmentWithSchema) {\n\t\t\tresetDataBinding(environmentWithSchema, false)\n\t\t}\n\t}, [resetDataBinding, environmentWithSchema])\n\n\tuseEffect(() => {\n\t\tstate.binding?.extendTree(children)\n\t}, [children, state.binding])\n\n\treturn state\n}\n"],"names":["useCurrentContentGraphQlClient","useCurrentSystemGraphQlClient","useTenantGraphQlClient","useEnvironment","useEnvironmentWithSchema","useRef","useIsMounted","useState","useCallback","environment","binding","TreeStore","DataBinding","MarkerTreeGenerator","useEffect"],"mappings":";;;;;;;;;;AAWO,MAAM,iBAAiB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACD,MAIyB;AACxB,QAAM,gBAAgBA,YAAAA,+BAAA;AACtB,QAAM,eAAeC,YAAAA,8BAAA;AACrB,QAAM,eAAeC,YAAAA,uBAAA;AAErB,QAAM,cAAcC,eAAAA,eAAA;AACpB,QAAM,wBAAwBC,yBAAAA,yBAAyB,WAAW;AAElE,QAAM,mBAAmBC,MAAAA,OAAkB,MAAS;AACpD,QAAM,eAAeC,WAAAA,aAAA;AAErB,QAAM,CAAC,OAAO,QAAQ,IAAIC,eAAmE;AAAA,IAC5F,MAAM;AAAA,IACN;AAAA,EAAA,CACA;AAED,QAAM,mBAAmBC,MAAAA,YAAY,CAACC,cAA0B,aAAsB;AACrF,UAAM,WAAW,CAAC,MAAmCC,aAAoC;AACxF,UAAI,aAAa,SAAS;AACzB;AAAA,UAAS,QACR,GAAG,SAAS,WAAW,GAAG,YAAYA,WAAU,KAAK;AAAA,YACpD,MAAM;AAAA,YACN,aAAAD;AAAAA,YACA,SAAAC;AAAAA,YACA;AAAA,UAAA;AAAA,QACD;AAAA,MAEF;AAAA,IACD;AAEA,UAAM,UAAU,CAAC,OAA2BA,aAAoC;AAC/E,UAAI,aAAa,SAAS;AACzB;AAAA,UAAS,CAAA,OACR,GAAG,YAAYA,WAAU,KAAK;AAAA,YAC7B,MAAM;AAAA,YACN,aAAAD;AAAAA,YACA,SAAAC;AAAAA,YACA;AAAA,UAAA;AAAA,QACD;AAAA,MAEF;AAAA,IACD;AAEA,UAAM,mBAAmB,MAAM;AAC9B,UAAI,aAAa,WAAW,kBAAkB;AAC7C,yBAAiBD,cAAa,IAAI;AAAA,MACnC;AAAA,IACD;AAEA,QAAI,iBAAiB,YAAY,UAAa,UAAU;AACvD,uBAAiB,UAAU,IAAIE,QAAAA,UAAUF,aAAY,WAAW;AAAA,IACjE;AAEA,UAAMC,YAAU,IAAIE,QAAAA;AAAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjBH;AAAAA,MACA,CAAC,MAAM,QAAQ;AACd,cAAM,MAAM,IAAII,wCAAoB,MAAM,GAAG;AAC7C,eAAO,IAAI,SAAA;AAAA,MACZ;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACC,6BAA6B,+BAA+B;AAAA,MAAA;AAAA,IAC7D;AAED,aAAS,EAAA,SAAEH,WAAS,aAAAD,cAAa,MAAM,gBAAgB;AAAA,EACxD,GAAG,CAAC,eAAe,cAAc,cAAc,cAAc,kBAAkB,2BAA2B,CAAC;AAE3GK,QAAAA,UAAU,MAAM;AACf,QAAI,uBAAuB;AAC1B,uBAAiB,uBAAuB,KAAK;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,kBAAkB,qBAAqB,CAAC;AAE5CA,QAAAA,UAAU,MAAM;AACf,UAAM,SAAS,WAAW,QAAQ;AAAA,EACnC,GAAG,CAAC,UAAU,MAAM,OAAO,CAAC;AAE5B,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDataBinding.js","sources":["../../../../../packages/react-binding/src/accessorTree/useDataBinding.ts"],"sourcesContent":["import { GraphQlClientError, useCurrentContentGraphQlClient, useCurrentSystemGraphQlClient, useTenantGraphQlClient } from '@contember/react-client'\nimport { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport type { TreeRootAccessor } from '@contember/binding'\nimport { DataBinding, Environment, TreeStore } from '@contember/binding'\nimport type { AccessorTreeState } from './AccessorTreeState'\nimport { useIsMounted } from '@contember/react-utils'\nimport { MarkerTreeGenerator } from '../markers'\nimport ReactDOM from 'react-dom'\nimport { useEnvironmentWithSchema } from './useEnvironmentWithSchema'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport const useDataBinding = ({\n\tchildren,\n\trefreshOnPersist,\n\tskipStateUpdateAfterPersist,\n}: {\n\tchildren?: ReactNode\n\trefreshOnPersist?: boolean\n\tskipStateUpdateAfterPersist?: boolean\n}): AccessorTreeState => {\n\tconst contentClient = useCurrentContentGraphQlClient()\n\tconst systemClient = useCurrentSystemGraphQlClient()\n\tconst tenantClient = useTenantGraphQlClient()\n\n\tconst environment = useEnvironment()\n\tconst environmentWithSchema = useEnvironmentWithSchema(environment)\n\n\tconst currentTreeStore = useRef<TreeStore>(undefined)\n\tconst isMountedRef = useIsMounted()\n\n\tconst [state, setState] = useState<AccessorTreeState & { binding?: DataBinding<ReactNode> }>({\n\t\tname: 'initializing',\n\t\tenvironment,\n\t})\n\n\tconst resetDataBinding = useCallback((environment: Environment, newStore: boolean) => {\n\t\tconst onUpdate = (data: TreeRootAccessor<ReactNode>, binding: DataBinding<ReactNode>) => {\n\t\t\tif (isMountedRef.current) {\n\t\t\t\tsetState(it =>\n\t\t\t\t\tit.name === 'error' || it.binding !== binding ? it : {\n\t\t\t\t\t\tname: 'initialized',\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tbinding,\n\t\t\t\t\t\tdata,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tconst onError = (error: GraphQlClientError, binding: DataBinding<ReactNode>) => {\n\t\t\tif (isMountedRef.current) {\n\t\t\t\tsetState(it =>\n\t\t\t\t\tit.binding !== binding ? it : {\n\t\t\t\t\t\tname: 'error',\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tbinding,\n\t\t\t\t\t\terror,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tconst onPersistSuccess = () => {\n\t\t\tif (isMountedRef.current && refreshOnPersist) {\n\t\t\t\tresetDataBinding(environment, true)\n\t\t\t}\n\t\t}\n\n\t\tif (currentTreeStore.current === undefined || newStore) {\n\t\t\tcurrentTreeStore.current = new TreeStore(environment.getSchema())\n\t\t}\n\n\t\tconst binding = new DataBinding(\n\t\t\tcontentClient,\n\t\t\tsystemClient,\n\t\t\ttenantClient,\n\t\t\tcurrentTreeStore.current,\n\t\t\tenvironment,\n\t\t\t(node, env) => {\n\t\t\t\tconst gen = new MarkerTreeGenerator(node, env)\n\t\t\t\treturn gen.generate()\n\t\t\t},\n\t\t\tReactDOM.unstable_batchedUpdates,\n\t\t\tonUpdate,\n\t\t\tonError,\n\t\t\tonPersistSuccess,\n\t\t\t{\n\t\t\t\tskipStateUpdateAfterPersist: skipStateUpdateAfterPersist ?? false,\n\t\t\t},\n\t\t)\n\t\tsetState({ binding, environment, name: 'initializing' })\n\t}, [contentClient, systemClient, tenantClient, isMountedRef, refreshOnPersist, skipStateUpdateAfterPersist])\n\n\tuseEffect(() => {\n\t\tif (environmentWithSchema) {\n\t\t\tresetDataBinding(environmentWithSchema, false)\n\t\t}\n\t}, [resetDataBinding, environmentWithSchema])\n\n\tuseEffect(() => {\n\t\tstate.binding?.extendTree(children)\n\t}, [children, state.binding])\n\n\treturn state\n}\n"],"names":["environment","binding"],"mappings":";;;;;;;;AAWO,MAAM,iBAAiB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACD,MAIyB;AACxB,QAAM,gBAAgB,+BAAA;AACtB,QAAM,eAAe,8BAAA;AACrB,QAAM,eAAe,uBAAA;AAErB,QAAM,cAAc,eAAA;AACpB,QAAM,wBAAwB,yBAAyB,WAAW;AAElE,QAAM,mBAAmB,OAAkB,MAAS;AACpD,QAAM,eAAe,aAAA;AAErB,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAmE;AAAA,IAC5F,MAAM;AAAA,IACN;AAAA,EAAA,CACA;AAED,QAAM,mBAAmB,YAAY,CAACA,cAA0B,aAAsB;AACrF,UAAM,WAAW,CAAC,MAAmCC,aAAoC;AACxF,UAAI,aAAa,SAAS;AACzB;AAAA,UAAS,QACR,GAAG,SAAS,WAAW,GAAG,YAAYA,WAAU,KAAK;AAAA,YACpD,MAAM;AAAA,YACN,aAAAD;AAAAA,YACA,SAAAC;AAAAA,YACA;AAAA,UAAA;AAAA,QACD;AAAA,MAEF;AAAA,IACD;AAEA,UAAM,UAAU,CAAC,OAA2BA,aAAoC;AAC/E,UAAI,aAAa,SAAS;AACzB;AAAA,UAAS,CAAA,OACR,GAAG,YAAYA,WAAU,KAAK;AAAA,YAC7B,MAAM;AAAA,YACN,aAAAD;AAAAA,YACA,SAAAC;AAAAA,YACA;AAAA,UAAA;AAAA,QACD;AAAA,MAEF;AAAA,IACD;AAEA,UAAM,mBAAmB,MAAM;AAC9B,UAAI,aAAa,WAAW,kBAAkB;AAC7C,yBAAiBD,cAAa,IAAI;AAAA,MACnC;AAAA,IACD;AAEA,QAAI,iBAAiB,YAAY,UAAa,UAAU;AACvD,uBAAiB,UAAU,IAAI,UAAUA,aAAY,WAAW;AAAA,IACjE;AAEA,UAAM,UAAU,IAAI;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjBA;AAAAA,MACA,CAAC,MAAM,QAAQ;AACd,cAAM,MAAM,IAAI,oBAAoB,MAAM,GAAG;AAC7C,eAAO,IAAI,SAAA;AAAA,MACZ;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACC,6BAA6B,+BAA+B;AAAA,MAAA;AAAA,IAC7D;AAED,aAAS,EAAE,SAAS,aAAAA,cAAa,MAAM,gBAAgB;AAAA,EACxD,GAAG,CAAC,eAAe,cAAc,cAAc,cAAc,kBAAkB,2BAA2B,CAAC;AAE3G,YAAU,MAAM;AACf,QAAI,uBAAuB;AAC1B,uBAAiB,uBAAuB,KAAK;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,kBAAkB,qBAAqB,CAAC;AAE5C,YAAU,MAAM;AACf,UAAM,SAAS,WAAW,QAAQ;AAAA,EACnC,GAAG,CAAC,UAAU,MAAM,OAAO,CAAC;AAE5B,SAAO;AACR;"}
1
+ {"version":3,"file":"useDataBinding.js","sources":["../../../../../packages/react-binding/src/accessorTree/useDataBinding.ts"],"sourcesContent":["import { GraphQlClientError, useCurrentContentGraphQlClient, useCurrentSystemGraphQlClient, useTenantGraphQlClient } from '@contember/react-client'\nimport { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport type { TreeRootAccessor } from '@contember/binding'\nimport { DataBinding, Environment, TreeStore } from '@contember/binding'\nimport type { AccessorTreeState } from './AccessorTreeState.js'\nimport { useIsMounted } from '@contember/react-utils'\nimport { MarkerTreeGenerator } from '../markers/index.js'\nimport ReactDOM from 'react-dom'\nimport { useEnvironmentWithSchema } from './useEnvironmentWithSchema.js'\nimport { useEnvironment } from '../accessorPropagation/index.js'\n\nexport const useDataBinding = ({\n\tchildren,\n\trefreshOnPersist,\n\tskipStateUpdateAfterPersist,\n}: {\n\tchildren?: ReactNode\n\trefreshOnPersist?: boolean\n\tskipStateUpdateAfterPersist?: boolean\n}): AccessorTreeState => {\n\tconst contentClient = useCurrentContentGraphQlClient()\n\tconst systemClient = useCurrentSystemGraphQlClient()\n\tconst tenantClient = useTenantGraphQlClient()\n\n\tconst environment = useEnvironment()\n\tconst environmentWithSchema = useEnvironmentWithSchema(environment)\n\n\tconst currentTreeStore = useRef<TreeStore>(undefined)\n\tconst isMountedRef = useIsMounted()\n\n\tconst [state, setState] = useState<AccessorTreeState & { binding?: DataBinding<ReactNode> }>({\n\t\tname: 'initializing',\n\t\tenvironment,\n\t})\n\n\tconst resetDataBinding = useCallback((environment: Environment, newStore: boolean) => {\n\t\tconst onUpdate = (data: TreeRootAccessor<ReactNode>, binding: DataBinding<ReactNode>) => {\n\t\t\tif (isMountedRef.current) {\n\t\t\t\tsetState(it =>\n\t\t\t\t\tit.name === 'error' || it.binding !== binding ? it : {\n\t\t\t\t\t\tname: 'initialized',\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tbinding,\n\t\t\t\t\t\tdata,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tconst onError = (error: GraphQlClientError, binding: DataBinding<ReactNode>) => {\n\t\t\tif (isMountedRef.current) {\n\t\t\t\tsetState(it =>\n\t\t\t\t\tit.binding !== binding ? it : {\n\t\t\t\t\t\tname: 'error',\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tbinding,\n\t\t\t\t\t\terror,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tconst onPersistSuccess = () => {\n\t\t\tif (isMountedRef.current && refreshOnPersist) {\n\t\t\t\tresetDataBinding(environment, true)\n\t\t\t}\n\t\t}\n\n\t\tif (currentTreeStore.current === undefined || newStore) {\n\t\t\tcurrentTreeStore.current = new TreeStore(environment.getSchema())\n\t\t}\n\n\t\tconst binding = new DataBinding(\n\t\t\tcontentClient,\n\t\t\tsystemClient,\n\t\t\ttenantClient,\n\t\t\tcurrentTreeStore.current,\n\t\t\tenvironment,\n\t\t\t(node, env) => {\n\t\t\t\tconst gen = new MarkerTreeGenerator(node, env)\n\t\t\t\treturn gen.generate()\n\t\t\t},\n\t\t\tReactDOM.unstable_batchedUpdates,\n\t\t\tonUpdate,\n\t\t\tonError,\n\t\t\tonPersistSuccess,\n\t\t\t{\n\t\t\t\tskipStateUpdateAfterPersist: skipStateUpdateAfterPersist ?? false,\n\t\t\t},\n\t\t)\n\t\tsetState({ binding, environment, name: 'initializing' })\n\t}, [contentClient, systemClient, tenantClient, isMountedRef, refreshOnPersist, skipStateUpdateAfterPersist])\n\n\tuseEffect(() => {\n\t\tif (environmentWithSchema) {\n\t\t\tresetDataBinding(environmentWithSchema, false)\n\t\t}\n\t}, [resetDataBinding, environmentWithSchema])\n\n\tuseEffect(() => {\n\t\tstate.binding?.extendTree(children)\n\t}, [children, state.binding])\n\n\treturn state\n}\n"],"names":["environment","binding"],"mappings":";;;;;;;;AAWO,MAAM,iBAAiB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACD,MAIyB;AACxB,QAAM,gBAAgB,+BAAA;AACtB,QAAM,eAAe,8BAAA;AACrB,QAAM,eAAe,uBAAA;AAErB,QAAM,cAAc,eAAA;AACpB,QAAM,wBAAwB,yBAAyB,WAAW;AAElE,QAAM,mBAAmB,OAAkB,MAAS;AACpD,QAAM,eAAe,aAAA;AAErB,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAmE;AAAA,IAC5F,MAAM;AAAA,IACN;AAAA,EAAA,CACA;AAED,QAAM,mBAAmB,YAAY,CAACA,cAA0B,aAAsB;AACrF,UAAM,WAAW,CAAC,MAAmCC,aAAoC;AACxF,UAAI,aAAa,SAAS;AACzB;AAAA,UAAS,QACR,GAAG,SAAS,WAAW,GAAG,YAAYA,WAAU,KAAK;AAAA,YACpD,MAAM;AAAA,YACN,aAAAD;AAAAA,YACA,SAAAC;AAAAA,YACA;AAAA,UAAA;AAAA,QACD;AAAA,MAEF;AAAA,IACD;AAEA,UAAM,UAAU,CAAC,OAA2BA,aAAoC;AAC/E,UAAI,aAAa,SAAS;AACzB;AAAA,UAAS,CAAA,OACR,GAAG,YAAYA,WAAU,KAAK;AAAA,YAC7B,MAAM;AAAA,YACN,aAAAD;AAAAA,YACA,SAAAC;AAAAA,YACA;AAAA,UAAA;AAAA,QACD;AAAA,MAEF;AAAA,IACD;AAEA,UAAM,mBAAmB,MAAM;AAC9B,UAAI,aAAa,WAAW,kBAAkB;AAC7C,yBAAiBD,cAAa,IAAI;AAAA,MACnC;AAAA,IACD;AAEA,QAAI,iBAAiB,YAAY,UAAa,UAAU;AACvD,uBAAiB,UAAU,IAAI,UAAUA,aAAY,WAAW;AAAA,IACjE;AAEA,UAAM,UAAU,IAAI;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjBA;AAAAA,MACA,CAAC,MAAM,QAAQ;AACd,cAAM,MAAM,IAAI,oBAAoB,MAAM,GAAG;AAC7C,eAAO,IAAI,SAAA;AAAA,MACZ;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACC,6BAA6B,+BAA+B;AAAA,MAAA;AAAA,IAC7D;AAED,aAAS,EAAE,SAAS,aAAAA,cAAa,MAAM,gBAAgB;AAAA,EACxD,GAAG,CAAC,eAAe,cAAc,cAAc,cAAc,kBAAkB,2BAA2B,CAAC;AAE3G,YAAU,MAAM;AACf,QAAI,uBAAuB;AAC1B,uBAAiB,uBAAuB,KAAK;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,kBAAkB,qBAAqB,CAAC;AAE5C,YAAU,MAAM;AACf,UAAM,SAAS,WAAW,QAAQ;AAAA,EACnC,GAAG,CAAC,UAAU,MAAM,OAAO,CAAC;AAE5B,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDirtinessState.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/useDirtinessState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { DirtinessContext } from './DirtinessContext'\n\nexport const useDirtinessState = () => useContext(DirtinessContext)\n"],"names":["useContext","DirtinessContext"],"mappings":";;;;AAGO,MAAM,oBAAoB,MAAMA,MAAAA,WAAWC,iBAAAA,gBAAgB;;"}
1
+ {"version":3,"file":"useDirtinessState.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/useDirtinessState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { DirtinessContext } from './DirtinessContext.js'\n\nexport const useDirtinessState = () => useContext(DirtinessContext)\n"],"names":["useContext","DirtinessContext"],"mappings":";;;;AAGO,MAAM,oBAAoB,MAAMA,MAAAA,WAAWC,iBAAAA,gBAAgB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDirtinessState.js","sources":["../../../../../packages/react-binding/src/accessorTree/useDirtinessState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { DirtinessContext } from './DirtinessContext'\n\nexport const useDirtinessState = () => useContext(DirtinessContext)\n"],"names":[],"mappings":";;AAGO,MAAM,oBAAoB,MAAM,WAAW,gBAAgB;"}
1
+ {"version":3,"file":"useDirtinessState.js","sources":["../../../../../packages/react-binding/src/accessorTree/useDirtinessState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { DirtinessContext } from './DirtinessContext.js'\n\nexport const useDirtinessState = () => useContext(DirtinessContext)\n"],"names":[],"mappings":";;AAGO,MAAM,oBAAoB,MAAM,WAAW,gBAAgB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useMutationState.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/useMutationState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { MutationStateContext } from './MutationStateContext'\n\nexport const useMutationState = () => useContext(MutationStateContext)\n"],"names":["useContext","MutationStateContext"],"mappings":";;;;AAGO,MAAM,mBAAmB,MAAMA,MAAAA,WAAWC,qBAAAA,oBAAoB;;"}
1
+ {"version":3,"file":"useMutationState.cjs","sources":["../../../../../packages/react-binding/src/accessorTree/useMutationState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { MutationStateContext } from './MutationStateContext.js'\n\nexport const useMutationState = () => useContext(MutationStateContext)\n"],"names":["useContext","MutationStateContext"],"mappings":";;;;AAGO,MAAM,mBAAmB,MAAMA,MAAAA,WAAWC,qBAAAA,oBAAoB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useMutationState.js","sources":["../../../../../packages/react-binding/src/accessorTree/useMutationState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { MutationStateContext } from './MutationStateContext'\n\nexport const useMutationState = () => useContext(MutationStateContext)\n"],"names":[],"mappings":";;AAGO,MAAM,mBAAmB,MAAM,WAAW,oBAAoB;"}
1
+ {"version":3,"file":"useMutationState.js","sources":["../../../../../packages/react-binding/src/accessorTree/useMutationState.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { MutationStateContext } from './MutationStateContext.js'\n\nexport const useMutationState = () => useContext(MutationStateContext)\n"],"names":[],"mappings":";;AAGO,MAAM,mBAAmB,MAAM,WAAW,oBAAoB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Component.cjs","sources":["../../../../../packages/react-binding/src/coreComponents/Component.tsx"],"sourcesContent":["import { memo, NamedExoticComponent, PropsWithChildren, ReactNode } from 'react'\nimport { useEnvironment } from '../accessorPropagation'\nimport type { Environment } from '@contember/binding'\nimport type { MarkerProvider, StaticRenderProvider, StaticRenderProviderProps } from '../markers'\nimport { assertNever } from '@contember/utilities'\n\ninterface EnvironmentAwareFunctionComponent<P> {\n\t(props: PropsWithChildren<P>, environment: Environment): ReactNode\n\tdisplayName?: string | undefined\n}\n\nfunction Component<Props extends {}>(\n\tstatelessRender: EnvironmentAwareFunctionComponent<Props>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: EnvironmentAwareFunctionComponent<Props>,\n\tstaticRender: (props: StaticRenderProviderProps<Props, NonStaticPropNames>, environment: Environment) => ReactNode,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: EnvironmentAwareFunctionComponent<Props>,\n\tmarkerProvisions: MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\trender: EnvironmentAwareFunctionComponent<Props>,\n\tdecider?:\n\t\t| string\n\t\t| ((props: StaticRenderProviderProps<Props, NonStaticPropNames>, environment: Environment) => ReactNode)\n\t\t| MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n) {\n\tconst RenderWithEnv = (props: Props) => render(props, useEnvironment())\n\tconst renderWithEnv: (props: Props) => ReactNode = (typeof render !== 'function' || render.length < 2 ? render : RenderWithEnv) as (\n\t\tprops: Props,\n\t) => ReactNode\n\n\tif (decider === undefined || typeof decider === 'string') {\n\t\trender.displayName = decider\n\t\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props> = memo<Props>(renderWithEnv)\n\t\taugmentedRender.staticRender = render as StaticRenderProvider<Props>['staticRender']\n\t\taugmentedRender.displayName = decider\n\n\t\treturn augmentedRender\n\t}\n\n\trender.displayName = displayName\n\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props, NonStaticPropNames> = memo<Props>(renderWithEnv)\n\taugmentedRender.displayName = displayName\n\n\tif (typeof decider === 'function') {\n\t\taugmentedRender.staticRender = decider\n\n\t\treturn augmentedRender\n\t}\n\tif (typeof decider === 'object') {\n\t\tfor (const provisionName in decider) {\n\t\t\tconst methodName = provisionName as keyof MarkerProvider<Props, NonStaticPropNames>\n\t\t\t;(augmentedRender[methodName] as MarkerProvider<Props, NonStaticPropNames>[typeof methodName]) = decider[methodName]\n\t\t}\n\n\t\treturn augmentedRender\n\t}\n\tassertNever(decider)\n}\n\nexport type { EnvironmentAwareFunctionComponent }\nexport { Component }\n"],"names":["useEnvironment","augmentedRender","memo","assertNever"],"mappings":";;;;;AA4BA,SAAS,UACR,QACA,SAIA,aACC;AACD,QAAM,gBAAgB,CAAC,UAAiB,OAAO,OAAOA,eAAAA,gBAAgB;AACtE,QAAM,gBAA8C,OAAO,WAAW,cAAc,OAAO,SAAS,IAAI,SAAS;AAIjH,MAAI,YAAY,UAAa,OAAO,YAAY,UAAU;AACzD,WAAO,cAAc;AACrB,UAAMC,mBAAuEC,MAAAA,KAAY,aAAa;AACtGD,qBAAgB,eAAe;AAC/BA,qBAAgB,cAAc;AAE9B,WAAOA;AAAAA,EACR;AAEA,SAAO,cAAc;AACrB,QAAM,kBAA2FC,MAAAA,KAAY,aAAa;AAC1H,kBAAgB,cAAc;AAE9B,MAAI,OAAO,YAAY,YAAY;AAClC,oBAAgB,eAAe;AAE/B,WAAO;AAAA,EACR;AACA,MAAI,OAAO,YAAY,UAAU;AAChC,eAAW,iBAAiB,SAAS;AACpC,YAAM,aAAa;AACjB,sBAAgB,UAAU,IAAqE,QAAQ,UAAU;AAAA,IACpH;AAEA,WAAO;AAAA,EACR;AACAC,YAAAA,YAAY,OAAO;AACpB;;"}
1
+ {"version":3,"file":"Component.cjs","sources":["../../../../../packages/react-binding/src/coreComponents/Component.tsx"],"sourcesContent":["import { memo, NamedExoticComponent, PropsWithChildren, ReactNode } from 'react'\nimport { useEnvironment } from '../accessorPropagation/index.js'\nimport type { Environment } from '@contember/binding'\nimport type { MarkerProvider, StaticRenderProvider, StaticRenderProviderProps } from '../markers/index.js'\nimport { assertNever } from '@contember/utilities'\n\ninterface EnvironmentAwareFunctionComponent<P> {\n\t(props: PropsWithChildren<P>, environment: Environment): ReactNode\n\tdisplayName?: string | undefined\n}\n\nfunction Component<Props extends {}>(\n\tstatelessRender: EnvironmentAwareFunctionComponent<Props>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: EnvironmentAwareFunctionComponent<Props>,\n\tstaticRender: (props: StaticRenderProviderProps<Props, NonStaticPropNames>, environment: Environment) => ReactNode,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: EnvironmentAwareFunctionComponent<Props>,\n\tmarkerProvisions: MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\trender: EnvironmentAwareFunctionComponent<Props>,\n\tdecider?:\n\t\t| string\n\t\t| ((props: StaticRenderProviderProps<Props, NonStaticPropNames>, environment: Environment) => ReactNode)\n\t\t| MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n) {\n\tconst RenderWithEnv = (props: Props) => render(props, useEnvironment())\n\tconst renderWithEnv: (props: Props) => ReactNode = (typeof render !== 'function' || render.length < 2 ? render : RenderWithEnv) as (\n\t\tprops: Props,\n\t) => ReactNode\n\n\tif (decider === undefined || typeof decider === 'string') {\n\t\trender.displayName = decider\n\t\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props> = memo<Props>(renderWithEnv)\n\t\taugmentedRender.staticRender = render as StaticRenderProvider<Props>['staticRender']\n\t\taugmentedRender.displayName = decider\n\n\t\treturn augmentedRender\n\t}\n\n\trender.displayName = displayName\n\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props, NonStaticPropNames> = memo<Props>(renderWithEnv)\n\taugmentedRender.displayName = displayName\n\n\tif (typeof decider === 'function') {\n\t\taugmentedRender.staticRender = decider\n\n\t\treturn augmentedRender\n\t}\n\tif (typeof decider === 'object') {\n\t\tfor (const provisionName in decider) {\n\t\t\tconst methodName = provisionName as keyof MarkerProvider<Props, NonStaticPropNames>\n\t\t\t;(augmentedRender[methodName] as MarkerProvider<Props, NonStaticPropNames>[typeof methodName]) = decider[methodName]\n\t\t}\n\n\t\treturn augmentedRender\n\t}\n\tassertNever(decider)\n}\n\nexport type { EnvironmentAwareFunctionComponent }\nexport { Component }\n"],"names":["useEnvironment","augmentedRender","memo","assertNever"],"mappings":";;;;;AA4BA,SAAS,UACR,QACA,SAIA,aACC;AACD,QAAM,gBAAgB,CAAC,UAAiB,OAAO,OAAOA,eAAAA,gBAAgB;AACtE,QAAM,gBAA8C,OAAO,WAAW,cAAc,OAAO,SAAS,IAAI,SAAS;AAIjH,MAAI,YAAY,UAAa,OAAO,YAAY,UAAU;AACzD,WAAO,cAAc;AACrB,UAAMC,mBAAuEC,MAAAA,KAAY,aAAa;AACtGD,qBAAgB,eAAe;AAC/BA,qBAAgB,cAAc;AAE9B,WAAOA;AAAAA,EACR;AAEA,SAAO,cAAc;AACrB,QAAM,kBAA2FC,MAAAA,KAAY,aAAa;AAC1H,kBAAgB,cAAc;AAE9B,MAAI,OAAO,YAAY,YAAY;AAClC,oBAAgB,eAAe;AAE/B,WAAO;AAAA,EACR;AACA,MAAI,OAAO,YAAY,UAAU;AAChC,eAAW,iBAAiB,SAAS;AACpC,YAAM,aAAa;AACjB,sBAAgB,UAAU,IAAqE,QAAQ,UAAU;AAAA,IACpH;AAEA,WAAO;AAAA,EACR;AACAC,YAAAA,YAAY,OAAO;AACpB;;"}