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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (558) hide show
  1. package/CLAUDE.md +57 -0
  2. package/dist/development/index.cjs +99 -99
  3. package/dist/development/index.js +48 -48
  4. package/dist/development/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
  5. package/dist/development/src/accessorPropagation/AccessorProvider.js.map +1 -1
  6. package/dist/development/src/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
  7. package/dist/development/src/accessorPropagation/BindingOperationsContext.js.map +1 -1
  8. package/dist/development/src/accessorPropagation/BindingOperationsProvider.cjs.map +1 -1
  9. package/dist/development/src/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  10. package/dist/development/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
  11. package/dist/development/src/accessorPropagation/EntityKeyContext.js.map +1 -1
  12. package/dist/development/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
  13. package/dist/development/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
  14. package/dist/development/src/accessorPropagation/EnvironmentContext.cjs +0 -1
  15. package/dist/development/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
  16. package/dist/development/src/accessorPropagation/EnvironmentContext.js +1 -2
  17. package/dist/development/src/accessorPropagation/EnvironmentContext.js.map +1 -1
  18. package/dist/development/src/accessorPropagation/TreeRootIdContext.cjs.map +1 -1
  19. package/dist/development/src/accessorPropagation/TreeRootIdContext.js.map +1 -1
  20. package/dist/development/src/accessorPropagation/TreeRootIdProvider.cjs.map +1 -1
  21. package/dist/development/src/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  22. package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.cjs.map +1 -1
  23. package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
  24. package/dist/development/src/accessorPropagation/useBindingOperations.cjs.map +1 -1
  25. package/dist/development/src/accessorPropagation/useBindingOperations.js.map +1 -1
  26. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.cjs +1 -2
  27. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
  28. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.js +1 -2
  29. package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
  30. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs +1 -2
  31. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
  32. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.js +1 -2
  33. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
  34. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.cjs +1 -2
  35. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
  36. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.js +1 -2
  37. package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
  38. package/dist/development/src/accessorPropagation/useEntity.cjs.map +1 -1
  39. package/dist/development/src/accessorPropagation/useEntity.js.map +1 -1
  40. package/dist/development/src/accessorPropagation/useEntityKey.cjs.map +1 -1
  41. package/dist/development/src/accessorPropagation/useEntityKey.js.map +1 -1
  42. package/dist/development/src/accessorPropagation/useEntityList.cjs.map +1 -1
  43. package/dist/development/src/accessorPropagation/useEntityList.js.map +1 -1
  44. package/dist/development/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
  45. package/dist/development/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
  46. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs +1 -1
  47. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
  48. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js +1 -1
  49. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
  50. package/dist/development/src/accessorPropagation/useEntityListSubTreeParameters.cjs.map +1 -1
  51. package/dist/development/src/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
  52. package/dist/development/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
  53. package/dist/development/src/accessorPropagation/useEntitySubTree.js.map +1 -1
  54. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs +1 -1
  55. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
  56. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js +1 -1
  57. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
  58. package/dist/development/src/accessorPropagation/useEntitySubTreeParameters.cjs.map +1 -1
  59. package/dist/development/src/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
  60. package/dist/development/src/accessorPropagation/useExtendTree.cjs +1 -4
  61. package/dist/development/src/accessorPropagation/useExtendTree.cjs.map +1 -1
  62. package/dist/development/src/accessorPropagation/useExtendTree.js +1 -4
  63. package/dist/development/src/accessorPropagation/useExtendTree.js.map +1 -1
  64. package/dist/development/src/accessorPropagation/useField.cjs.map +1 -1
  65. package/dist/development/src/accessorPropagation/useField.js.map +1 -1
  66. package/dist/development/src/accessorPropagation/useGetEntityByKey.cjs.map +1 -1
  67. package/dist/development/src/accessorPropagation/useGetEntityByKey.js.map +1 -1
  68. package/dist/development/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
  69. package/dist/development/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
  70. package/dist/development/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
  71. package/dist/development/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
  72. package/dist/development/src/accessorPropagation/useHasEntity.cjs.map +1 -1
  73. package/dist/development/src/accessorPropagation/useHasEntity.js.map +1 -1
  74. package/dist/development/src/accessorPropagation/usePersist.cjs.map +1 -1
  75. package/dist/development/src/accessorPropagation/usePersist.js.map +1 -1
  76. package/dist/development/src/accessorPropagation/useTreeRootId.cjs.map +1 -1
  77. package/dist/development/src/accessorPropagation/useTreeRootId.js.map +1 -1
  78. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs +10 -10
  79. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
  80. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js +10 -10
  81. package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  82. package/dist/development/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
  83. package/dist/development/src/accessorSorting/addEntityAtIndex.js.map +1 -1
  84. package/dist/development/src/accessorSorting/repairEntitiesOrder.cjs.map +1 -1
  85. package/dist/development/src/accessorSorting/repairEntitiesOrder.js.map +1 -1
  86. package/dist/development/src/accessorSorting/sortEntities.cjs.map +1 -1
  87. package/dist/development/src/accessorSorting/sortEntities.js.map +1 -1
  88. package/dist/development/src/accessorTree/AccessorTree.cjs.map +1 -1
  89. package/dist/development/src/accessorTree/AccessorTree.js.map +1 -1
  90. package/dist/development/src/accessorTree/AccessorTreeStateContext.cjs.map +1 -1
  91. package/dist/development/src/accessorTree/AccessorTreeStateContext.js.map +1 -1
  92. package/dist/development/src/accessorTree/DirtinessContext.cjs.map +1 -1
  93. package/dist/development/src/accessorTree/DirtinessContext.js.map +1 -1
  94. package/dist/development/src/accessorTree/MutationStateContext.cjs.map +1 -1
  95. package/dist/development/src/accessorTree/MutationStateContext.js.map +1 -1
  96. package/dist/development/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
  97. package/dist/development/src/accessorTree/useAccessorTreeState.js.map +1 -1
  98. package/dist/development/src/accessorTree/useDataBinding.cjs +17 -13
  99. package/dist/development/src/accessorTree/useDataBinding.cjs.map +1 -1
  100. package/dist/development/src/accessorTree/useDataBinding.js +19 -15
  101. package/dist/development/src/accessorTree/useDataBinding.js.map +1 -1
  102. package/dist/development/src/accessorTree/useDirtinessState.cjs.map +1 -1
  103. package/dist/development/src/accessorTree/useDirtinessState.js.map +1 -1
  104. package/dist/development/src/accessorTree/useEnvironmentWithSchema.cjs.map +1 -1
  105. package/dist/development/src/accessorTree/useEnvironmentWithSchema.js.map +1 -1
  106. package/dist/development/src/accessorTree/useMutationState.cjs.map +1 -1
  107. package/dist/development/src/accessorTree/useMutationState.js.map +1 -1
  108. package/dist/development/src/coreComponents/Component.cjs.map +1 -1
  109. package/dist/development/src/coreComponents/Component.js.map +1 -1
  110. package/dist/development/src/coreComponents/DataBindingProvider.cjs +1 -1
  111. package/dist/development/src/coreComponents/DataBindingProvider.cjs.map +1 -1
  112. package/dist/development/src/coreComponents/DataBindingProvider.js +1 -1
  113. package/dist/development/src/coreComponents/DataBindingProvider.js.map +1 -1
  114. package/dist/development/src/coreComponents/Entity.cjs.map +1 -1
  115. package/dist/development/src/coreComponents/Entity.js.map +1 -1
  116. package/dist/development/src/coreComponents/EntityList.cjs +3 -3
  117. package/dist/development/src/coreComponents/EntityList.cjs.map +1 -1
  118. package/dist/development/src/coreComponents/EntityList.js +3 -3
  119. package/dist/development/src/coreComponents/EntityList.js.map +1 -1
  120. package/dist/development/src/coreComponents/EntityListSubTree.cjs +3 -3
  121. package/dist/development/src/coreComponents/EntityListSubTree.cjs.map +1 -1
  122. package/dist/development/src/coreComponents/EntityListSubTree.js +4 -4
  123. package/dist/development/src/coreComponents/EntityListSubTree.js.map +1 -1
  124. package/dist/development/src/coreComponents/EntitySubTree.cjs.map +1 -1
  125. package/dist/development/src/coreComponents/EntitySubTree.js +1 -1
  126. package/dist/development/src/coreComponents/EntitySubTree.js.map +1 -1
  127. package/dist/development/src/coreComponents/Field.cjs +2 -2
  128. package/dist/development/src/coreComponents/Field.cjs.map +1 -1
  129. package/dist/development/src/coreComponents/Field.js +3 -3
  130. package/dist/development/src/coreComponents/Field.js.map +1 -1
  131. package/dist/development/src/coreComponents/HasMany.cjs +3 -3
  132. package/dist/development/src/coreComponents/HasMany.cjs.map +1 -1
  133. package/dist/development/src/coreComponents/HasMany.js +4 -4
  134. package/dist/development/src/coreComponents/HasMany.js.map +1 -1
  135. package/dist/development/src/coreComponents/HasOne.cjs.map +1 -1
  136. package/dist/development/src/coreComponents/HasOne.js +1 -1
  137. package/dist/development/src/coreComponents/HasOne.js.map +1 -1
  138. package/dist/development/src/coreComponents/ParentEntity.cjs.map +1 -1
  139. package/dist/development/src/coreComponents/ParentEntity.js.map +1 -1
  140. package/dist/development/src/entityEvents/useDataBindingEvent.cjs.map +1 -1
  141. package/dist/development/src/entityEvents/useDataBindingEvent.js.map +1 -1
  142. package/dist/development/src/entityEvents/useDerivedField.cjs.map +1 -1
  143. package/dist/development/src/entityEvents/useDerivedField.js.map +1 -1
  144. package/dist/development/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
  145. package/dist/development/src/entityEvents/useEntityBeforePersist.js.map +1 -1
  146. package/dist/development/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
  147. package/dist/development/src/entityEvents/useEntityBeforeUpdate.js.map +1 -1
  148. package/dist/development/src/entityEvents/useEntityEvent.cjs.map +1 -1
  149. package/dist/development/src/entityEvents/useEntityEvent.js.map +1 -1
  150. package/dist/development/src/entityEvents/useEntityPersistError.cjs.map +1 -1
  151. package/dist/development/src/entityEvents/useEntityPersistError.js.map +1 -1
  152. package/dist/development/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
  153. package/dist/development/src/entityEvents/useEntityPersistSuccess.js.map +1 -1
  154. package/dist/development/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
  155. package/dist/development/src/entityEvents/useOnConnectionUpdate.js.map +1 -1
  156. package/dist/development/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
  157. package/dist/development/src/helperComponents/DeferredSubTrees.js.map +1 -1
  158. package/dist/development/src/helperComponents/DeleteEntityTrigger.cjs +1 -1
  159. package/dist/development/src/helperComponents/DeleteEntityTrigger.cjs.map +1 -1
  160. package/dist/development/src/helperComponents/DeleteEntityTrigger.js +1 -1
  161. package/dist/development/src/helperComponents/DeleteEntityTrigger.js.map +1 -1
  162. package/dist/development/src/helperComponents/DimensionRenderer.cjs +4 -4
  163. package/dist/development/src/helperComponents/DimensionRenderer.cjs.map +1 -1
  164. package/dist/development/src/helperComponents/DimensionRenderer.js +4 -4
  165. package/dist/development/src/helperComponents/DimensionRenderer.js.map +1 -1
  166. package/dist/development/src/helperComponents/EntityView.cjs +1 -1
  167. package/dist/development/src/helperComponents/EntityView.cjs.map +1 -1
  168. package/dist/development/src/helperComponents/EntityView.js +1 -1
  169. package/dist/development/src/helperComponents/EntityView.js.map +1 -1
  170. package/dist/development/src/helperComponents/FieldView.cjs +4 -4
  171. package/dist/development/src/helperComponents/FieldView.cjs.map +1 -1
  172. package/dist/development/src/helperComponents/FieldView.js +4 -4
  173. package/dist/development/src/helperComponents/FieldView.js.map +1 -1
  174. package/dist/development/src/helperComponents/If.cjs +20 -23
  175. package/dist/development/src/helperComponents/If.cjs.map +1 -1
  176. package/dist/development/src/helperComponents/If.js +20 -23
  177. package/dist/development/src/helperComponents/If.js.map +1 -1
  178. package/dist/development/src/helperComponents/LabelMiddleware.cjs.map +1 -1
  179. package/dist/development/src/helperComponents/LabelMiddleware.js.map +1 -1
  180. package/dist/development/src/helperComponents/RecursionTerminator.cjs.map +1 -1
  181. package/dist/development/src/helperComponents/RecursionTerminator.js.map +1 -1
  182. package/dist/development/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -1
  183. package/dist/development/src/helperComponents/RecursionTerminatorPortal.js.map +1 -1
  184. package/dist/development/src/helperComponents/StaticRender.cjs.map +1 -1
  185. package/dist/development/src/helperComponents/StaticRender.js.map +1 -1
  186. package/dist/development/src/helperComponents/SugaredField.cjs.map +1 -1
  187. package/dist/development/src/helperComponents/SugaredField.js.map +1 -1
  188. package/dist/development/src/helperComponents/Variable.cjs.map +1 -1
  189. package/dist/development/src/helperComponents/Variable.js.map +1 -1
  190. package/dist/development/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
  191. package/dist/development/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  192. package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.cjs +4 -2
  193. package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.cjs.map +1 -1
  194. package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.js +4 -2
  195. package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
  196. package/dist/development/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
  197. package/dist/development/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
  198. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.cjs +1 -1
  199. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.cjs.map +1 -1
  200. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.js +1 -1
  201. package/dist/development/src/helperComponents/persist/PersistOnFieldChange.js.map +1 -1
  202. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.cjs +1 -1
  203. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.cjs.map +1 -1
  204. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.js +1 -1
  205. package/dist/development/src/helperComponents/persist/PersistOnHasOneChange.js.map +1 -1
  206. package/dist/development/src/helperComponents/persist/PersistOnKey.cjs.map +1 -1
  207. package/dist/development/src/helperComponents/persist/PersistOnKey.js.map +1 -1
  208. package/dist/development/src/helperComponents/persist/PersistTrigger.cjs +1 -1
  209. package/dist/development/src/helperComponents/persist/PersistTrigger.cjs.map +1 -1
  210. package/dist/development/src/helperComponents/persist/PersistTrigger.js +1 -1
  211. package/dist/development/src/helperComponents/persist/PersistTrigger.js.map +1 -1
  212. package/dist/development/src/helperComponents/persist/useDecoratedPersist.cjs.map +1 -1
  213. package/dist/development/src/helperComponents/persist/useDecoratedPersist.js.map +1 -1
  214. package/dist/development/src/markers/IncrementalMarkerBuilder.cjs +47 -44
  215. package/dist/development/src/markers/IncrementalMarkerBuilder.cjs.map +1 -1
  216. package/dist/development/src/markers/IncrementalMarkerBuilder.js +47 -44
  217. package/dist/development/src/markers/IncrementalMarkerBuilder.js.map +1 -1
  218. package/dist/development/src/markers/MarkerStaticAnalyzer.cjs +19 -19
  219. package/dist/development/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
  220. package/dist/development/src/markers/MarkerStaticAnalyzer.js +19 -19
  221. package/dist/development/src/markers/MarkerStaticAnalyzer.js.map +1 -1
  222. package/dist/development/src/markers/MarkerTreeGenerator.cjs.map +1 -1
  223. package/dist/development/src/markers/MarkerTreeGenerator.js.map +1 -1
  224. package/dist/production/index.cjs +99 -99
  225. package/dist/production/index.js +48 -48
  226. package/dist/production/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
  227. package/dist/production/src/accessorPropagation/AccessorProvider.js.map +1 -1
  228. package/dist/production/src/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
  229. package/dist/production/src/accessorPropagation/BindingOperationsContext.js.map +1 -1
  230. package/dist/production/src/accessorPropagation/BindingOperationsProvider.cjs.map +1 -1
  231. package/dist/production/src/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  232. package/dist/production/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
  233. package/dist/production/src/accessorPropagation/EntityKeyContext.js.map +1 -1
  234. package/dist/production/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
  235. package/dist/production/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
  236. package/dist/production/src/accessorPropagation/EnvironmentContext.cjs +0 -1
  237. package/dist/production/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
  238. package/dist/production/src/accessorPropagation/EnvironmentContext.js +1 -2
  239. package/dist/production/src/accessorPropagation/EnvironmentContext.js.map +1 -1
  240. package/dist/production/src/accessorPropagation/TreeRootIdContext.cjs.map +1 -1
  241. package/dist/production/src/accessorPropagation/TreeRootIdContext.js.map +1 -1
  242. package/dist/production/src/accessorPropagation/TreeRootIdProvider.cjs.map +1 -1
  243. package/dist/production/src/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  244. package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.cjs.map +1 -1
  245. package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
  246. package/dist/production/src/accessorPropagation/useBindingOperations.cjs.map +1 -1
  247. package/dist/production/src/accessorPropagation/useBindingOperations.js.map +1 -1
  248. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.cjs +1 -2
  249. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
  250. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.js +1 -2
  251. package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
  252. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs +1 -2
  253. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
  254. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.js +1 -2
  255. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
  256. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.cjs +1 -2
  257. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
  258. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.js +1 -2
  259. package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
  260. package/dist/production/src/accessorPropagation/useEntity.cjs.map +1 -1
  261. package/dist/production/src/accessorPropagation/useEntity.js.map +1 -1
  262. package/dist/production/src/accessorPropagation/useEntityKey.cjs.map +1 -1
  263. package/dist/production/src/accessorPropagation/useEntityKey.js.map +1 -1
  264. package/dist/production/src/accessorPropagation/useEntityList.cjs.map +1 -1
  265. package/dist/production/src/accessorPropagation/useEntityList.js.map +1 -1
  266. package/dist/production/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
  267. package/dist/production/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
  268. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs +1 -1
  269. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
  270. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js +1 -1
  271. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
  272. package/dist/production/src/accessorPropagation/useEntityListSubTreeParameters.cjs.map +1 -1
  273. package/dist/production/src/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
  274. package/dist/production/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
  275. package/dist/production/src/accessorPropagation/useEntitySubTree.js.map +1 -1
  276. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs +1 -1
  277. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
  278. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js +1 -1
  279. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
  280. package/dist/production/src/accessorPropagation/useEntitySubTreeParameters.cjs.map +1 -1
  281. package/dist/production/src/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
  282. package/dist/production/src/accessorPropagation/useExtendTree.cjs +1 -4
  283. package/dist/production/src/accessorPropagation/useExtendTree.cjs.map +1 -1
  284. package/dist/production/src/accessorPropagation/useExtendTree.js +1 -4
  285. package/dist/production/src/accessorPropagation/useExtendTree.js.map +1 -1
  286. package/dist/production/src/accessorPropagation/useField.cjs.map +1 -1
  287. package/dist/production/src/accessorPropagation/useField.js.map +1 -1
  288. package/dist/production/src/accessorPropagation/useGetEntityByKey.cjs.map +1 -1
  289. package/dist/production/src/accessorPropagation/useGetEntityByKey.js.map +1 -1
  290. package/dist/production/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
  291. package/dist/production/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
  292. package/dist/production/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
  293. package/dist/production/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
  294. package/dist/production/src/accessorPropagation/useHasEntity.cjs.map +1 -1
  295. package/dist/production/src/accessorPropagation/useHasEntity.js.map +1 -1
  296. package/dist/production/src/accessorPropagation/usePersist.cjs.map +1 -1
  297. package/dist/production/src/accessorPropagation/usePersist.js.map +1 -1
  298. package/dist/production/src/accessorPropagation/useTreeRootId.cjs.map +1 -1
  299. package/dist/production/src/accessorPropagation/useTreeRootId.js.map +1 -1
  300. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs +1 -1
  301. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
  302. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js +1 -1
  303. package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  304. package/dist/production/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
  305. package/dist/production/src/accessorSorting/addEntityAtIndex.js.map +1 -1
  306. package/dist/production/src/accessorSorting/repairEntitiesOrder.cjs.map +1 -1
  307. package/dist/production/src/accessorSorting/repairEntitiesOrder.js.map +1 -1
  308. package/dist/production/src/accessorSorting/sortEntities.cjs.map +1 -1
  309. package/dist/production/src/accessorSorting/sortEntities.js.map +1 -1
  310. package/dist/production/src/accessorTree/AccessorTree.cjs.map +1 -1
  311. package/dist/production/src/accessorTree/AccessorTree.js.map +1 -1
  312. package/dist/production/src/accessorTree/AccessorTreeStateContext.cjs.map +1 -1
  313. package/dist/production/src/accessorTree/AccessorTreeStateContext.js.map +1 -1
  314. package/dist/production/src/accessorTree/DirtinessContext.cjs.map +1 -1
  315. package/dist/production/src/accessorTree/DirtinessContext.js.map +1 -1
  316. package/dist/production/src/accessorTree/MutationStateContext.cjs.map +1 -1
  317. package/dist/production/src/accessorTree/MutationStateContext.js.map +1 -1
  318. package/dist/production/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
  319. package/dist/production/src/accessorTree/useAccessorTreeState.js.map +1 -1
  320. package/dist/production/src/accessorTree/useDataBinding.cjs +17 -13
  321. package/dist/production/src/accessorTree/useDataBinding.cjs.map +1 -1
  322. package/dist/production/src/accessorTree/useDataBinding.js +19 -15
  323. package/dist/production/src/accessorTree/useDataBinding.js.map +1 -1
  324. package/dist/production/src/accessorTree/useDirtinessState.cjs.map +1 -1
  325. package/dist/production/src/accessorTree/useDirtinessState.js.map +1 -1
  326. package/dist/production/src/accessorTree/useEnvironmentWithSchema.cjs.map +1 -1
  327. package/dist/production/src/accessorTree/useEnvironmentWithSchema.js.map +1 -1
  328. package/dist/production/src/accessorTree/useMutationState.cjs.map +1 -1
  329. package/dist/production/src/accessorTree/useMutationState.js.map +1 -1
  330. package/dist/production/src/coreComponents/Component.cjs.map +1 -1
  331. package/dist/production/src/coreComponents/Component.js.map +1 -1
  332. package/dist/production/src/coreComponents/DataBindingProvider.cjs.map +1 -1
  333. package/dist/production/src/coreComponents/DataBindingProvider.js.map +1 -1
  334. package/dist/production/src/coreComponents/Entity.cjs.map +1 -1
  335. package/dist/production/src/coreComponents/Entity.js.map +1 -1
  336. package/dist/production/src/coreComponents/EntityList.cjs.map +1 -1
  337. package/dist/production/src/coreComponents/EntityList.js.map +1 -1
  338. package/dist/production/src/coreComponents/EntityListSubTree.cjs.map +1 -1
  339. package/dist/production/src/coreComponents/EntityListSubTree.js +1 -1
  340. package/dist/production/src/coreComponents/EntityListSubTree.js.map +1 -1
  341. package/dist/production/src/coreComponents/EntitySubTree.cjs.map +1 -1
  342. package/dist/production/src/coreComponents/EntitySubTree.js +1 -1
  343. package/dist/production/src/coreComponents/EntitySubTree.js.map +1 -1
  344. package/dist/production/src/coreComponents/Field.cjs.map +1 -1
  345. package/dist/production/src/coreComponents/Field.js +1 -1
  346. package/dist/production/src/coreComponents/Field.js.map +1 -1
  347. package/dist/production/src/coreComponents/HasMany.cjs.map +1 -1
  348. package/dist/production/src/coreComponents/HasMany.js +1 -1
  349. package/dist/production/src/coreComponents/HasMany.js.map +1 -1
  350. package/dist/production/src/coreComponents/HasOne.cjs.map +1 -1
  351. package/dist/production/src/coreComponents/HasOne.js +1 -1
  352. package/dist/production/src/coreComponents/HasOne.js.map +1 -1
  353. package/dist/production/src/coreComponents/ParentEntity.cjs.map +1 -1
  354. package/dist/production/src/coreComponents/ParentEntity.js.map +1 -1
  355. package/dist/production/src/entityEvents/useDataBindingEvent.cjs.map +1 -1
  356. package/dist/production/src/entityEvents/useDataBindingEvent.js.map +1 -1
  357. package/dist/production/src/entityEvents/useDerivedField.cjs.map +1 -1
  358. package/dist/production/src/entityEvents/useDerivedField.js.map +1 -1
  359. package/dist/production/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
  360. package/dist/production/src/entityEvents/useEntityBeforePersist.js.map +1 -1
  361. package/dist/production/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
  362. package/dist/production/src/entityEvents/useEntityBeforeUpdate.js.map +1 -1
  363. package/dist/production/src/entityEvents/useEntityEvent.cjs.map +1 -1
  364. package/dist/production/src/entityEvents/useEntityEvent.js.map +1 -1
  365. package/dist/production/src/entityEvents/useEntityPersistError.cjs.map +1 -1
  366. package/dist/production/src/entityEvents/useEntityPersistError.js.map +1 -1
  367. package/dist/production/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
  368. package/dist/production/src/entityEvents/useEntityPersistSuccess.js.map +1 -1
  369. package/dist/production/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
  370. package/dist/production/src/entityEvents/useOnConnectionUpdate.js.map +1 -1
  371. package/dist/production/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
  372. package/dist/production/src/helperComponents/DeferredSubTrees.js.map +1 -1
  373. package/dist/production/src/helperComponents/DeleteEntityTrigger.cjs.map +1 -1
  374. package/dist/production/src/helperComponents/DeleteEntityTrigger.js.map +1 -1
  375. package/dist/production/src/helperComponents/DimensionRenderer.cjs.map +1 -1
  376. package/dist/production/src/helperComponents/DimensionRenderer.js.map +1 -1
  377. package/dist/production/src/helperComponents/EntityView.cjs.map +1 -1
  378. package/dist/production/src/helperComponents/EntityView.js.map +1 -1
  379. package/dist/production/src/helperComponents/FieldView.cjs.map +1 -1
  380. package/dist/production/src/helperComponents/FieldView.js.map +1 -1
  381. package/dist/production/src/helperComponents/If.cjs +7 -10
  382. package/dist/production/src/helperComponents/If.cjs.map +1 -1
  383. package/dist/production/src/helperComponents/If.js +8 -11
  384. package/dist/production/src/helperComponents/If.js.map +1 -1
  385. package/dist/production/src/helperComponents/LabelMiddleware.cjs.map +1 -1
  386. package/dist/production/src/helperComponents/LabelMiddleware.js.map +1 -1
  387. package/dist/production/src/helperComponents/RecursionTerminator.cjs.map +1 -1
  388. package/dist/production/src/helperComponents/RecursionTerminator.js.map +1 -1
  389. package/dist/production/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -1
  390. package/dist/production/src/helperComponents/RecursionTerminatorPortal.js.map +1 -1
  391. package/dist/production/src/helperComponents/StaticRender.cjs.map +1 -1
  392. package/dist/production/src/helperComponents/StaticRender.js.map +1 -1
  393. package/dist/production/src/helperComponents/SugaredField.cjs.map +1 -1
  394. package/dist/production/src/helperComponents/SugaredField.js.map +1 -1
  395. package/dist/production/src/helperComponents/Variable.cjs.map +1 -1
  396. package/dist/production/src/helperComponents/Variable.js.map +1 -1
  397. package/dist/production/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
  398. package/dist/production/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  399. package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.cjs +4 -2
  400. package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.cjs.map +1 -1
  401. package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.js +4 -2
  402. package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
  403. package/dist/production/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
  404. package/dist/production/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
  405. package/dist/production/src/helperComponents/persist/PersistOnFieldChange.cjs.map +1 -1
  406. package/dist/production/src/helperComponents/persist/PersistOnFieldChange.js.map +1 -1
  407. package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.cjs.map +1 -1
  408. package/dist/production/src/helperComponents/persist/PersistOnHasOneChange.js.map +1 -1
  409. package/dist/production/src/helperComponents/persist/PersistOnKey.cjs.map +1 -1
  410. package/dist/production/src/helperComponents/persist/PersistOnKey.js.map +1 -1
  411. package/dist/production/src/helperComponents/persist/PersistTrigger.cjs.map +1 -1
  412. package/dist/production/src/helperComponents/persist/PersistTrigger.js.map +1 -1
  413. package/dist/production/src/helperComponents/persist/useDecoratedPersist.cjs.map +1 -1
  414. package/dist/production/src/helperComponents/persist/useDecoratedPersist.js.map +1 -1
  415. package/dist/production/src/markers/IncrementalMarkerBuilder.cjs +47 -44
  416. package/dist/production/src/markers/IncrementalMarkerBuilder.cjs.map +1 -1
  417. package/dist/production/src/markers/IncrementalMarkerBuilder.js +47 -44
  418. package/dist/production/src/markers/IncrementalMarkerBuilder.js.map +1 -1
  419. package/dist/production/src/markers/MarkerStaticAnalyzer.cjs +19 -19
  420. package/dist/production/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
  421. package/dist/production/src/markers/MarkerStaticAnalyzer.js +19 -19
  422. package/dist/production/src/markers/MarkerStaticAnalyzer.js.map +1 -1
  423. package/dist/production/src/markers/MarkerTreeGenerator.cjs.map +1 -1
  424. package/dist/production/src/markers/MarkerTreeGenerator.js.map +1 -1
  425. package/dist/types/accessorPropagation/BindingOperationsContext.d.ts +1 -1
  426. package/dist/types/accessorPropagation/BindingOperationsContext.d.ts.map +1 -1
  427. package/dist/types/accessorPropagation/EntityKeyContext.d.ts +1 -1
  428. package/dist/types/accessorPropagation/EntityKeyContext.d.ts.map +1 -1
  429. package/dist/types/accessorPropagation/EnvironmentContext.d.ts +1 -1
  430. package/dist/types/accessorPropagation/EnvironmentContext.d.ts.map +1 -1
  431. package/dist/types/accessorPropagation/TreeRootIdContext.d.ts +1 -1
  432. package/dist/types/accessorPropagation/TreeRootIdContext.d.ts.map +1 -1
  433. package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts.map +1 -1
  434. package/dist/types/accessorPropagation/useDesugaredRelativeEntityList.d.ts.map +1 -1
  435. package/dist/types/accessorPropagation/useDesugaredRelativeSingleEntity.d.ts.map +1 -1
  436. package/dist/types/accessorPropagation/useDesugaredRelativeSingleField.d.ts.map +1 -1
  437. package/dist/types/accessorPropagation/useEntity.d.ts.map +1 -1
  438. package/dist/types/accessorPropagation/useEntityList.d.ts.map +1 -1
  439. package/dist/types/accessorPropagation/useEntityListSubTreeLoader.d.ts.map +1 -1
  440. package/dist/types/accessorPropagation/useEntitySubTreeLoader.d.ts.map +1 -1
  441. package/dist/types/accessorPropagation/useExtendTree.d.ts.map +1 -1
  442. package/dist/types/accessorPropagation/useField.d.ts.map +1 -1
  443. package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts +1 -1
  444. package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts.map +1 -1
  445. package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts +1 -1
  446. package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts.map +1 -1
  447. package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts +1 -1
  448. package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts.map +1 -1
  449. package/dist/types/accessorTree/AccessorTreeStateAction.d.ts.map +1 -1
  450. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +1 -1
  451. package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +1 -1
  452. package/dist/types/accessorTree/DirtinessContext.d.ts +1 -1
  453. package/dist/types/accessorTree/DirtinessContext.d.ts.map +1 -1
  454. package/dist/types/accessorTree/MutationStateContext.d.ts +1 -1
  455. package/dist/types/accessorTree/MutationStateContext.d.ts.map +1 -1
  456. package/dist/types/accessorTree/useDataBinding.d.ts.map +1 -1
  457. package/dist/types/accessorTree/useEnvironmentWithSchema.d.ts.map +1 -1
  458. package/dist/types/coreComponents/Component.d.ts.map +1 -1
  459. package/dist/types/coreComponents/DataBindingProvider.d.ts.map +1 -1
  460. package/dist/types/coreComponents/Entity.d.ts +1 -1
  461. package/dist/types/coreComponents/Entity.d.ts.map +1 -1
  462. package/dist/types/coreComponents/EntityList.d.ts.map +1 -1
  463. package/dist/types/coreComponents/EntityListSubTree.d.ts.map +1 -1
  464. package/dist/types/coreComponents/Field.d.ts.map +1 -1
  465. package/dist/types/coreComponents/HasMany.d.ts.map +1 -1
  466. package/dist/types/coreComponents/HasOne.d.ts.map +1 -1
  467. package/dist/types/coreComponents/ParentEntity.d.ts +1 -1
  468. package/dist/types/coreComponents/ParentEntity.d.ts.map +1 -1
  469. package/dist/types/helperComponents/DeferredSubTrees.d.ts +1 -1
  470. package/dist/types/helperComponents/DeferredSubTrees.d.ts.map +1 -1
  471. package/dist/types/helperComponents/DeleteEntityTrigger.d.ts.map +1 -1
  472. package/dist/types/helperComponents/DimensionRenderer.d.ts.map +1 -1
  473. package/dist/types/helperComponents/EntityView.d.ts.map +1 -1
  474. package/dist/types/helperComponents/FieldView.d.ts +13 -2
  475. package/dist/types/helperComponents/FieldView.d.ts.map +1 -1
  476. package/dist/types/helperComponents/If.d.ts +1 -1
  477. package/dist/types/helperComponents/If.d.ts.map +1 -1
  478. package/dist/types/helperComponents/LabelMiddleware.d.ts +1 -1
  479. package/dist/types/helperComponents/LabelMiddleware.d.ts.map +1 -1
  480. package/dist/types/helperComponents/RecursionTerminator.d.ts +1 -1
  481. package/dist/types/helperComponents/RecursionTerminator.d.ts.map +1 -1
  482. package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts +1 -1
  483. package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts.map +1 -1
  484. package/dist/types/helperComponents/StaticRender.d.ts +1 -1
  485. package/dist/types/helperComponents/StaticRender.d.ts.map +1 -1
  486. package/dist/types/helperComponents/Variable.d.ts +1 -1
  487. package/dist/types/helperComponents/Variable.d.ts.map +1 -1
  488. package/dist/types/helperComponents/helpers/FilterEvaluator.d.ts.map +1 -1
  489. package/dist/types/helperComponents/helpers/FilterFieldsCollector.d.ts.map +1 -1
  490. package/dist/types/helperComponents/persist/PersistOnFieldChange.d.ts +1 -1
  491. package/dist/types/helperComponents/persist/PersistOnFieldChange.d.ts.map +1 -1
  492. package/dist/types/helperComponents/persist/PersistOnHasOneChange.d.ts +1 -1
  493. package/dist/types/helperComponents/persist/PersistOnHasOneChange.d.ts.map +1 -1
  494. package/dist/types/helperComponents/persist/PersistTrigger.d.ts.map +1 -1
  495. package/dist/types/markers/IncrementalMarkerBuilder.d.ts.map +1 -1
  496. package/dist/types/markers/MarkerProvider.d.ts.map +1 -1
  497. package/dist/types/markers/MarkerStaticAnalyzer.d.ts.map +1 -1
  498. package/dist/types/markers/MarkerTreeGenerator.d.ts.map +1 -1
  499. package/dist/types/tsconfig.tsbuildinfo +1 -1
  500. package/package.json +18 -13
  501. package/src/accessorPropagation/BindingOperationsContext.ts +3 -3
  502. package/src/accessorPropagation/EnvironmentContext.tsx +1 -1
  503. package/src/accessorPropagation/useAccessorUpdateSubscription.ts +5 -3
  504. package/src/accessorPropagation/useDesugaredRelativeEntityList.ts +2 -3
  505. package/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts +2 -3
  506. package/src/accessorPropagation/useDesugaredRelativeSingleField.ts +2 -3
  507. package/src/accessorPropagation/useEntity.ts +0 -7
  508. package/src/accessorPropagation/useEntityKey.ts +2 -2
  509. package/src/accessorPropagation/useEntityList.ts +0 -3
  510. package/src/accessorPropagation/useEntityListSubTreeLoader.ts +12 -8
  511. package/src/accessorPropagation/useEntityListSubTreeParameters.ts +0 -6
  512. package/src/accessorPropagation/useEntitySubTreeLoader.ts +12 -9
  513. package/src/accessorPropagation/useEntitySubTreeParameters.ts +0 -6
  514. package/src/accessorPropagation/useExtendTree.ts +1 -3
  515. package/src/accessorPropagation/useField.ts +0 -3
  516. package/src/accessorPropagation/useGetEntityListSubTree.ts +3 -8
  517. package/src/accessorPropagation/useGetEntitySubTree.ts +3 -8
  518. package/src/accessorSorting/SetOrderFieldOnCreate.tsx +2 -4
  519. package/src/accessorTree/AccessorTreeStateAction.ts +2 -2
  520. package/src/accessorTree/useDataBinding.ts +18 -21
  521. package/src/accessorTree/useEnvironmentWithSchema.ts +1 -2
  522. package/src/coreComponents/Component.tsx +4 -3
  523. package/src/coreComponents/DataBindingProvider.tsx +0 -1
  524. package/src/coreComponents/Entity.tsx +1 -1
  525. package/src/coreComponents/EntityList.tsx +9 -8
  526. package/src/coreComponents/EntityListSubTree.tsx +14 -12
  527. package/src/coreComponents/Field.tsx +3 -5
  528. package/src/coreComponents/HasMany.tsx +14 -12
  529. package/src/coreComponents/HasOne.tsx +1 -2
  530. package/src/coreComponents/ParentEntity.tsx +1 -2
  531. package/src/entityEvents/useDataBindingEvent.ts +1 -1
  532. package/src/entityEvents/useEntityEvent.ts +1 -1
  533. package/src/helperComponents/DeferredSubTrees.tsx +2 -2
  534. package/src/helperComponents/DeleteEntityTrigger.tsx +1 -3
  535. package/src/helperComponents/DimensionRenderer.tsx +12 -10
  536. package/src/helperComponents/EntityView.tsx +0 -1
  537. package/src/helperComponents/FieldView.tsx +33 -20
  538. package/src/helperComponents/If.tsx +16 -14
  539. package/src/helperComponents/RecursionTerminator.tsx +1 -7
  540. package/src/helperComponents/helpers/FilterEvaluator.ts +0 -3
  541. package/src/helperComponents/helpers/FilterFieldsCollector.ts +5 -6
  542. package/src/helperComponents/helpers/evaluateCondition.ts +1 -1
  543. package/src/helperComponents/persist/PersistOnFieldChange.tsx +0 -1
  544. package/src/helperComponents/persist/PersistOnHasOneChange.tsx +1 -2
  545. package/src/helperComponents/persist/PersistOnKey.tsx +2 -2
  546. package/src/helperComponents/persist/PersistTrigger.tsx +3 -1
  547. package/src/markers/IncrementalMarkerBuilder.ts +50 -45
  548. package/src/markers/MarkerProvider.ts +6 -6
  549. package/src/markers/MarkerStaticAnalyzer.ts +16 -14
  550. package/src/markers/MarkerTreeGenerator.ts +0 -2
  551. package/src/typings/react-fix.d.ts +2 -4
  552. package/tests/cases/unit/core/entityOperations.test.tsx +18 -17
  553. package/tests/cases/unit/core/eventManager.test.tsx +15 -7
  554. package/tests/cases/unit/helperComponents/evaluateCondition.spec.ts +0 -2
  555. package/tests/cases/unit/helperComponents/schema.ts +1 -2
  556. package/tests/cases/unit/model/markerTreeGenerator.spec.tsx +103 -81
  557. package/tests/lib/bindingFactory.ts +11 -1
  558. package/tests/lib/convertModelToAdminSchema.ts +109 -107
@@ -1 +1 @@
1
- {"version":3,"file":"If.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(({ condition, ...props }) => {\n\tif (props.children && props.then) {\n\t\tthrow new Error('If component cannot have both children and then prop')\n\t}\n\treturn typeof condition !== 'function'\n\t\t? <IfFilter condition={condition} {...props} />\n\t\t: <IfCallback condition={condition} {...props} />\n},\n'If',\n)\n\nconst IfCallback = Component<IfCallbackProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst entity = useEntity()\n\t\tconst evaluated = useMemo(() => condition(entity), [condition, entity])\n\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children, then, else: elseIn }) => {\n\t\treturn <>\n\t\t\t{children}\n\t\t\t{then}\n\t\t\t{elseIn}\n\t\t</>\n\t},\n\t'IfCallback',\n)\n\nconst IfFilter = Component<IfFilterProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst env = useEnvironment()\n\t\tconst entity = useEntity()\n\n\t\tconst schema = env.getSchema()\n\t\tconst evaluated = useMemo(\n\t\t\t() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),\n\t\t\t[condition, entity, env, schema],\n\t\t)\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children, condition, then, else: elseIn }, env) => {\n\t\tconst desugaredFilter = QueryLanguage.desugarFilter(condition, env)\n\t\tconst collectedFields = new FilterFieldsCollector(env.getSchema(), desugaredFilter).collectFields(env.getSubTreeNode().entity)\n\t\tconst additionalFields = <>{Array.from(collectedFields).map(it => <Field field={it} key={it} />)}</>\n\n\t\treturn <>\n\t\t\t{additionalFields}\n\t\t\t{children}\n\t\t\t{then}\n\t\t\t{elseIn}\n\t\t</>\n\t},\n\t'IfFilter',\n)\n"],"names":["Component","jsx","useEntity","useMemo","Fragment","jsxs","useEnvironment","FilterEvaluator","QueryLanguage","FilterFieldsCollector","Field"],"mappings":";;;;;;;;;;;AA+BO,MAAM,KAAKA,UAAA;AAAA,EAAmB,CAAC,EAAE,WAAW,GAAG,YAAY;AAC7D,QAAA,MAAM,YAAY,MAAM,MAAM;AAC3B,YAAA,IAAI,MAAM,sDAAsD;AAAA,IAAA;AAEvE,WAAO,OAAO,cAAc,aACzBC,2BAAA,IAAC,UAAS,EAAA,WAAuB,GAAG,MAAA,CAAO,IAC3CA,2BAAA,IAAC,YAAW,EAAA,WAAuB,GAAG,MAAO,CAAA;AAAA,EACjD;AAAA,EACA;AACA;AAEA,MAAM,aAAaD,UAAA;AAAA,EAClB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,SAASE,UAAAA,UAAU;AACnB,UAAA,YAAYC,cAAQ,MAAM,UAAU,MAAM,GAAG,CAAC,WAAW,MAAM,CAAC;AAEtE,WAAUF,2BAAA,IAAAG,WAAA,UAAA,EAAA,UAAA,YAAa,YAAY,OAAQ,QAAO;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,UAAU,MAAM,MAAM,aAAa;AACrC,WACEC,2BAAA,KAAAD,qBAAA,EAAA,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GACF;AAAA,EACD;AAAA,EACA;AACD;AAEA,MAAM,WAAWJ,UAAA;AAAA,EAChB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,MAAMM,eAAAA,eAAe;AAC3B,UAAM,SAASJ,UAAAA,UAAU;AAEnB,UAAA,SAAS,IAAI,UAAU;AAC7B,UAAM,YAAYC,MAAA;AAAA,MACjB,MAAM,IAAII,gBAAAA,gBAAgB,MAAM,EAAE,eAAe,QAAQC,QAAAA,cAAc,cAAc,WAAW,GAAG,CAAC;AAAA,MACpG,CAAC,WAAW,QAAQ,KAAK,MAAM;AAAA,IAChC;AACA,WAAUP,2BAAA,IAAAG,WAAA,UAAA,EAAA,UAAA,YAAa,YAAY,OAAQ,QAAO;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,UAAU,QAAQ;AACrD,UAAM,kBAAkBI,QAAA,cAAc,cAAc,WAAW,GAAG;AAClE,UAAM,kBAAkB,IAAIC,4CAAsB,IAAI,UAAU,GAAG,eAAe,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM;AAC7H,UAAM,mBAAmBR,2BAAA,IAAAG,qBAAA,EAAG,UAAM,MAAA,KAAK,eAAe,EAAE,IAAI,CAAM,OAAAH,2BAAAA,IAACS,MAAAA,OAAM,EAAA,OAAO,MAAS,EAAI,CAAE,GAAE;AAEjG,WACEL,2BAAA,KAAAD,qBAAA,EAAA,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GACF;AAAA,EACD;AAAA,EACA;AACD;;"}
1
+ {"version":3,"file":"If.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(({ condition, ...props }) => {\n\tif (props.children && props.then) {\n\t\tthrow new Error('If component cannot have both children and then prop')\n\t}\n\treturn typeof condition !== 'function'\n\t\t? <IfFilter condition={condition} {...props} />\n\t\t: <IfCallback condition={condition} {...props} />\n}, 'If')\n\nconst IfCallback = Component<IfCallbackProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst entity = useEntity()\n\t\tconst evaluated = useMemo(() => condition(entity), [condition, entity])\n\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children, then, else: elseIn }) => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{children}\n\t\t\t\t{then}\n\t\t\t\t{elseIn}\n\t\t\t</>\n\t\t)\n\t},\n\t'IfCallback',\n)\n\nconst IfFilter = Component<IfFilterProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst env = useEnvironment()\n\t\tconst entity = useEntity()\n\n\t\tconst schema = env.getSchema()\n\t\tconst evaluated = useMemo(\n\t\t\t() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),\n\t\t\t[condition, entity, env, schema],\n\t\t)\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children, condition, then, else: elseIn }, env) => {\n\t\tconst desugaredFilter = QueryLanguage.desugarFilter(condition, env)\n\t\tconst collectedFields = new FilterFieldsCollector(env.getSchema(), desugaredFilter).collectFields(env.getSubTreeNode().entity)\n\t\tconst additionalFields = <>{Array.from(collectedFields).map(it => <Field field={it} key={it} />)}</>\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{additionalFields}\n\t\t\t\t{children}\n\t\t\t\t{then}\n\t\t\t\t{elseIn}\n\t\t\t</>\n\t\t)\n\t},\n\t'IfFilter',\n)\n"],"names":["Component","jsx","useEntity","useMemo","Fragment","jsxs","useEnvironment","FilterEvaluator","QueryLanguage","FilterFieldsCollector","Field"],"mappings":";;;;;;;;;;;AA+BO,MAAM,KAAKA,UAAAA,UAAmB,CAAC,EAAE,WAAW,GAAG,YAAY;AACjE,MAAI,MAAM,YAAY,MAAM,MAAM;AACjC,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACvE;AACA,SAAO,OAAO,cAAc,aACzBC,2BAAAA,IAAC,UAAA,EAAS,WAAuB,GAAG,MAAA,CAAO,IAC3CA,2BAAAA,IAAC,YAAA,EAAW,WAAuB,GAAG,MAAA,CAAO;AACjD,GAAG,IAAI;AAEP,MAAM,aAAaD,UAAAA;AAAAA,EAClB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,SAASE,UAAAA,UAAA;AACf,UAAM,YAAYC,MAAAA,QAAQ,MAAM,UAAU,MAAM,GAAG,CAAC,WAAW,MAAM,CAAC;AAEtE,WAAOF,2BAAAA,IAAAG,WAAAA,UAAA,EAAG,UAAA,YAAa,YAAY,OAAQ,QAAO;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,UAAU,MAAM,MAAM,aAAa;AACrC,WACCC,2BAAAA,KAAAD,qBAAA,EACE,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GACF;AAAA,EAEF;AAAA,EACA;AACD;AAEA,MAAM,WAAWJ,UAAAA;AAAAA,EAChB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,MAAMM,eAAAA,eAAA;AACZ,UAAM,SAASJ,UAAAA,UAAA;AAEf,UAAM,SAAS,IAAI,UAAA;AACnB,UAAM,YAAYC,MAAAA;AAAAA,MACjB,MAAM,IAAII,gBAAAA,gBAAgB,MAAM,EAAE,eAAe,QAAQC,QAAAA,cAAc,cAAc,WAAW,GAAG,CAAC;AAAA,MACpG,CAAC,WAAW,QAAQ,KAAK,MAAM;AAAA,IAAA;AAEhC,WAAOP,2BAAAA,IAAAG,WAAAA,UAAA,EAAG,UAAA,YAAa,YAAY,OAAQ,QAAO;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,OAAA,GAAU,QAAQ;AACrD,UAAM,kBAAkBI,QAAAA,cAAc,cAAc,WAAW,GAAG;AAClE,UAAM,kBAAkB,IAAIC,4CAAsB,IAAI,UAAA,GAAa,eAAe,EAAE,cAAc,IAAI,eAAA,EAAiB,MAAM;AAC7H,UAAM,mBAAmBR,2BAAAA,IAAAG,qBAAA,EAAG,UAAA,MAAM,KAAK,eAAe,EAAE,IAAI,CAAA,OAAMH,2BAAAA,IAACS,MAAAA,OAAA,EAAM,OAAO,MAAS,EAAI,CAAE,GAAE;AAEjG,WACCL,2BAAAA,KAAAD,qBAAA,EACE,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GACF;AAAA,EAEF;AAAA,EACA;AACD;;"}
@@ -1,21 +1,18 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
1
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import { QueryLanguage } from "@contember/binding";
4
4
  import { FilterFieldsCollector } from "./helpers/FilterFieldsCollector.js";
5
5
  import { FilterEvaluator } from "./helpers/FilterEvaluator.js";
6
6
  import { Field } from "../coreComponents/Field.js";
7
7
  import { Component } from "../coreComponents/Component.js";
8
- import { useEntity } from "../accessorPropagation/useEntity.js";
9
8
  import { useEnvironment } from "../accessorPropagation/useEnvironment.js";
10
- const If = Component(
11
- ({ condition, ...props }) => {
12
- if (props.children && props.then) {
13
- throw new Error("If component cannot have both children and then prop");
14
- }
15
- return typeof condition !== "function" ? /* @__PURE__ */ jsx(IfFilter, { condition, ...props }) : /* @__PURE__ */ jsx(IfCallback, { condition, ...props });
16
- },
17
- "If"
18
- );
9
+ import { useEntity } from "../accessorPropagation/useEntity.js";
10
+ const If = Component(({ condition, ...props }) => {
11
+ if (props.children && props.then) {
12
+ throw new Error("If component cannot have both children and then prop");
13
+ }
14
+ return typeof condition !== "function" ? /* @__PURE__ */ jsx(IfFilter, { condition, ...props }) : /* @__PURE__ */ jsx(IfCallback, { condition, ...props });
15
+ }, "If");
19
16
  const IfCallback = Component(
20
17
  ({ children, condition, then, else: elseIn }) => {
21
18
  const entity = useEntity();
@@ -1 +1 @@
1
- {"version":3,"file":"If.js","sources":["../../../../../packages/react-binding/src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(({ condition, ...props }) => {\n\tif (props.children && props.then) {\n\t\tthrow new Error('If component cannot have both children and then prop')\n\t}\n\treturn typeof condition !== 'function'\n\t\t? <IfFilter condition={condition} {...props} />\n\t\t: <IfCallback condition={condition} {...props} />\n},\n'If',\n)\n\nconst IfCallback = Component<IfCallbackProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst entity = useEntity()\n\t\tconst evaluated = useMemo(() => condition(entity), [condition, entity])\n\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children, then, else: elseIn }) => {\n\t\treturn <>\n\t\t\t{children}\n\t\t\t{then}\n\t\t\t{elseIn}\n\t\t</>\n\t},\n\t'IfCallback',\n)\n\nconst IfFilter = Component<IfFilterProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst env = useEnvironment()\n\t\tconst entity = useEntity()\n\n\t\tconst schema = env.getSchema()\n\t\tconst evaluated = useMemo(\n\t\t\t() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),\n\t\t\t[condition, entity, env, schema],\n\t\t)\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children, condition, then, else: elseIn }, env) => {\n\t\tconst desugaredFilter = QueryLanguage.desugarFilter(condition, env)\n\t\tconst collectedFields = new FilterFieldsCollector(env.getSchema(), desugaredFilter).collectFields(env.getSubTreeNode().entity)\n\t\tconst additionalFields = <>{Array.from(collectedFields).map(it => <Field field={it} key={it} />)}</>\n\n\t\treturn <>\n\t\t\t{additionalFields}\n\t\t\t{children}\n\t\t\t{then}\n\t\t\t{elseIn}\n\t\t</>\n\t},\n\t'IfFilter',\n)\n"],"names":[],"mappings":";;;;;;;;;AA+BO,MAAM,KAAK;AAAA,EAAmB,CAAC,EAAE,WAAW,GAAG,YAAY;AAC7D,QAAA,MAAM,YAAY,MAAM,MAAM;AAC3B,YAAA,IAAI,MAAM,sDAAsD;AAAA,IAAA;AAEvE,WAAO,OAAO,cAAc,aACzB,oBAAC,UAAS,EAAA,WAAuB,GAAG,MAAA,CAAO,IAC3C,oBAAC,YAAW,EAAA,WAAuB,GAAG,MAAO,CAAA;AAAA,EACjD;AAAA,EACA;AACA;AAEA,MAAM,aAAa;AAAA,EAClB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,SAAS,UAAU;AACnB,UAAA,YAAY,QAAQ,MAAM,UAAU,MAAM,GAAG,CAAC,WAAW,MAAM,CAAC;AAEtE,WAAU,oBAAA,UAAA,EAAA,UAAA,YAAa,YAAY,OAAQ,QAAO;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,UAAU,MAAM,MAAM,aAAa;AACrC,WACE,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GACF;AAAA,EACD;AAAA,EACA;AACD;AAEA,MAAM,WAAW;AAAA,EAChB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,MAAM,eAAe;AAC3B,UAAM,SAAS,UAAU;AAEnB,UAAA,SAAS,IAAI,UAAU;AAC7B,UAAM,YAAY;AAAA,MACjB,MAAM,IAAI,gBAAgB,MAAM,EAAE,eAAe,QAAQ,cAAc,cAAc,WAAW,GAAG,CAAC;AAAA,MACpG,CAAC,WAAW,QAAQ,KAAK,MAAM;AAAA,IAChC;AACA,WAAU,oBAAA,UAAA,EAAA,UAAA,YAAa,YAAY,OAAQ,QAAO;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,UAAU,QAAQ;AACrD,UAAM,kBAAkB,cAAc,cAAc,WAAW,GAAG;AAClE,UAAM,kBAAkB,IAAI,sBAAsB,IAAI,UAAU,GAAG,eAAe,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM;AAC7H,UAAM,mBAAmB,oBAAA,UAAA,EAAG,UAAM,MAAA,KAAK,eAAe,EAAE,IAAI,CAAM,OAAA,oBAAC,OAAM,EAAA,OAAO,MAAS,EAAI,CAAE,GAAE;AAEjG,WACE,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GACF;AAAA,EACD;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"If.js","sources":["../../../../../packages/react-binding/src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n\tthen?: ReactNode\n\telse?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(({ condition, ...props }) => {\n\tif (props.children && props.then) {\n\t\tthrow new Error('If component cannot have both children and then prop')\n\t}\n\treturn typeof condition !== 'function'\n\t\t? <IfFilter condition={condition} {...props} />\n\t\t: <IfCallback condition={condition} {...props} />\n}, 'If')\n\nconst IfCallback = Component<IfCallbackProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst entity = useEntity()\n\t\tconst evaluated = useMemo(() => condition(entity), [condition, entity])\n\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children, then, else: elseIn }) => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{children}\n\t\t\t\t{then}\n\t\t\t\t{elseIn}\n\t\t\t</>\n\t\t)\n\t},\n\t'IfCallback',\n)\n\nconst IfFilter = Component<IfFilterProps>(\n\t({ children, condition, then, else: elseIn }) => {\n\t\tconst env = useEnvironment()\n\t\tconst entity = useEntity()\n\n\t\tconst schema = env.getSchema()\n\t\tconst evaluated = useMemo(\n\t\t\t() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),\n\t\t\t[condition, entity, env, schema],\n\t\t)\n\t\treturn <>{evaluated ? (children ?? then) : elseIn}</>\n\t},\n\t({ children, condition, then, else: elseIn }, env) => {\n\t\tconst desugaredFilter = QueryLanguage.desugarFilter(condition, env)\n\t\tconst collectedFields = new FilterFieldsCollector(env.getSchema(), desugaredFilter).collectFields(env.getSubTreeNode().entity)\n\t\tconst additionalFields = <>{Array.from(collectedFields).map(it => <Field field={it} key={it} />)}</>\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{additionalFields}\n\t\t\t\t{children}\n\t\t\t\t{then}\n\t\t\t\t{elseIn}\n\t\t\t</>\n\t\t)\n\t},\n\t'IfFilter',\n)\n"],"names":[],"mappings":";;;;;;;;;AA+BO,MAAM,KAAK,UAAmB,CAAC,EAAE,WAAW,GAAG,YAAY;AACjE,MAAI,MAAM,YAAY,MAAM,MAAM;AACjC,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACvE;AACA,SAAO,OAAO,cAAc,aACzB,oBAAC,UAAA,EAAS,WAAuB,GAAG,MAAA,CAAO,IAC3C,oBAAC,YAAA,EAAW,WAAuB,GAAG,MAAA,CAAO;AACjD,GAAG,IAAI;AAEP,MAAM,aAAa;AAAA,EAClB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,SAAS,UAAA;AACf,UAAM,YAAY,QAAQ,MAAM,UAAU,MAAM,GAAG,CAAC,WAAW,MAAM,CAAC;AAEtE,WAAO,oBAAA,UAAA,EAAG,UAAA,YAAa,YAAY,OAAQ,QAAO;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,UAAU,MAAM,MAAM,aAAa;AACrC,WACC,qBAAA,UAAA,EACE,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GACF;AAAA,EAEF;AAAA,EACA;AACD;AAEA,MAAM,WAAW;AAAA,EAChB,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,aAAa;AAChD,UAAM,MAAM,eAAA;AACZ,UAAM,SAAS,UAAA;AAEf,UAAM,SAAS,IAAI,UAAA;AACnB,UAAM,YAAY;AAAA,MACjB,MAAM,IAAI,gBAAgB,MAAM,EAAE,eAAe,QAAQ,cAAc,cAAc,WAAW,GAAG,CAAC;AAAA,MACpG,CAAC,WAAW,QAAQ,KAAK,MAAM;AAAA,IAAA;AAEhC,WAAO,oBAAA,UAAA,EAAG,UAAA,YAAa,YAAY,OAAQ,QAAO;AAAA,EACnD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,MAAM,MAAM,OAAA,GAAU,QAAQ;AACrD,UAAM,kBAAkB,cAAc,cAAc,WAAW,GAAG;AAClE,UAAM,kBAAkB,IAAI,sBAAsB,IAAI,UAAA,GAAa,eAAe,EAAE,cAAc,IAAI,eAAA,EAAiB,MAAM;AAC7H,UAAM,mBAAmB,oBAAA,UAAA,EAAG,UAAA,MAAM,KAAK,eAAe,EAAE,IAAI,CAAA,OAAM,oBAAC,OAAA,EAAM,OAAO,MAAS,EAAI,CAAE,GAAE;AAEjG,WACC,qBAAA,UAAA,EACE,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GACF;AAAA,EAEF;AAAA,EACA;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LabelMiddleware.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/LabelMiddleware.tsx"],"sourcesContent":["import { createContext, ReactNode, useCallback, useContext } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport type LabelMiddleware = (label: ReactNode, environment: Environment) => ReactNode\n\nexport const LabelMiddlewareContext = createContext<LabelMiddleware>(it => it)\n\nexport const useLabelMiddleware = () => {\n\tconst env = useEnvironment()\n\tconst labelMiddleware = useContext(LabelMiddlewareContext)\n\treturn useCallback((it: ReactNode) => labelMiddleware(it, env), [env, labelMiddleware])\n}\n\nexport const LabelMiddlewareProvider = ({ value, children }: { value: LabelMiddleware; children: ReactNode }) => {\n\treturn (\n\t\t<LabelMiddlewareContext.Provider value={value}>\n\t\t\t{children}\n\t\t</LabelMiddlewareContext.Provider>\n\t)\n}\n"],"names":["createContext","useEnvironment","useContext","useCallback","jsx"],"mappings":";;;;;AAMa,MAAA,yBAAyBA,MAAAA,cAA+B,CAAA,OAAM,EAAE;AAEtE,MAAM,qBAAqB,MAAM;AACvC,QAAM,MAAMC,eAAAA,eAAe;AACrB,QAAA,kBAAkBC,iBAAW,sBAAsB;AAClD,SAAAC,MAAA,YAAY,CAAC,OAAkB,gBAAgB,IAAI,GAAG,GAAG,CAAC,KAAK,eAAe,CAAC;AACvF;AAEO,MAAM,0BAA0B,CAAC,EAAE,OAAO,eAAgE;AAChH,SACEC,2BAAAA,IAAA,uBAAuB,UAAvB,EAAgC,OAC/B,SACF,CAAA;AAEF;;;;"}
1
+ {"version":3,"file":"LabelMiddleware.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/LabelMiddleware.tsx"],"sourcesContent":["import { createContext, ReactNode, useCallback, useContext } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport type LabelMiddleware = (label: ReactNode, environment: Environment) => ReactNode\n\nexport const LabelMiddlewareContext = createContext<LabelMiddleware>(it => it)\n\nexport const useLabelMiddleware = () => {\n\tconst env = useEnvironment()\n\tconst labelMiddleware = useContext(LabelMiddlewareContext)\n\treturn useCallback((it: ReactNode) => labelMiddleware(it, env), [env, labelMiddleware])\n}\n\nexport const LabelMiddlewareProvider = ({ value, children }: { value: LabelMiddleware; children: ReactNode }) => {\n\treturn (\n\t\t<LabelMiddlewareContext.Provider value={value}>\n\t\t\t{children}\n\t\t</LabelMiddlewareContext.Provider>\n\t)\n}\n"],"names":["createContext","useEnvironment","useContext","useCallback","jsx"],"mappings":";;;;;AAMO,MAAM,yBAAyBA,MAAAA,cAA+B,CAAA,OAAM,EAAE;AAEtE,MAAM,qBAAqB,MAAM;AACvC,QAAM,MAAMC,eAAAA,eAAA;AACZ,QAAM,kBAAkBC,MAAAA,WAAW,sBAAsB;AACzD,SAAOC,MAAAA,YAAY,CAAC,OAAkB,gBAAgB,IAAI,GAAG,GAAG,CAAC,KAAK,eAAe,CAAC;AACvF;AAEO,MAAM,0BAA0B,CAAC,EAAE,OAAO,eAAgE;AAChH,SACCC,2BAAAA,IAAC,uBAAuB,UAAvB,EAAgC,OAC/B,SAAA,CACF;AAEF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LabelMiddleware.js","sources":["../../../../../packages/react-binding/src/helperComponents/LabelMiddleware.tsx"],"sourcesContent":["import { createContext, ReactNode, useCallback, useContext } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport type LabelMiddleware = (label: ReactNode, environment: Environment) => ReactNode\n\nexport const LabelMiddlewareContext = createContext<LabelMiddleware>(it => it)\n\nexport const useLabelMiddleware = () => {\n\tconst env = useEnvironment()\n\tconst labelMiddleware = useContext(LabelMiddlewareContext)\n\treturn useCallback((it: ReactNode) => labelMiddleware(it, env), [env, labelMiddleware])\n}\n\nexport const LabelMiddlewareProvider = ({ value, children }: { value: LabelMiddleware; children: ReactNode }) => {\n\treturn (\n\t\t<LabelMiddlewareContext.Provider value={value}>\n\t\t\t{children}\n\t\t</LabelMiddlewareContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;;AAMa,MAAA,yBAAyB,cAA+B,CAAA,OAAM,EAAE;AAEtE,MAAM,qBAAqB,MAAM;AACvC,QAAM,MAAM,eAAe;AACrB,QAAA,kBAAkB,WAAW,sBAAsB;AAClD,SAAA,YAAY,CAAC,OAAkB,gBAAgB,IAAI,GAAG,GAAG,CAAC,KAAK,eAAe,CAAC;AACvF;AAEO,MAAM,0BAA0B,CAAC,EAAE,OAAO,eAAgE;AAChH,SACE,oBAAA,uBAAuB,UAAvB,EAAgC,OAC/B,SACF,CAAA;AAEF;"}
1
+ {"version":3,"file":"LabelMiddleware.js","sources":["../../../../../packages/react-binding/src/helperComponents/LabelMiddleware.tsx"],"sourcesContent":["import { createContext, ReactNode, useCallback, useContext } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport type LabelMiddleware = (label: ReactNode, environment: Environment) => ReactNode\n\nexport const LabelMiddlewareContext = createContext<LabelMiddleware>(it => it)\n\nexport const useLabelMiddleware = () => {\n\tconst env = useEnvironment()\n\tconst labelMiddleware = useContext(LabelMiddlewareContext)\n\treturn useCallback((it: ReactNode) => labelMiddleware(it, env), [env, labelMiddleware])\n}\n\nexport const LabelMiddlewareProvider = ({ value, children }: { value: LabelMiddleware; children: ReactNode }) => {\n\treturn (\n\t\t<LabelMiddlewareContext.Provider value={value}>\n\t\t\t{children}\n\t\t</LabelMiddlewareContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;;AAMO,MAAM,yBAAyB,cAA+B,CAAA,OAAM,EAAE;AAEtE,MAAM,qBAAqB,MAAM;AACvC,QAAM,MAAM,eAAA;AACZ,QAAM,kBAAkB,WAAW,sBAAsB;AACzD,SAAO,YAAY,CAAC,OAAkB,gBAAgB,IAAI,GAAG,GAAG,CAAC,KAAK,eAAe,CAAC;AACvF;AAEO,MAAM,0BAA0B,CAAC,EAAE,OAAO,eAAgE;AAChH,SACC,oBAAC,uBAAuB,UAAvB,EAAgC,OAC/B,SAAA,CACF;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RecursionTerminator.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/RecursionTerminator.tsx"],"sourcesContent":["import {\n\tEnvironment,\n\tSugarableHasOneRelation,\n\tSugaredRelativeEntityList,\n\tSugaredRelativeSingleEntity,\n\tTokenRegExps,\n} from '@contember/binding'\nimport { ReactNode, useMemo } from 'react'\nimport { Component } from '../coreComponents'\n\nexport interface RecursionTerminatorOptions {\n\tshouldTerminate?: (args: { node: Environment.AnyNode; field: string; environment: Environment }) => boolean | undefined\n}\n\nexport const recursionTerminatorEnvironmentExtension = Environment.createExtension((options: RecursionTerminatorOptions | undefined) => {\n\treturn options\n})\n\nexport interface RecursionTerminatorProps {\n\tfield:\n\t\t| { kind: 'hasOne'; field: SugaredRelativeSingleEntity['field'] }\n\t\t| { kind: 'hasMany'; field: SugaredRelativeEntityList['field'] }\n\tchildren: ReactNode\n}\n\nexport const RecursionTerminator = Component<RecursionTerminatorProps>(({ field, children }, env) => {\n\tconst isRecursion = useMemo(() => {\n\t\treturn recursionDetector(field, env)\n\t}, [field, env])\n\n\treturn !isRecursion ? children : null\n}, ({ field, children }, env) => {\n\tconst isRecursion = recursionDetector(field, env)\n\treturn !isRecursion ? children : null\n})\n\nconst recursionDetector = (field: RecursionTerminatorProps['field'], env: Environment) => {\n\tconst firstPathItem = getFirstPathItem(field)\n\tif (!firstPathItem) {\n\t\treturn false\n\t}\n\tconst shouldTerminate = env.getExtension(recursionTerminatorEnvironmentExtension)?.shouldTerminate\n\tconst shouldTerminateResult = shouldTerminate?.({ node: env.getSubTreeNode(), field: firstPathItem, environment: env })\n\tif (shouldTerminateResult !== undefined) {\n\t\treturn shouldTerminateResult\n\t}\n\n\tconst node = env.getSubTreeNode()\n\tconst otherSide = node.type === 'entity-list' || node.type === 'entity' ? (node.field.ownedBy ?? node.field.inversedBy) : undefined\n\tif (!otherSide) {\n\t\treturn false\n\t}\n\tif (!firstPathItem) {\n\t\treturn false\n\t}\n\treturn otherSide === firstPathItem\n}\n\nconst getFirstPathItem = (field: RecursionTerminatorProps['field']) => {\n\tif (typeof field.field === 'string') {\n\t\treturn field.field.match(TokenRegExps.identifier)?.[0]\n\t}\n\tconst getFromHasOne = (relation: SugarableHasOneRelation[] | SugarableHasOneRelation | undefined) => {\n\t\tif (Array.isArray(relation)) {\n\t\t\treturn relation?.[0].field\n\t\t}\n\t\treturn relation?.field\n\t}\n\tif (field.kind === 'hasMany') {\n\t\treturn getFromHasOne(field.field.hasOneRelationPath) ?? field.field.hasManyRelation.field\n\t}\n\treturn getFromHasOne(field.field)\n}\n"],"names":["Environment","Component","useMemo","TokenRegExps"],"mappings":";;;;;AAcO,MAAM,0CAA0CA,QAAA,YAAY,gBAAgB,CAAC,YAAoD;AAChI,SAAA;AACR,CAAC;AASM,MAAM,sBAAsBC,UAAoC,UAAA,CAAC,EAAE,OAAO,SAAA,GAAY,QAAQ;AAC9F,QAAA,cAAcC,MAAAA,QAAQ,MAAM;AAC1B,WAAA,kBAAkB,OAAO,GAAG;AAAA,EAAA,GACjC,CAAC,OAAO,GAAG,CAAC;AAER,SAAA,CAAC,cAAc,WAAW;AAClC,GAAG,CAAC,EAAE,OAAO,SAAA,GAAY,QAAQ;AAC1B,QAAA,cAAc,kBAAkB,OAAO,GAAG;AACzC,SAAA,CAAC,cAAc,WAAW;AAClC,CAAC;AAED,MAAM,oBAAoB,CAAC,OAA0C,QAAqB;AACnF,QAAA,gBAAgB,iBAAiB,KAAK;AAC5C,MAAI,CAAC,eAAe;AACZ,WAAA;AAAA,EAAA;AAER,QAAM,kBAAkB,IAAI,aAAa,uCAAuC,GAAG;AAC7E,QAAA,wBAAwB,kBAAkB,EAAE,MAAM,IAAI,eAAe,GAAG,OAAO,eAAe,aAAa,IAAA,CAAK;AACtH,MAAI,0BAA0B,QAAW;AACjC,WAAA;AAAA,EAAA;AAGF,QAAA,OAAO,IAAI,eAAe;AAChC,QAAM,YAAY,KAAK,SAAS,iBAAiB,KAAK,SAAS,WAAY,KAAK,MAAM,WAAW,KAAK,MAAM,aAAc;AAC1H,MAAI,CAAC,WAAW;AACR,WAAA;AAAA,EAAA;AAER,MAAI,CAAC,eAAe;AACZ,WAAA;AAAA,EAAA;AAER,SAAO,cAAc;AACtB;AAEA,MAAM,mBAAmB,CAAC,UAA6C;AAClE,MAAA,OAAO,MAAM,UAAU,UAAU;AACpC,WAAO,MAAM,MAAM,MAAMC,QAAAA,aAAa,UAAU,IAAI,CAAC;AAAA,EAAA;AAEhD,QAAA,gBAAgB,CAAC,aAA8E;AAChG,QAAA,MAAM,QAAQ,QAAQ,GAAG;AACrB,aAAA,WAAW,CAAC,EAAE;AAAA,IAAA;AAEtB,WAAO,UAAU;AAAA,EAClB;AACI,MAAA,MAAM,SAAS,WAAW;AAC7B,WAAO,cAAc,MAAM,MAAM,kBAAkB,KAAK,MAAM,MAAM,gBAAgB;AAAA,EAAA;AAE9E,SAAA,cAAc,MAAM,KAAK;AACjC;;;"}
1
+ {"version":3,"file":"RecursionTerminator.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/RecursionTerminator.tsx"],"sourcesContent":["import { Environment, SugarableHasOneRelation, SugaredRelativeEntityList, SugaredRelativeSingleEntity, TokenRegExps } from '@contember/binding'\nimport { ReactNode, useMemo } from 'react'\nimport { Component } from '../coreComponents'\n\nexport interface RecursionTerminatorOptions {\n\tshouldTerminate?: (args: { node: Environment.AnyNode; field: string; environment: Environment }) => boolean | undefined\n}\n\nexport const recursionTerminatorEnvironmentExtension = Environment.createExtension((options: RecursionTerminatorOptions | undefined) => {\n\treturn options\n})\n\nexport interface RecursionTerminatorProps {\n\tfield:\n\t\t| { kind: 'hasOne'; field: SugaredRelativeSingleEntity['field'] }\n\t\t| { kind: 'hasMany'; field: SugaredRelativeEntityList['field'] }\n\tchildren: ReactNode\n}\n\nexport const RecursionTerminator = Component<RecursionTerminatorProps>(({ field, children }, env) => {\n\tconst isRecursion = useMemo(() => {\n\t\treturn recursionDetector(field, env)\n\t}, [field, env])\n\n\treturn !isRecursion ? children : null\n}, ({ field, children }, env) => {\n\tconst isRecursion = recursionDetector(field, env)\n\treturn !isRecursion ? children : null\n})\n\nconst recursionDetector = (field: RecursionTerminatorProps['field'], env: Environment) => {\n\tconst firstPathItem = getFirstPathItem(field)\n\tif (!firstPathItem) {\n\t\treturn false\n\t}\n\tconst shouldTerminate = env.getExtension(recursionTerminatorEnvironmentExtension)?.shouldTerminate\n\tconst shouldTerminateResult = shouldTerminate?.({ node: env.getSubTreeNode(), field: firstPathItem, environment: env })\n\tif (shouldTerminateResult !== undefined) {\n\t\treturn shouldTerminateResult\n\t}\n\n\tconst node = env.getSubTreeNode()\n\tconst otherSide = node.type === 'entity-list' || node.type === 'entity' ? (node.field.ownedBy ?? node.field.inversedBy) : undefined\n\tif (!otherSide) {\n\t\treturn false\n\t}\n\tif (!firstPathItem) {\n\t\treturn false\n\t}\n\treturn otherSide === firstPathItem\n}\n\nconst getFirstPathItem = (field: RecursionTerminatorProps['field']) => {\n\tif (typeof field.field === 'string') {\n\t\treturn field.field.match(TokenRegExps.identifier)?.[0]\n\t}\n\tconst getFromHasOne = (relation: SugarableHasOneRelation[] | SugarableHasOneRelation | undefined) => {\n\t\tif (Array.isArray(relation)) {\n\t\t\treturn relation?.[0].field\n\t\t}\n\t\treturn relation?.field\n\t}\n\tif (field.kind === 'hasMany') {\n\t\treturn getFromHasOne(field.field.hasOneRelationPath) ?? field.field.hasManyRelation.field\n\t}\n\treturn getFromHasOne(field.field)\n}\n"],"names":["Environment","Component","useMemo","TokenRegExps"],"mappings":";;;;;AAQO,MAAM,0CAA0CA,QAAAA,YAAY,gBAAgB,CAAC,YAAoD;AACvI,SAAO;AACR,CAAC;AASM,MAAM,sBAAsBC,UAAAA,UAAoC,CAAC,EAAE,OAAO,SAAA,GAAY,QAAQ;AACpG,QAAM,cAAcC,MAAAA,QAAQ,MAAM;AACjC,WAAO,kBAAkB,OAAO,GAAG;AAAA,EACpC,GAAG,CAAC,OAAO,GAAG,CAAC;AAEf,SAAO,CAAC,cAAc,WAAW;AAClC,GAAG,CAAC,EAAE,OAAO,SAAA,GAAY,QAAQ;AAChC,QAAM,cAAc,kBAAkB,OAAO,GAAG;AAChD,SAAO,CAAC,cAAc,WAAW;AAClC,CAAC;AAED,MAAM,oBAAoB,CAAC,OAA0C,QAAqB;AACzF,QAAM,gBAAgB,iBAAiB,KAAK;AAC5C,MAAI,CAAC,eAAe;AACnB,WAAO;AAAA,EACR;AACA,QAAM,kBAAkB,IAAI,aAAa,uCAAuC,GAAG;AACnF,QAAM,wBAAwB,kBAAkB,EAAE,MAAM,IAAI,eAAA,GAAkB,OAAO,eAAe,aAAa,IAAA,CAAK;AACtH,MAAI,0BAA0B,QAAW;AACxC,WAAO;AAAA,EACR;AAEA,QAAM,OAAO,IAAI,eAAA;AACjB,QAAM,YAAY,KAAK,SAAS,iBAAiB,KAAK,SAAS,WAAY,KAAK,MAAM,WAAW,KAAK,MAAM,aAAc;AAC1H,MAAI,CAAC,WAAW;AACf,WAAO;AAAA,EACR;AACA,MAAI,CAAC,eAAe;AACnB,WAAO;AAAA,EACR;AACA,SAAO,cAAc;AACtB;AAEA,MAAM,mBAAmB,CAAC,UAA6C;AACtE,MAAI,OAAO,MAAM,UAAU,UAAU;AACpC,WAAO,MAAM,MAAM,MAAMC,QAAAA,aAAa,UAAU,IAAI,CAAC;AAAA,EACtD;AACA,QAAM,gBAAgB,CAAC,aAA8E;AACpG,QAAI,MAAM,QAAQ,QAAQ,GAAG;AAC5B,aAAO,WAAW,CAAC,EAAE;AAAA,IACtB;AACA,WAAO,UAAU;AAAA,EAClB;AACA,MAAI,MAAM,SAAS,WAAW;AAC7B,WAAO,cAAc,MAAM,MAAM,kBAAkB,KAAK,MAAM,MAAM,gBAAgB;AAAA,EACrF;AACA,SAAO,cAAc,MAAM,KAAK;AACjC;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RecursionTerminator.js","sources":["../../../../../packages/react-binding/src/helperComponents/RecursionTerminator.tsx"],"sourcesContent":["import {\n\tEnvironment,\n\tSugarableHasOneRelation,\n\tSugaredRelativeEntityList,\n\tSugaredRelativeSingleEntity,\n\tTokenRegExps,\n} from '@contember/binding'\nimport { ReactNode, useMemo } from 'react'\nimport { Component } from '../coreComponents'\n\nexport interface RecursionTerminatorOptions {\n\tshouldTerminate?: (args: { node: Environment.AnyNode; field: string; environment: Environment }) => boolean | undefined\n}\n\nexport const recursionTerminatorEnvironmentExtension = Environment.createExtension((options: RecursionTerminatorOptions | undefined) => {\n\treturn options\n})\n\nexport interface RecursionTerminatorProps {\n\tfield:\n\t\t| { kind: 'hasOne'; field: SugaredRelativeSingleEntity['field'] }\n\t\t| { kind: 'hasMany'; field: SugaredRelativeEntityList['field'] }\n\tchildren: ReactNode\n}\n\nexport const RecursionTerminator = Component<RecursionTerminatorProps>(({ field, children }, env) => {\n\tconst isRecursion = useMemo(() => {\n\t\treturn recursionDetector(field, env)\n\t}, [field, env])\n\n\treturn !isRecursion ? children : null\n}, ({ field, children }, env) => {\n\tconst isRecursion = recursionDetector(field, env)\n\treturn !isRecursion ? children : null\n})\n\nconst recursionDetector = (field: RecursionTerminatorProps['field'], env: Environment) => {\n\tconst firstPathItem = getFirstPathItem(field)\n\tif (!firstPathItem) {\n\t\treturn false\n\t}\n\tconst shouldTerminate = env.getExtension(recursionTerminatorEnvironmentExtension)?.shouldTerminate\n\tconst shouldTerminateResult = shouldTerminate?.({ node: env.getSubTreeNode(), field: firstPathItem, environment: env })\n\tif (shouldTerminateResult !== undefined) {\n\t\treturn shouldTerminateResult\n\t}\n\n\tconst node = env.getSubTreeNode()\n\tconst otherSide = node.type === 'entity-list' || node.type === 'entity' ? (node.field.ownedBy ?? node.field.inversedBy) : undefined\n\tif (!otherSide) {\n\t\treturn false\n\t}\n\tif (!firstPathItem) {\n\t\treturn false\n\t}\n\treturn otherSide === firstPathItem\n}\n\nconst getFirstPathItem = (field: RecursionTerminatorProps['field']) => {\n\tif (typeof field.field === 'string') {\n\t\treturn field.field.match(TokenRegExps.identifier)?.[0]\n\t}\n\tconst getFromHasOne = (relation: SugarableHasOneRelation[] | SugarableHasOneRelation | undefined) => {\n\t\tif (Array.isArray(relation)) {\n\t\t\treturn relation?.[0].field\n\t\t}\n\t\treturn relation?.field\n\t}\n\tif (field.kind === 'hasMany') {\n\t\treturn getFromHasOne(field.field.hasOneRelationPath) ?? field.field.hasManyRelation.field\n\t}\n\treturn getFromHasOne(field.field)\n}\n"],"names":[],"mappings":";;;AAcO,MAAM,0CAA0C,YAAY,gBAAgB,CAAC,YAAoD;AAChI,SAAA;AACR,CAAC;AASM,MAAM,sBAAsB,UAAoC,CAAC,EAAE,OAAO,SAAA,GAAY,QAAQ;AAC9F,QAAA,cAAc,QAAQ,MAAM;AAC1B,WAAA,kBAAkB,OAAO,GAAG;AAAA,EAAA,GACjC,CAAC,OAAO,GAAG,CAAC;AAER,SAAA,CAAC,cAAc,WAAW;AAClC,GAAG,CAAC,EAAE,OAAO,SAAA,GAAY,QAAQ;AAC1B,QAAA,cAAc,kBAAkB,OAAO,GAAG;AACzC,SAAA,CAAC,cAAc,WAAW;AAClC,CAAC;AAED,MAAM,oBAAoB,CAAC,OAA0C,QAAqB;AACnF,QAAA,gBAAgB,iBAAiB,KAAK;AAC5C,MAAI,CAAC,eAAe;AACZ,WAAA;AAAA,EAAA;AAER,QAAM,kBAAkB,IAAI,aAAa,uCAAuC,GAAG;AAC7E,QAAA,wBAAwB,kBAAkB,EAAE,MAAM,IAAI,eAAe,GAAG,OAAO,eAAe,aAAa,IAAA,CAAK;AACtH,MAAI,0BAA0B,QAAW;AACjC,WAAA;AAAA,EAAA;AAGF,QAAA,OAAO,IAAI,eAAe;AAChC,QAAM,YAAY,KAAK,SAAS,iBAAiB,KAAK,SAAS,WAAY,KAAK,MAAM,WAAW,KAAK,MAAM,aAAc;AAC1H,MAAI,CAAC,WAAW;AACR,WAAA;AAAA,EAAA;AAER,MAAI,CAAC,eAAe;AACZ,WAAA;AAAA,EAAA;AAER,SAAO,cAAc;AACtB;AAEA,MAAM,mBAAmB,CAAC,UAA6C;AAClE,MAAA,OAAO,MAAM,UAAU,UAAU;AACpC,WAAO,MAAM,MAAM,MAAM,aAAa,UAAU,IAAI,CAAC;AAAA,EAAA;AAEhD,QAAA,gBAAgB,CAAC,aAA8E;AAChG,QAAA,MAAM,QAAQ,QAAQ,GAAG;AACrB,aAAA,WAAW,CAAC,EAAE;AAAA,IAAA;AAEtB,WAAO,UAAU;AAAA,EAClB;AACI,MAAA,MAAM,SAAS,WAAW;AAC7B,WAAO,cAAc,MAAM,MAAM,kBAAkB,KAAK,MAAM,MAAM,gBAAgB;AAAA,EAAA;AAE9E,SAAA,cAAc,MAAM,KAAK;AACjC;"}
1
+ {"version":3,"file":"RecursionTerminator.js","sources":["../../../../../packages/react-binding/src/helperComponents/RecursionTerminator.tsx"],"sourcesContent":["import { Environment, SugarableHasOneRelation, SugaredRelativeEntityList, SugaredRelativeSingleEntity, TokenRegExps } from '@contember/binding'\nimport { ReactNode, useMemo } from 'react'\nimport { Component } from '../coreComponents'\n\nexport interface RecursionTerminatorOptions {\n\tshouldTerminate?: (args: { node: Environment.AnyNode; field: string; environment: Environment }) => boolean | undefined\n}\n\nexport const recursionTerminatorEnvironmentExtension = Environment.createExtension((options: RecursionTerminatorOptions | undefined) => {\n\treturn options\n})\n\nexport interface RecursionTerminatorProps {\n\tfield:\n\t\t| { kind: 'hasOne'; field: SugaredRelativeSingleEntity['field'] }\n\t\t| { kind: 'hasMany'; field: SugaredRelativeEntityList['field'] }\n\tchildren: ReactNode\n}\n\nexport const RecursionTerminator = Component<RecursionTerminatorProps>(({ field, children }, env) => {\n\tconst isRecursion = useMemo(() => {\n\t\treturn recursionDetector(field, env)\n\t}, [field, env])\n\n\treturn !isRecursion ? children : null\n}, ({ field, children }, env) => {\n\tconst isRecursion = recursionDetector(field, env)\n\treturn !isRecursion ? children : null\n})\n\nconst recursionDetector = (field: RecursionTerminatorProps['field'], env: Environment) => {\n\tconst firstPathItem = getFirstPathItem(field)\n\tif (!firstPathItem) {\n\t\treturn false\n\t}\n\tconst shouldTerminate = env.getExtension(recursionTerminatorEnvironmentExtension)?.shouldTerminate\n\tconst shouldTerminateResult = shouldTerminate?.({ node: env.getSubTreeNode(), field: firstPathItem, environment: env })\n\tif (shouldTerminateResult !== undefined) {\n\t\treturn shouldTerminateResult\n\t}\n\n\tconst node = env.getSubTreeNode()\n\tconst otherSide = node.type === 'entity-list' || node.type === 'entity' ? (node.field.ownedBy ?? node.field.inversedBy) : undefined\n\tif (!otherSide) {\n\t\treturn false\n\t}\n\tif (!firstPathItem) {\n\t\treturn false\n\t}\n\treturn otherSide === firstPathItem\n}\n\nconst getFirstPathItem = (field: RecursionTerminatorProps['field']) => {\n\tif (typeof field.field === 'string') {\n\t\treturn field.field.match(TokenRegExps.identifier)?.[0]\n\t}\n\tconst getFromHasOne = (relation: SugarableHasOneRelation[] | SugarableHasOneRelation | undefined) => {\n\t\tif (Array.isArray(relation)) {\n\t\t\treturn relation?.[0].field\n\t\t}\n\t\treturn relation?.field\n\t}\n\tif (field.kind === 'hasMany') {\n\t\treturn getFromHasOne(field.field.hasOneRelationPath) ?? field.field.hasManyRelation.field\n\t}\n\treturn getFromHasOne(field.field)\n}\n"],"names":[],"mappings":";;;AAQO,MAAM,0CAA0C,YAAY,gBAAgB,CAAC,YAAoD;AACvI,SAAO;AACR,CAAC;AASM,MAAM,sBAAsB,UAAoC,CAAC,EAAE,OAAO,SAAA,GAAY,QAAQ;AACpG,QAAM,cAAc,QAAQ,MAAM;AACjC,WAAO,kBAAkB,OAAO,GAAG;AAAA,EACpC,GAAG,CAAC,OAAO,GAAG,CAAC;AAEf,SAAO,CAAC,cAAc,WAAW;AAClC,GAAG,CAAC,EAAE,OAAO,SAAA,GAAY,QAAQ;AAChC,QAAM,cAAc,kBAAkB,OAAO,GAAG;AAChD,SAAO,CAAC,cAAc,WAAW;AAClC,CAAC;AAED,MAAM,oBAAoB,CAAC,OAA0C,QAAqB;AACzF,QAAM,gBAAgB,iBAAiB,KAAK;AAC5C,MAAI,CAAC,eAAe;AACnB,WAAO;AAAA,EACR;AACA,QAAM,kBAAkB,IAAI,aAAa,uCAAuC,GAAG;AACnF,QAAM,wBAAwB,kBAAkB,EAAE,MAAM,IAAI,eAAA,GAAkB,OAAO,eAAe,aAAa,IAAA,CAAK;AACtH,MAAI,0BAA0B,QAAW;AACxC,WAAO;AAAA,EACR;AAEA,QAAM,OAAO,IAAI,eAAA;AACjB,QAAM,YAAY,KAAK,SAAS,iBAAiB,KAAK,SAAS,WAAY,KAAK,MAAM,WAAW,KAAK,MAAM,aAAc;AAC1H,MAAI,CAAC,WAAW;AACf,WAAO;AAAA,EACR;AACA,MAAI,CAAC,eAAe;AACnB,WAAO;AAAA,EACR;AACA,SAAO,cAAc;AACtB;AAEA,MAAM,mBAAmB,CAAC,UAA6C;AACtE,MAAI,OAAO,MAAM,UAAU,UAAU;AACpC,WAAO,MAAM,MAAM,MAAM,aAAa,UAAU,IAAI,CAAC;AAAA,EACtD;AACA,QAAM,gBAAgB,CAAC,aAA8E;AACpG,QAAI,MAAM,QAAQ,QAAQ,GAAG;AAC5B,aAAO,WAAW,CAAC,EAAE;AAAA,IACtB;AACA,WAAO,UAAU;AAAA,EAClB;AACA,MAAI,MAAM,SAAS,WAAW;AAC7B,WAAO,cAAc,MAAM,MAAM,kBAAkB,KAAK,MAAM,MAAM,gBAAgB;AAAA,EACrF;AACA,SAAO,cAAc,MAAM,KAAK;AACjC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RecursionTerminatorPortal.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/RecursionTerminatorPortal.tsx"],"sourcesContent":["import { BindingError, Environment, TreeNodeEnvironmentFactory } from '@contember/binding'\nimport { Component } from '../coreComponents'\nimport { recursionTerminatorEnvironmentExtension, RecursionTerminatorProps } from './RecursionTerminator'\nimport { EnvironmentMiddleware } from '../accessorPropagation'\n\nexport const RecursionTerminatorPortal = Component<RecursionTerminatorProps>(({ field, children }) => {\n\treturn <EnvironmentMiddleware args={[field]} create={createEnvWithExtension}>{children}</EnvironmentMiddleware>\n})\n\nconst createEnvWithExtension = (env: Environment, [{ field, kind }]: [field: RecursionTerminatorProps['field']]) => {\n\tconst envForField = kind === 'hasOne'\n\t\t? TreeNodeEnvironmentFactory.createEnvironmentForEntity(env, { field })\n\t\t: TreeNodeEnvironmentFactory.createEnvironmentForEntityList(env, { field })\n\n\tconst parentNode = envForField.getSubTreeNode()\n\tif (!(parentNode.type === 'entity-list' || parentNode.type === 'entity')) {\n\t\tthrow new BindingError()\n\t}\n\treturn env.withExtension(recursionTerminatorEnvironmentExtension, {\n\t\tshouldTerminate: args => {\n\t\t\tconst currentNode = args.node\n\t\t\tif (currentNode.type !== 'subtree-entity' || currentNode.entity.name !== parentNode.field.targetEntity) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tconst inverseField = parentNode.field.inversedBy ?? parentNode.field.ownedBy\n\t\t\tif (!inverseField) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn args.field === inverseField\n\t\t},\n\t})\n}\n"],"names":["Component","jsx","EnvironmentMiddleware","TreeNodeEnvironmentFactory","BindingError","recursionTerminatorEnvironmentExtension"],"mappings":";;;;;;;AAKO,MAAM,4BAA4BA,UAAAA,UAAoC,CAAC,EAAE,OAAO,eAAe;AAC9F,SAAAC,2BAAA,IAACC,4CAAsB,MAAM,CAAC,KAAK,GAAG,QAAQ,wBAAyB,UAAS;AACxF,CAAC;AAED,MAAM,yBAAyB,CAAC,KAAkB,CAAC,EAAE,OAAO,KAAM,CAAA,MAAkD;AACnH,QAAM,cAAc,SAAS,WAC1BC,QAAA,2BAA2B,2BAA2B,KAAK,EAAE,MAAO,CAAA,IACpEA,QAAAA,2BAA2B,+BAA+B,KAAK,EAAE,OAAO;AAErE,QAAA,aAAa,YAAY,eAAe;AAC9C,MAAI,EAAE,WAAW,SAAS,iBAAiB,WAAW,SAAS,WAAW;AACzE,UAAM,IAAIC,QAAAA,aAAa;AAAA,EAAA;AAEjB,SAAA,IAAI,cAAcC,6DAAyC;AAAA,IACjE,iBAAiB,CAAQ,SAAA;AACxB,YAAM,cAAc,KAAK;AACrB,UAAA,YAAY,SAAS,oBAAoB,YAAY,OAAO,SAAS,WAAW,MAAM,cAAc;AAChG,eAAA;AAAA,MAAA;AAER,YAAM,eAAe,WAAW,MAAM,cAAc,WAAW,MAAM;AACrE,UAAI,CAAC,cAAc;AACX,eAAA;AAAA,MAAA;AAER,aAAO,KAAK,UAAU;AAAA,IAAA;AAAA,EACvB,CACA;AACF;;"}
1
+ {"version":3,"file":"RecursionTerminatorPortal.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/RecursionTerminatorPortal.tsx"],"sourcesContent":["import { BindingError, Environment, TreeNodeEnvironmentFactory } from '@contember/binding'\nimport { Component } from '../coreComponents'\nimport { recursionTerminatorEnvironmentExtension, RecursionTerminatorProps } from './RecursionTerminator'\nimport { EnvironmentMiddleware } from '../accessorPropagation'\n\nexport const RecursionTerminatorPortal = Component<RecursionTerminatorProps>(({ field, children }) => {\n\treturn <EnvironmentMiddleware args={[field]} create={createEnvWithExtension}>{children}</EnvironmentMiddleware>\n})\n\nconst createEnvWithExtension = (env: Environment, [{ field, kind }]: [field: RecursionTerminatorProps['field']]) => {\n\tconst envForField = kind === 'hasOne'\n\t\t? TreeNodeEnvironmentFactory.createEnvironmentForEntity(env, { field })\n\t\t: TreeNodeEnvironmentFactory.createEnvironmentForEntityList(env, { field })\n\n\tconst parentNode = envForField.getSubTreeNode()\n\tif (!(parentNode.type === 'entity-list' || parentNode.type === 'entity')) {\n\t\tthrow new BindingError()\n\t}\n\treturn env.withExtension(recursionTerminatorEnvironmentExtension, {\n\t\tshouldTerminate: args => {\n\t\t\tconst currentNode = args.node\n\t\t\tif (currentNode.type !== 'subtree-entity' || currentNode.entity.name !== parentNode.field.targetEntity) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tconst inverseField = parentNode.field.inversedBy ?? parentNode.field.ownedBy\n\t\t\tif (!inverseField) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn args.field === inverseField\n\t\t},\n\t})\n}\n"],"names":["Component","jsx","EnvironmentMiddleware","TreeNodeEnvironmentFactory","BindingError","recursionTerminatorEnvironmentExtension"],"mappings":";;;;;;;AAKO,MAAM,4BAA4BA,UAAAA,UAAoC,CAAC,EAAE,OAAO,eAAe;AACrG,SAAOC,2BAAAA,IAACC,4CAAsB,MAAM,CAAC,KAAK,GAAG,QAAQ,wBAAyB,UAAS;AACxF,CAAC;AAED,MAAM,yBAAyB,CAAC,KAAkB,CAAC,EAAE,OAAO,KAAA,CAAM,MAAkD;AACnH,QAAM,cAAc,SAAS,WAC1BC,QAAAA,2BAA2B,2BAA2B,KAAK,EAAE,MAAA,CAAO,IACpEA,QAAAA,2BAA2B,+BAA+B,KAAK,EAAE,OAAO;AAE3E,QAAM,aAAa,YAAY,eAAA;AAC/B,MAAI,EAAE,WAAW,SAAS,iBAAiB,WAAW,SAAS,WAAW;AACzE,UAAM,IAAIC,QAAAA,aAAA;AAAA,EACX;AACA,SAAO,IAAI,cAAcC,6DAAyC;AAAA,IACjE,iBAAiB,CAAA,SAAQ;AACxB,YAAM,cAAc,KAAK;AACzB,UAAI,YAAY,SAAS,oBAAoB,YAAY,OAAO,SAAS,WAAW,MAAM,cAAc;AACvG,eAAO;AAAA,MACR;AACA,YAAM,eAAe,WAAW,MAAM,cAAc,WAAW,MAAM;AACrE,UAAI,CAAC,cAAc;AAClB,eAAO;AAAA,MACR;AACA,aAAO,KAAK,UAAU;AAAA,IACvB;AAAA,EAAA,CACA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RecursionTerminatorPortal.js","sources":["../../../../../packages/react-binding/src/helperComponents/RecursionTerminatorPortal.tsx"],"sourcesContent":["import { BindingError, Environment, TreeNodeEnvironmentFactory } from '@contember/binding'\nimport { Component } from '../coreComponents'\nimport { recursionTerminatorEnvironmentExtension, RecursionTerminatorProps } from './RecursionTerminator'\nimport { EnvironmentMiddleware } from '../accessorPropagation'\n\nexport const RecursionTerminatorPortal = Component<RecursionTerminatorProps>(({ field, children }) => {\n\treturn <EnvironmentMiddleware args={[field]} create={createEnvWithExtension}>{children}</EnvironmentMiddleware>\n})\n\nconst createEnvWithExtension = (env: Environment, [{ field, kind }]: [field: RecursionTerminatorProps['field']]) => {\n\tconst envForField = kind === 'hasOne'\n\t\t? TreeNodeEnvironmentFactory.createEnvironmentForEntity(env, { field })\n\t\t: TreeNodeEnvironmentFactory.createEnvironmentForEntityList(env, { field })\n\n\tconst parentNode = envForField.getSubTreeNode()\n\tif (!(parentNode.type === 'entity-list' || parentNode.type === 'entity')) {\n\t\tthrow new BindingError()\n\t}\n\treturn env.withExtension(recursionTerminatorEnvironmentExtension, {\n\t\tshouldTerminate: args => {\n\t\t\tconst currentNode = args.node\n\t\t\tif (currentNode.type !== 'subtree-entity' || currentNode.entity.name !== parentNode.field.targetEntity) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tconst inverseField = parentNode.field.inversedBy ?? parentNode.field.ownedBy\n\t\t\tif (!inverseField) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn args.field === inverseField\n\t\t},\n\t})\n}\n"],"names":[],"mappings":";;;;;AAKO,MAAM,4BAA4B,UAAoC,CAAC,EAAE,OAAO,eAAe;AAC9F,SAAA,oBAAC,yBAAsB,MAAM,CAAC,KAAK,GAAG,QAAQ,wBAAyB,UAAS;AACxF,CAAC;AAED,MAAM,yBAAyB,CAAC,KAAkB,CAAC,EAAE,OAAO,KAAM,CAAA,MAAkD;AACnH,QAAM,cAAc,SAAS,WAC1B,2BAA2B,2BAA2B,KAAK,EAAE,MAAO,CAAA,IACpE,2BAA2B,+BAA+B,KAAK,EAAE,OAAO;AAErE,QAAA,aAAa,YAAY,eAAe;AAC9C,MAAI,EAAE,WAAW,SAAS,iBAAiB,WAAW,SAAS,WAAW;AACzE,UAAM,IAAI,aAAa;AAAA,EAAA;AAEjB,SAAA,IAAI,cAAc,yCAAyC;AAAA,IACjE,iBAAiB,CAAQ,SAAA;AACxB,YAAM,cAAc,KAAK;AACrB,UAAA,YAAY,SAAS,oBAAoB,YAAY,OAAO,SAAS,WAAW,MAAM,cAAc;AAChG,eAAA;AAAA,MAAA;AAER,YAAM,eAAe,WAAW,MAAM,cAAc,WAAW,MAAM;AACrE,UAAI,CAAC,cAAc;AACX,eAAA;AAAA,MAAA;AAER,aAAO,KAAK,UAAU;AAAA,IAAA;AAAA,EACvB,CACA;AACF;"}
1
+ {"version":3,"file":"RecursionTerminatorPortal.js","sources":["../../../../../packages/react-binding/src/helperComponents/RecursionTerminatorPortal.tsx"],"sourcesContent":["import { BindingError, Environment, TreeNodeEnvironmentFactory } from '@contember/binding'\nimport { Component } from '../coreComponents'\nimport { recursionTerminatorEnvironmentExtension, RecursionTerminatorProps } from './RecursionTerminator'\nimport { EnvironmentMiddleware } from '../accessorPropagation'\n\nexport const RecursionTerminatorPortal = Component<RecursionTerminatorProps>(({ field, children }) => {\n\treturn <EnvironmentMiddleware args={[field]} create={createEnvWithExtension}>{children}</EnvironmentMiddleware>\n})\n\nconst createEnvWithExtension = (env: Environment, [{ field, kind }]: [field: RecursionTerminatorProps['field']]) => {\n\tconst envForField = kind === 'hasOne'\n\t\t? TreeNodeEnvironmentFactory.createEnvironmentForEntity(env, { field })\n\t\t: TreeNodeEnvironmentFactory.createEnvironmentForEntityList(env, { field })\n\n\tconst parentNode = envForField.getSubTreeNode()\n\tif (!(parentNode.type === 'entity-list' || parentNode.type === 'entity')) {\n\t\tthrow new BindingError()\n\t}\n\treturn env.withExtension(recursionTerminatorEnvironmentExtension, {\n\t\tshouldTerminate: args => {\n\t\t\tconst currentNode = args.node\n\t\t\tif (currentNode.type !== 'subtree-entity' || currentNode.entity.name !== parentNode.field.targetEntity) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tconst inverseField = parentNode.field.inversedBy ?? parentNode.field.ownedBy\n\t\t\tif (!inverseField) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn args.field === inverseField\n\t\t},\n\t})\n}\n"],"names":[],"mappings":";;;;;AAKO,MAAM,4BAA4B,UAAoC,CAAC,EAAE,OAAO,eAAe;AACrG,SAAO,oBAAC,yBAAsB,MAAM,CAAC,KAAK,GAAG,QAAQ,wBAAyB,UAAS;AACxF,CAAC;AAED,MAAM,yBAAyB,CAAC,KAAkB,CAAC,EAAE,OAAO,KAAA,CAAM,MAAkD;AACnH,QAAM,cAAc,SAAS,WAC1B,2BAA2B,2BAA2B,KAAK,EAAE,MAAA,CAAO,IACpE,2BAA2B,+BAA+B,KAAK,EAAE,OAAO;AAE3E,QAAM,aAAa,YAAY,eAAA;AAC/B,MAAI,EAAE,WAAW,SAAS,iBAAiB,WAAW,SAAS,WAAW;AACzE,UAAM,IAAI,aAAA;AAAA,EACX;AACA,SAAO,IAAI,cAAc,yCAAyC;AAAA,IACjE,iBAAiB,CAAA,SAAQ;AACxB,YAAM,cAAc,KAAK;AACzB,UAAI,YAAY,SAAS,oBAAoB,YAAY,OAAO,SAAS,WAAW,MAAM,cAAc;AACvG,eAAO;AAAA,MACR;AACA,YAAM,eAAe,WAAW,MAAM,cAAc,WAAW,MAAM;AACrE,UAAI,CAAC,cAAc;AAClB,eAAO;AAAA,MACR;AACA,aAAO,KAAK,UAAU;AAAA,IACvB;AAAA,EAAA,CACA;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"StaticRender.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/StaticRender.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Component } from '../coreComponents'\n\nexport interface StaticRenderProps {\n\tchildren?: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const StaticRender = Component<StaticRenderProps>(\n\t() => null,\n\t({ children }) => <>{children}</>,\n\t'StaticRender',\n)\n"],"names":["Component"],"mappings":";;;;AAUO,MAAM,eAAeA,UAAA;AAAA,EAC3B,MAAM;AAAA,EACN,CAAC,EAAE,SAAS,4DAAS,SAAS,CAAA;AAAA,EAC9B;AACD;;"}
1
+ {"version":3,"file":"StaticRender.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/StaticRender.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Component } from '../coreComponents'\n\nexport interface StaticRenderProps {\n\tchildren?: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const StaticRender = Component<StaticRenderProps>(\n\t() => null,\n\t({ children }) => <>{children}</>,\n\t'StaticRender',\n)\n"],"names":["Component"],"mappings":";;;;AAUO,MAAM,eAAeA,UAAAA;AAAAA,EAC3B,MAAM;AAAA,EACN,CAAC,EAAE,SAAA,4DAAkB,SAAA,CAAS;AAAA,EAC9B;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"StaticRender.js","sources":["../../../../../packages/react-binding/src/helperComponents/StaticRender.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Component } from '../coreComponents'\n\nexport interface StaticRenderProps {\n\tchildren?: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const StaticRender = Component<StaticRenderProps>(\n\t() => null,\n\t({ children }) => <>{children}</>,\n\t'StaticRender',\n)\n"],"names":[],"mappings":";;AAUO,MAAM,eAAe;AAAA,EAC3B,MAAM;AAAA,EACN,CAAC,EAAE,SAAS,sCAAS,SAAS,CAAA;AAAA,EAC9B;AACD;"}
1
+ {"version":3,"file":"StaticRender.js","sources":["../../../../../packages/react-binding/src/helperComponents/StaticRender.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Component } from '../coreComponents'\n\nexport interface StaticRenderProps {\n\tchildren?: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const StaticRender = Component<StaticRenderProps>(\n\t() => null,\n\t({ children }) => <>{children}</>,\n\t'StaticRender',\n)\n"],"names":[],"mappings":";;AAUO,MAAM,eAAe;AAAA,EAC3B,MAAM;AAAA,EACN,CAAC,EAAE,SAAA,sCAAkB,SAAA,CAAS;AAAA,EAC9B;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SugaredField.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/SugaredField.tsx"],"sourcesContent":["import { Component, Field, FieldProps } from '../coreComponents'\nimport type { SugaredRelativeSingleField } from '@contember/binding'\nimport { FieldValue } from '@contember/binding'\nimport { ReactElement } from 'react'\n\nexport interface SugaredFieldProps<Persisted extends FieldValue = FieldValue> extends Omit<FieldProps<Persisted>, 'field'> {\n\tfield: string | SugaredRelativeSingleField\n}\n\n/**\n * @group Data binding\n */\nexport const SugaredField = Component(<Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => {\n\tif (typeof props.field === 'string') {\n\t\treturn <Field {...props} field={props.field} />\n\t}\n\treturn <Field {...props} {...props.field} />\n}, 'SugaredField') as <Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => ReactElement\n"],"names":["Component","Field"],"mappings":";;;;;AAYa,MAAA,eAAeA,UAAAA,UAAU,CAA4C,UAAwC;AACrH,MAAA,OAAO,MAAM,UAAU,UAAU;AACpC,0CAAQC,MAAAA,OAAO,EAAA,GAAG,OAAO,OAAO,MAAM,OAAO;AAAA,EAAA;AAE9C,wCAAQA,MAAAA,OAAO,EAAA,GAAG,OAAQ,GAAG,MAAM,OAAO;AAC3C,GAAG,cAAc;;"}
1
+ {"version":3,"file":"SugaredField.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/SugaredField.tsx"],"sourcesContent":["import { Component, Field, FieldProps } from '../coreComponents'\nimport type { SugaredRelativeSingleField } from '@contember/binding'\nimport { FieldValue } from '@contember/binding'\nimport { ReactElement } from 'react'\n\nexport interface SugaredFieldProps<Persisted extends FieldValue = FieldValue> extends Omit<FieldProps<Persisted>, 'field'> {\n\tfield: string | SugaredRelativeSingleField\n}\n\n/**\n * @group Data binding\n */\nexport const SugaredField = Component(<Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => {\n\tif (typeof props.field === 'string') {\n\t\treturn <Field {...props} field={props.field} />\n\t}\n\treturn <Field {...props} {...props.field} />\n}, 'SugaredField') as <Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => ReactElement\n"],"names":["Component","Field"],"mappings":";;;;;AAYO,MAAM,eAAeA,UAAAA,UAAU,CAA4C,UAAwC;AACzH,MAAI,OAAO,MAAM,UAAU,UAAU;AACpC,0CAAQC,MAAAA,OAAA,EAAO,GAAG,OAAO,OAAO,MAAM,OAAO;AAAA,EAC9C;AACA,wCAAQA,MAAAA,OAAA,EAAO,GAAG,OAAQ,GAAG,MAAM,OAAO;AAC3C,GAAG,cAAc;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SugaredField.js","sources":["../../../../../packages/react-binding/src/helperComponents/SugaredField.tsx"],"sourcesContent":["import { Component, Field, FieldProps } from '../coreComponents'\nimport type { SugaredRelativeSingleField } from '@contember/binding'\nimport { FieldValue } from '@contember/binding'\nimport { ReactElement } from 'react'\n\nexport interface SugaredFieldProps<Persisted extends FieldValue = FieldValue> extends Omit<FieldProps<Persisted>, 'field'> {\n\tfield: string | SugaredRelativeSingleField\n}\n\n/**\n * @group Data binding\n */\nexport const SugaredField = Component(<Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => {\n\tif (typeof props.field === 'string') {\n\t\treturn <Field {...props} field={props.field} />\n\t}\n\treturn <Field {...props} {...props.field} />\n}, 'SugaredField') as <Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => ReactElement\n"],"names":[],"mappings":";;;AAYa,MAAA,eAAe,UAAU,CAA4C,UAAwC;AACrH,MAAA,OAAO,MAAM,UAAU,UAAU;AACpC,+BAAQ,OAAO,EAAA,GAAG,OAAO,OAAO,MAAM,OAAO;AAAA,EAAA;AAE9C,6BAAQ,OAAO,EAAA,GAAG,OAAQ,GAAG,MAAM,OAAO;AAC3C,GAAG,cAAc;"}
1
+ {"version":3,"file":"SugaredField.js","sources":["../../../../../packages/react-binding/src/helperComponents/SugaredField.tsx"],"sourcesContent":["import { Component, Field, FieldProps } from '../coreComponents'\nimport type { SugaredRelativeSingleField } from '@contember/binding'\nimport { FieldValue } from '@contember/binding'\nimport { ReactElement } from 'react'\n\nexport interface SugaredFieldProps<Persisted extends FieldValue = FieldValue> extends Omit<FieldProps<Persisted>, 'field'> {\n\tfield: string | SugaredRelativeSingleField\n}\n\n/**\n * @group Data binding\n */\nexport const SugaredField = Component(<Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => {\n\tif (typeof props.field === 'string') {\n\t\treturn <Field {...props} field={props.field} />\n\t}\n\treturn <Field {...props} {...props.field} />\n}, 'SugaredField') as <Persisted extends FieldValue = FieldValue>(props: SugaredFieldProps<Persisted>) => ReactElement\n"],"names":[],"mappings":";;;AAYO,MAAM,eAAe,UAAU,CAA4C,UAAwC;AACzH,MAAI,OAAO,MAAM,UAAU,UAAU;AACpC,+BAAQ,OAAA,EAAO,GAAG,OAAO,OAAO,MAAM,OAAO;AAAA,EAC9C;AACA,6BAAQ,OAAA,EAAO,GAAG,OAAQ,GAAG,MAAM,OAAO;AAC3C,GAAG,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Variable.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/Variable.tsx"],"sourcesContent":["import { Environment } from '@contember/binding'\nimport { memo, ReactElement, ReactNode, useMemo } from 'react'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport interface VariableProps {\n\tname: Environment.Name\n\tformat?: (value: ReactNode) => ReactNode\n}\n\nexport const Variable = memo(({ name, format }: VariableProps): ReactElement => {\n\tconst environment = useEnvironment()\n\tconst value = environment.getVariableOrElse<undefined, ReactNode & Environment.Value>(name, undefined) ?? environment.getParameter(name)\n\n\tconst formatted = useMemo(() => (format ? format(value) : value), [format, value])\n\n\treturn <>{formatted}</>\n})\nVariable.displayName = 'Variable'\n"],"names":["memo","useEnvironment","useMemo"],"mappings":";;;;;AASO,MAAM,WAAWA,MAAAA,KAAK,CAAC,EAAE,MAAM,aAA0C;AAC/E,QAAM,cAAcC,eAAAA,eAAe;AAC7B,QAAA,QAAQ,YAAY,kBAA4D,MAAM,MAAS,KAAK,YAAY,aAAa,IAAI;AAEjI,QAAA,YAAYC,MAAAA,QAAQ,MAAO,SAAS,OAAO,KAAK,IAAI,OAAQ,CAAC,QAAQ,KAAK,CAAC;AAEjF,+DAAU,UAAU,UAAA,CAAA;AACrB,CAAC;AACD,SAAS,cAAc;;"}
1
+ {"version":3,"file":"Variable.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/Variable.tsx"],"sourcesContent":["import { Environment } from '@contember/binding'\nimport { memo, ReactElement, ReactNode, useMemo } from 'react'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport interface VariableProps {\n\tname: Environment.Name\n\tformat?: (value: ReactNode) => ReactNode\n}\n\nexport const Variable = memo(({ name, format }: VariableProps): ReactElement => {\n\tconst environment = useEnvironment()\n\tconst value = environment.getVariableOrElse<undefined, ReactNode & Environment.Value>(name, undefined) ?? environment.getParameter(name)\n\n\tconst formatted = useMemo(() => (format ? format(value) : value), [format, value])\n\n\treturn <>{formatted}</>\n})\nVariable.displayName = 'Variable'\n"],"names":["memo","useEnvironment","useMemo"],"mappings":";;;;;AASO,MAAM,WAAWA,MAAAA,KAAK,CAAC,EAAE,MAAM,aAA0C;AAC/E,QAAM,cAAcC,eAAAA,eAAA;AACpB,QAAM,QAAQ,YAAY,kBAA4D,MAAM,MAAS,KAAK,YAAY,aAAa,IAAI;AAEvI,QAAM,YAAYC,MAAAA,QAAQ,MAAO,SAAS,OAAO,KAAK,IAAI,OAAQ,CAAC,QAAQ,KAAK,CAAC;AAEjF,+DAAU,UAAA,UAAA,CAAU;AACrB,CAAC;AACD,SAAS,cAAc;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Variable.js","sources":["../../../../../packages/react-binding/src/helperComponents/Variable.tsx"],"sourcesContent":["import { Environment } from '@contember/binding'\nimport { memo, ReactElement, ReactNode, useMemo } from 'react'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport interface VariableProps {\n\tname: Environment.Name\n\tformat?: (value: ReactNode) => ReactNode\n}\n\nexport const Variable = memo(({ name, format }: VariableProps): ReactElement => {\n\tconst environment = useEnvironment()\n\tconst value = environment.getVariableOrElse<undefined, ReactNode & Environment.Value>(name, undefined) ?? environment.getParameter(name)\n\n\tconst formatted = useMemo(() => (format ? format(value) : value), [format, value])\n\n\treturn <>{formatted}</>\n})\nVariable.displayName = 'Variable'\n"],"names":[],"mappings":";;;AASO,MAAM,WAAW,KAAK,CAAC,EAAE,MAAM,aAA0C;AAC/E,QAAM,cAAc,eAAe;AAC7B,QAAA,QAAQ,YAAY,kBAA4D,MAAM,MAAS,KAAK,YAAY,aAAa,IAAI;AAEjI,QAAA,YAAY,QAAQ,MAAO,SAAS,OAAO,KAAK,IAAI,OAAQ,CAAC,QAAQ,KAAK,CAAC;AAEjF,yCAAU,UAAU,UAAA,CAAA;AACrB,CAAC;AACD,SAAS,cAAc;"}
1
+ {"version":3,"file":"Variable.js","sources":["../../../../../packages/react-binding/src/helperComponents/Variable.tsx"],"sourcesContent":["import { Environment } from '@contember/binding'\nimport { memo, ReactElement, ReactNode, useMemo } from 'react'\nimport { useEnvironment } from '../accessorPropagation'\n\nexport interface VariableProps {\n\tname: Environment.Name\n\tformat?: (value: ReactNode) => ReactNode\n}\n\nexport const Variable = memo(({ name, format }: VariableProps): ReactElement => {\n\tconst environment = useEnvironment()\n\tconst value = environment.getVariableOrElse<undefined, ReactNode & Environment.Value>(name, undefined) ?? environment.getParameter(name)\n\n\tconst formatted = useMemo(() => (format ? format(value) : value), [format, value])\n\n\treturn <>{formatted}</>\n})\nVariable.displayName = 'Variable'\n"],"names":[],"mappings":";;;AASO,MAAM,WAAW,KAAK,CAAC,EAAE,MAAM,aAA0C;AAC/E,QAAM,cAAc,eAAA;AACpB,QAAM,QAAQ,YAAY,kBAA4D,MAAM,MAAS,KAAK,YAAY,aAAa,IAAI;AAEvI,QAAM,YAAY,QAAQ,MAAO,SAAS,OAAO,KAAK,IAAI,OAAQ,CAAC,QAAQ,KAAK,CAAC;AAEjF,yCAAU,UAAA,UAAA,CAAU;AACrB,CAAC;AACD,SAAS,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterEvaluator.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/FilterEvaluator.ts"],"sourcesContent":["import { Schema } from '@contember/binding'\nimport { Input } from '@contember/client'\nimport { EntityAccessor } from '@contember/binding'\nimport { Filter } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\nimport { evaluateCondition } from './evaluateCondition'\n\n\nexport class FilterEvaluator {\n\tconstructor(\n\t\tprivate readonly schema: Schema,\n\t) {\n\t}\n\n\tevaluateFilter(entity: EntityAccessor, filter: Filter): boolean {\n\t\tconst entitySchema = this.schema.getEntity(entity.name)\n\n\t\tlet acc = true\n\t\tfor (const [key, value] of Object.entries(filter)) {\n\t\t\tif (key === 'and' || key === 'or') {\n\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\n\t\t\t\tconst operation = key === 'and' ? 'every' : 'some' as const\n\t\t\t\tacc &&= value[operation](it => this.evaluateFilter(entity, it))\n\n\t\t\t} else if (key === 'not') {\n\t\t\t\tacc &&= !this.evaluateFilter(entity, value as Filter)\n\n\t\t\t} else {\n\t\t\t\tconst field = entitySchema.fields.get(key)\n\t\t\t\tif (!field) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\n\t\t\t\tif (field.__typename === '_Column') {\n\t\t\t\t\tacc &&= evaluateCondition(entity.getField(key).value, value as Input.Condition)\n\t\t\t\t} else {\n\t\t\t\t\tacc &&= this.evaluateFilter(entity.getEntity(key), value as Filter)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn acc\n\t}\n}\n"],"names":["BindingError","evaluateCondition"],"mappings":";;;;AAQO,MAAM,gBAAgB;AAAA,EAC5B,YACkB,QAChB;AADgB,SAAA,SAAA;AAAA,EAAA;AAAA,EAIlB,eAAe,QAAwB,QAAyB;AAC/D,UAAM,eAAe,KAAK,OAAO,UAAU,OAAO,IAAI;AAEtD,QAAI,MAAM;AACV,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAC9C,UAAA,QAAQ,SAAS,QAAQ,MAAM;AAClC,YAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,gBAAM,IAAIA,QAAAA,aAAa;AAAA,QAAA;AAGlB,cAAA,YAAY,QAAQ,QAAQ,UAAU;AACpC,gBAAA,MAAA,MAAM,SAAS,EAAE,CAAA,OAAM,KAAK,eAAe,QAAQ,EAAE,CAAC;AAAA,MAAA,WAEpD,QAAQ,OAAO;AACzB,gBAAA,MAAQ,CAAC,KAAK,eAAe,QAAQ,KAAe;AAAA,MAAA,OAE9C;AACN,cAAM,QAAQ,aAAa,OAAO,IAAI,GAAG;AACzC,YAAI,CAAC,OAAO;AACX,gBAAM,IAAIA,QAAAA,aAAa;AAAA,QAAA;AAGpB,YAAA,MAAM,eAAe,WAAW;AACnC,kBAAA,MAAQC,kBAAAA,kBAAkB,OAAO,SAAS,GAAG,EAAE,OAAO,KAAwB;AAAA,QAAA,OACxE;AACN,kBAAA,MAAQ,KAAK,eAAe,OAAO,UAAU,GAAG,GAAG,KAAe;AAAA,QAAA;AAAA,MACnE;AAAA,IACD;AAEM,WAAA;AAAA,EAAA;AAET;;"}
1
+ {"version":3,"file":"FilterEvaluator.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/FilterEvaluator.ts"],"sourcesContent":["import { Schema } from '@contember/binding'\nimport { Input } from '@contember/client'\nimport { EntityAccessor } from '@contember/binding'\nimport { Filter } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\nimport { evaluateCondition } from './evaluateCondition'\n\nexport class FilterEvaluator {\n\tconstructor(\n\t\tprivate readonly schema: Schema,\n\t) {\n\t}\n\n\tevaluateFilter(entity: EntityAccessor, filter: Filter): boolean {\n\t\tconst entitySchema = this.schema.getEntity(entity.name)\n\n\t\tlet acc = true\n\t\tfor (const [key, value] of Object.entries(filter)) {\n\t\t\tif (key === 'and' || key === 'or') {\n\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\n\t\t\t\tconst operation = key === 'and' ? 'every' : 'some' as const\n\t\t\t\tacc &&= value[operation](it => this.evaluateFilter(entity, it))\n\t\t\t} else if (key === 'not') {\n\t\t\t\tacc &&= !this.evaluateFilter(entity, value as Filter)\n\t\t\t} else {\n\t\t\t\tconst field = entitySchema.fields.get(key)\n\t\t\t\tif (!field) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\n\t\t\t\tif (field.__typename === '_Column') {\n\t\t\t\t\tacc &&= evaluateCondition(entity.getField(key).value, value as Input.Condition)\n\t\t\t\t} else {\n\t\t\t\t\tacc &&= this.evaluateFilter(entity.getEntity(key), value as Filter)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn acc\n\t}\n}\n"],"names":["BindingError","evaluateCondition"],"mappings":";;;;AAOO,MAAM,gBAAgB;AAAA,EAC5B,YACkB,QAChB;AADgB,SAAA,SAAA;AAAA,EAElB;AAAA,EAEA,eAAe,QAAwB,QAAyB;AAC/D,UAAM,eAAe,KAAK,OAAO,UAAU,OAAO,IAAI;AAEtD,QAAI,MAAM;AACV,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAClD,UAAI,QAAQ,SAAS,QAAQ,MAAM;AAClC,YAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,gBAAM,IAAIA,QAAAA,aAAA;AAAA,QACX;AAEA,cAAM,YAAY,QAAQ,QAAQ,UAAU;AAC5C,gBAAA,MAAQ,MAAM,SAAS,EAAE,CAAA,OAAM,KAAK,eAAe,QAAQ,EAAE,CAAC;AAAA,MAC/D,WAAW,QAAQ,OAAO;AACzB,gBAAA,MAAQ,CAAC,KAAK,eAAe,QAAQ,KAAe;AAAA,MACrD,OAAO;AACN,cAAM,QAAQ,aAAa,OAAO,IAAI,GAAG;AACzC,YAAI,CAAC,OAAO;AACX,gBAAM,IAAIA,QAAAA,aAAA;AAAA,QACX;AAEA,YAAI,MAAM,eAAe,WAAW;AACnC,kBAAA,MAAQC,kBAAAA,kBAAkB,OAAO,SAAS,GAAG,EAAE,OAAO,KAAwB;AAAA,QAC/E,OAAO;AACN,kBAAA,MAAQ,KAAK,eAAe,OAAO,UAAU,GAAG,GAAG,KAAe;AAAA,QACnE;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterEvaluator.js","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/FilterEvaluator.ts"],"sourcesContent":["import { Schema } from '@contember/binding'\nimport { Input } from '@contember/client'\nimport { EntityAccessor } from '@contember/binding'\nimport { Filter } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\nimport { evaluateCondition } from './evaluateCondition'\n\n\nexport class FilterEvaluator {\n\tconstructor(\n\t\tprivate readonly schema: Schema,\n\t) {\n\t}\n\n\tevaluateFilter(entity: EntityAccessor, filter: Filter): boolean {\n\t\tconst entitySchema = this.schema.getEntity(entity.name)\n\n\t\tlet acc = true\n\t\tfor (const [key, value] of Object.entries(filter)) {\n\t\t\tif (key === 'and' || key === 'or') {\n\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\n\t\t\t\tconst operation = key === 'and' ? 'every' : 'some' as const\n\t\t\t\tacc &&= value[operation](it => this.evaluateFilter(entity, it))\n\n\t\t\t} else if (key === 'not') {\n\t\t\t\tacc &&= !this.evaluateFilter(entity, value as Filter)\n\n\t\t\t} else {\n\t\t\t\tconst field = entitySchema.fields.get(key)\n\t\t\t\tif (!field) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\n\t\t\t\tif (field.__typename === '_Column') {\n\t\t\t\t\tacc &&= evaluateCondition(entity.getField(key).value, value as Input.Condition)\n\t\t\t\t} else {\n\t\t\t\t\tacc &&= this.evaluateFilter(entity.getEntity(key), value as Filter)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn acc\n\t}\n}\n"],"names":[],"mappings":";;AAQO,MAAM,gBAAgB;AAAA,EAC5B,YACkB,QAChB;AADgB,SAAA,SAAA;AAAA,EAAA;AAAA,EAIlB,eAAe,QAAwB,QAAyB;AAC/D,UAAM,eAAe,KAAK,OAAO,UAAU,OAAO,IAAI;AAEtD,QAAI,MAAM;AACV,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAC9C,UAAA,QAAQ,SAAS,QAAQ,MAAM;AAClC,YAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,gBAAM,IAAI,aAAa;AAAA,QAAA;AAGlB,cAAA,YAAY,QAAQ,QAAQ,UAAU;AACpC,gBAAA,MAAA,MAAM,SAAS,EAAE,CAAA,OAAM,KAAK,eAAe,QAAQ,EAAE,CAAC;AAAA,MAAA,WAEpD,QAAQ,OAAO;AACzB,gBAAA,MAAQ,CAAC,KAAK,eAAe,QAAQ,KAAe;AAAA,MAAA,OAE9C;AACN,cAAM,QAAQ,aAAa,OAAO,IAAI,GAAG;AACzC,YAAI,CAAC,OAAO;AACX,gBAAM,IAAI,aAAa;AAAA,QAAA;AAGpB,YAAA,MAAM,eAAe,WAAW;AACnC,kBAAA,MAAQ,kBAAkB,OAAO,SAAS,GAAG,EAAE,OAAO,KAAwB;AAAA,QAAA,OACxE;AACN,kBAAA,MAAQ,KAAK,eAAe,OAAO,UAAU,GAAG,GAAG,KAAe;AAAA,QAAA;AAAA,MACnE;AAAA,IACD;AAEM,WAAA;AAAA,EAAA;AAET;"}
1
+ {"version":3,"file":"FilterEvaluator.js","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/FilterEvaluator.ts"],"sourcesContent":["import { Schema } from '@contember/binding'\nimport { Input } from '@contember/client'\nimport { EntityAccessor } from '@contember/binding'\nimport { Filter } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\nimport { evaluateCondition } from './evaluateCondition'\n\nexport class FilterEvaluator {\n\tconstructor(\n\t\tprivate readonly schema: Schema,\n\t) {\n\t}\n\n\tevaluateFilter(entity: EntityAccessor, filter: Filter): boolean {\n\t\tconst entitySchema = this.schema.getEntity(entity.name)\n\n\t\tlet acc = true\n\t\tfor (const [key, value] of Object.entries(filter)) {\n\t\t\tif (key === 'and' || key === 'or') {\n\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\n\t\t\t\tconst operation = key === 'and' ? 'every' : 'some' as const\n\t\t\t\tacc &&= value[operation](it => this.evaluateFilter(entity, it))\n\t\t\t} else if (key === 'not') {\n\t\t\t\tacc &&= !this.evaluateFilter(entity, value as Filter)\n\t\t\t} else {\n\t\t\t\tconst field = entitySchema.fields.get(key)\n\t\t\t\tif (!field) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\n\t\t\t\tif (field.__typename === '_Column') {\n\t\t\t\t\tacc &&= evaluateCondition(entity.getField(key).value, value as Input.Condition)\n\t\t\t\t} else {\n\t\t\t\t\tacc &&= this.evaluateFilter(entity.getEntity(key), value as Filter)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn acc\n\t}\n}\n"],"names":[],"mappings":";;AAOO,MAAM,gBAAgB;AAAA,EAC5B,YACkB,QAChB;AADgB,SAAA,SAAA;AAAA,EAElB;AAAA,EAEA,eAAe,QAAwB,QAAyB;AAC/D,UAAM,eAAe,KAAK,OAAO,UAAU,OAAO,IAAI;AAEtD,QAAI,MAAM;AACV,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAClD,UAAI,QAAQ,SAAS,QAAQ,MAAM;AAClC,YAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,gBAAM,IAAI,aAAA;AAAA,QACX;AAEA,cAAM,YAAY,QAAQ,QAAQ,UAAU;AAC5C,gBAAA,MAAQ,MAAM,SAAS,EAAE,CAAA,OAAM,KAAK,eAAe,QAAQ,EAAE,CAAC;AAAA,MAC/D,WAAW,QAAQ,OAAO;AACzB,gBAAA,MAAQ,CAAC,KAAK,eAAe,QAAQ,KAAe;AAAA,MACrD,OAAO;AACN,cAAM,QAAQ,aAAa,OAAO,IAAI,GAAG;AACzC,YAAI,CAAC,OAAO;AACX,gBAAM,IAAI,aAAA;AAAA,QACX;AAEA,YAAI,MAAM,eAAe,WAAW;AACnC,kBAAA,MAAQ,kBAAkB,OAAO,SAAS,GAAG,EAAE,OAAO,KAAwB;AAAA,QAC/E,OAAO;AACN,kBAAA,MAAQ,KAAK,eAAe,OAAO,UAAU,GAAG,GAAG,KAAe;AAAA,QACnE;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR;AACD;"}
@@ -23,8 +23,10 @@ class FilterFieldsCollector {
23
23
  } else {
24
24
  const field = entity.fields.get(key);
25
25
  if (!field) {
26
- throw new binding.BindingError(`Invalid field: the name "${key}" does not exist on entity "${entity.name}" in a ${path.length === 0 ? "root" : `path "${path.join(".")}"`} of a following filter:
27
- ` + JSON.stringify(this.rootFilter, null, " "));
26
+ throw new binding.BindingError(
27
+ `Invalid field: the name "${key}" does not exist on entity "${entity.name}" in a ${path.length === 0 ? "root" : `path "${path.join(".")}"`} of a following filter:
28
+ ` + JSON.stringify(this.rootFilter, null, " ")
29
+ );
28
30
  }
29
31
  if (field.__typename === "_Column") {
30
32
  result.add([...path, key].join("."));
@@ -1 +1 @@
1
- {"version":3,"file":"FilterFieldsCollector.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/FilterFieldsCollector.ts"],"sourcesContent":["import { Schema, SchemaEntity } from '@contember/binding'\nimport { Filter } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nexport class FilterFieldsCollector {\n\tconstructor(\n\t\tprivate readonly schema: Schema,\n\t\tprivate readonly rootFilter: Filter,\n\t) {\n\t}\n\n\n\tcollectFields(entity: SchemaEntity): Set<string> {\n\t\tconst result = new Set<string>()\n\t\tthis.collectFieldsInternal(this.rootFilter, entity, [], result)\n\t\treturn result\n\t}\n\n\tprivate collectFieldsInternal(filter: Filter, entity: SchemaEntity, path: string[], result: Set<string>): void {\n\t\tfor (const [key, value] of Object.entries(filter)) {\n\t\t\tif (key === 'and' || key === 'or') {\n\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\t\t\t\tvalue?.forEach(it => this.collectFieldsInternal(it, entity, path, result))\n\n\t\t\t} else if (key === 'not') {\n\t\t\t\tthis.collectFieldsInternal(value as Filter, entity, path, result)\n\n\t\t\t} else {\n\t\t\t\tconst field = entity.fields.get(key)\n\t\t\t\tif (!field) {\n\t\t\t\t\tthrow new BindingError(`Invalid field: the name \"${key}\" does not exist on entity \"${entity.name}\" `\n\t\t\t\t\t\t+ `in a ${path.length === 0 ? 'root' : `path \"${path.join('.')}\"`} of a following filter:\\n`\n\t\t\t\t\t\t+ JSON.stringify(this.rootFilter, null, ' '))\n\t\t\t\t}\n\t\t\t\tif (field.__typename === '_Column') {\n\t\t\t\t\tresult.add([...path, key].join('.'))\n\t\t\t\t} else {\n\t\t\t\t\tconst entity = this.schema.getEntity(field.targetEntity)\n\t\t\t\t\tthis.collectFieldsInternal(value as Filter, entity, [...path, key], result)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["BindingError","entity"],"mappings":";;;AAIO,MAAM,sBAAsB;AAAA,EAClC,YACkB,QACA,YAChB;AAFgB,SAAA,SAAA;AACA,SAAA,aAAA;AAAA,EAAA;AAAA,EAKlB,cAAc,QAAmC;AAC1C,UAAA,6BAAa,IAAY;AAC/B,SAAK,sBAAsB,KAAK,YAAY,QAAQ,IAAI,MAAM;AACvD,WAAA;AAAA,EAAA;AAAA,EAGA,sBAAsB,QAAgB,QAAsB,MAAgB,QAA2B;AAC9G,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAC9C,UAAA,QAAQ,SAAS,QAAQ,MAAM;AAClC,YAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,gBAAM,IAAIA,QAAAA,aAAa;AAAA,QAAA;AAEjB,eAAA,QAAQ,QAAM,KAAK,sBAAsB,IAAI,QAAQ,MAAM,MAAM,CAAC;AAAA,MAAA,WAE/D,QAAQ,OAAO;AACzB,aAAK,sBAAsB,OAAiB,QAAQ,MAAM,MAAM;AAAA,MAAA,OAE1D;AACN,cAAM,QAAQ,OAAO,OAAO,IAAI,GAAG;AACnC,YAAI,CAAC,OAAO;AACX,gBAAM,IAAIA,QAAAA,aAAa,4BAA4B,GAAG,+BAA+B,OAAO,IAAI,UACrF,KAAK,WAAW,IAAI,SAAS,SAAS,KAAK,KAAK,GAAG,CAAC,GAAG;AAAA,IAC/D,KAAK,UAAU,KAAK,YAAY,MAAM,IAAI,CAAC;AAAA,QAAA;AAE3C,YAAA,MAAM,eAAe,WAAW;AAC5B,iBAAA,IAAI,CAAC,GAAG,MAAM,GAAG,EAAE,KAAK,GAAG,CAAC;AAAA,QAAA,OAC7B;AACN,gBAAMC,UAAS,KAAK,OAAO,UAAU,MAAM,YAAY;AAClD,eAAA,sBAAsB,OAAiBA,SAAQ,CAAC,GAAG,MAAM,GAAG,GAAG,MAAM;AAAA,QAAA;AAAA,MAC3E;AAAA,IACD;AAAA,EACD;AAEF;;"}
1
+ {"version":3,"file":"FilterFieldsCollector.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/FilterFieldsCollector.ts"],"sourcesContent":["import { Schema, SchemaEntity } from '@contember/binding'\nimport { Filter } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nexport class FilterFieldsCollector {\n\tconstructor(\n\t\tprivate readonly schema: Schema,\n\t\tprivate readonly rootFilter: Filter,\n\t) {\n\t}\n\n\tcollectFields(entity: SchemaEntity): Set<string> {\n\t\tconst result = new Set<string>()\n\t\tthis.collectFieldsInternal(this.rootFilter, entity, [], result)\n\t\treturn result\n\t}\n\n\tprivate collectFieldsInternal(filter: Filter, entity: SchemaEntity, path: string[], result: Set<string>): void {\n\t\tfor (const [key, value] of Object.entries(filter)) {\n\t\t\tif (key === 'and' || key === 'or') {\n\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\t\t\t\tvalue?.forEach(it => this.collectFieldsInternal(it, entity, path, result))\n\t\t\t} else if (key === 'not') {\n\t\t\t\tthis.collectFieldsInternal(value as Filter, entity, path, result)\n\t\t\t} else {\n\t\t\t\tconst field = entity.fields.get(key)\n\t\t\t\tif (!field) {\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`Invalid field: the name \"${key}\" does not exist on entity \"${entity.name}\" `\n\t\t\t\t\t\t\t+ `in a ${path.length === 0 ? 'root' : `path \"${path.join('.')}\"`} of a following filter:\\n`\n\t\t\t\t\t\t\t+ JSON.stringify(this.rootFilter, null, ' '),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tif (field.__typename === '_Column') {\n\t\t\t\t\tresult.add([...path, key].join('.'))\n\t\t\t\t} else {\n\t\t\t\t\tconst entity = this.schema.getEntity(field.targetEntity)\n\t\t\t\t\tthis.collectFieldsInternal(value as Filter, entity, [...path, key], result)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["BindingError","entity"],"mappings":";;;AAIO,MAAM,sBAAsB;AAAA,EAClC,YACkB,QACA,YAChB;AAFgB,SAAA,SAAA;AACA,SAAA,aAAA;AAAA,EAElB;AAAA,EAEA,cAAc,QAAmC;AAChD,UAAM,6BAAa,IAAA;AACnB,SAAK,sBAAsB,KAAK,YAAY,QAAQ,CAAA,GAAI,MAAM;AAC9D,WAAO;AAAA,EACR;AAAA,EAEQ,sBAAsB,QAAgB,QAAsB,MAAgB,QAA2B;AAC9G,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAClD,UAAI,QAAQ,SAAS,QAAQ,MAAM;AAClC,YAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,gBAAM,IAAIA,QAAAA,aAAA;AAAA,QACX;AACA,eAAO,QAAQ,QAAM,KAAK,sBAAsB,IAAI,QAAQ,MAAM,MAAM,CAAC;AAAA,MAC1E,WAAW,QAAQ,OAAO;AACzB,aAAK,sBAAsB,OAAiB,QAAQ,MAAM,MAAM;AAAA,MACjE,OAAO;AACN,cAAM,QAAQ,OAAO,OAAO,IAAI,GAAG;AACnC,YAAI,CAAC,OAAO;AACX,gBAAM,IAAIA,QAAAA;AAAAA,YACT,4BAA4B,GAAG,+BAA+B,OAAO,IAAI,UAC9D,KAAK,WAAW,IAAI,SAAS,SAAS,KAAK,KAAK,GAAG,CAAC,GAAG;AAAA,IAC/D,KAAK,UAAU,KAAK,YAAY,MAAM,IAAI;AAAA,UAAA;AAAA,QAE/C;AACA,YAAI,MAAM,eAAe,WAAW;AACnC,iBAAO,IAAI,CAAC,GAAG,MAAM,GAAG,EAAE,KAAK,GAAG,CAAC;AAAA,QACpC,OAAO;AACN,gBAAMC,UAAS,KAAK,OAAO,UAAU,MAAM,YAAY;AACvD,eAAK,sBAAsB,OAAiBA,SAAQ,CAAC,GAAG,MAAM,GAAG,GAAG,MAAM;AAAA,QAC3E;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;;"}
@@ -21,8 +21,10 @@ class FilterFieldsCollector {
21
21
  } else {
22
22
  const field = entity.fields.get(key);
23
23
  if (!field) {
24
- throw new BindingError(`Invalid field: the name "${key}" does not exist on entity "${entity.name}" in a ${path.length === 0 ? "root" : `path "${path.join(".")}"`} of a following filter:
25
- ` + JSON.stringify(this.rootFilter, null, " "));
24
+ throw new BindingError(
25
+ `Invalid field: the name "${key}" does not exist on entity "${entity.name}" in a ${path.length === 0 ? "root" : `path "${path.join(".")}"`} of a following filter:
26
+ ` + JSON.stringify(this.rootFilter, null, " ")
27
+ );
26
28
  }
27
29
  if (field.__typename === "_Column") {
28
30
  result.add([...path, key].join("."));
@@ -1 +1 @@
1
- {"version":3,"file":"FilterFieldsCollector.js","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/FilterFieldsCollector.ts"],"sourcesContent":["import { Schema, SchemaEntity } from '@contember/binding'\nimport { Filter } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nexport class FilterFieldsCollector {\n\tconstructor(\n\t\tprivate readonly schema: Schema,\n\t\tprivate readonly rootFilter: Filter,\n\t) {\n\t}\n\n\n\tcollectFields(entity: SchemaEntity): Set<string> {\n\t\tconst result = new Set<string>()\n\t\tthis.collectFieldsInternal(this.rootFilter, entity, [], result)\n\t\treturn result\n\t}\n\n\tprivate collectFieldsInternal(filter: Filter, entity: SchemaEntity, path: string[], result: Set<string>): void {\n\t\tfor (const [key, value] of Object.entries(filter)) {\n\t\t\tif (key === 'and' || key === 'or') {\n\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\t\t\t\tvalue?.forEach(it => this.collectFieldsInternal(it, entity, path, result))\n\n\t\t\t} else if (key === 'not') {\n\t\t\t\tthis.collectFieldsInternal(value as Filter, entity, path, result)\n\n\t\t\t} else {\n\t\t\t\tconst field = entity.fields.get(key)\n\t\t\t\tif (!field) {\n\t\t\t\t\tthrow new BindingError(`Invalid field: the name \"${key}\" does not exist on entity \"${entity.name}\" `\n\t\t\t\t\t\t+ `in a ${path.length === 0 ? 'root' : `path \"${path.join('.')}\"`} of a following filter:\\n`\n\t\t\t\t\t\t+ JSON.stringify(this.rootFilter, null, ' '))\n\t\t\t\t}\n\t\t\t\tif (field.__typename === '_Column') {\n\t\t\t\t\tresult.add([...path, key].join('.'))\n\t\t\t\t} else {\n\t\t\t\t\tconst entity = this.schema.getEntity(field.targetEntity)\n\t\t\t\t\tthis.collectFieldsInternal(value as Filter, entity, [...path, key], result)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["entity"],"mappings":";AAIO,MAAM,sBAAsB;AAAA,EAClC,YACkB,QACA,YAChB;AAFgB,SAAA,SAAA;AACA,SAAA,aAAA;AAAA,EAAA;AAAA,EAKlB,cAAc,QAAmC;AAC1C,UAAA,6BAAa,IAAY;AAC/B,SAAK,sBAAsB,KAAK,YAAY,QAAQ,IAAI,MAAM;AACvD,WAAA;AAAA,EAAA;AAAA,EAGA,sBAAsB,QAAgB,QAAsB,MAAgB,QAA2B;AAC9G,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAC9C,UAAA,QAAQ,SAAS,QAAQ,MAAM;AAClC,YAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,gBAAM,IAAI,aAAa;AAAA,QAAA;AAEjB,eAAA,QAAQ,QAAM,KAAK,sBAAsB,IAAI,QAAQ,MAAM,MAAM,CAAC;AAAA,MAAA,WAE/D,QAAQ,OAAO;AACzB,aAAK,sBAAsB,OAAiB,QAAQ,MAAM,MAAM;AAAA,MAAA,OAE1D;AACN,cAAM,QAAQ,OAAO,OAAO,IAAI,GAAG;AACnC,YAAI,CAAC,OAAO;AACX,gBAAM,IAAI,aAAa,4BAA4B,GAAG,+BAA+B,OAAO,IAAI,UACrF,KAAK,WAAW,IAAI,SAAS,SAAS,KAAK,KAAK,GAAG,CAAC,GAAG;AAAA,IAC/D,KAAK,UAAU,KAAK,YAAY,MAAM,IAAI,CAAC;AAAA,QAAA;AAE3C,YAAA,MAAM,eAAe,WAAW;AAC5B,iBAAA,IAAI,CAAC,GAAG,MAAM,GAAG,EAAE,KAAK,GAAG,CAAC;AAAA,QAAA,OAC7B;AACN,gBAAMA,UAAS,KAAK,OAAO,UAAU,MAAM,YAAY;AAClD,eAAA,sBAAsB,OAAiBA,SAAQ,CAAC,GAAG,MAAM,GAAG,GAAG,MAAM;AAAA,QAAA;AAAA,MAC3E;AAAA,IACD;AAAA,EACD;AAEF;"}
1
+ {"version":3,"file":"FilterFieldsCollector.js","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/FilterFieldsCollector.ts"],"sourcesContent":["import { Schema, SchemaEntity } from '@contember/binding'\nimport { Filter } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nexport class FilterFieldsCollector {\n\tconstructor(\n\t\tprivate readonly schema: Schema,\n\t\tprivate readonly rootFilter: Filter,\n\t) {\n\t}\n\n\tcollectFields(entity: SchemaEntity): Set<string> {\n\t\tconst result = new Set<string>()\n\t\tthis.collectFieldsInternal(this.rootFilter, entity, [], result)\n\t\treturn result\n\t}\n\n\tprivate collectFieldsInternal(filter: Filter, entity: SchemaEntity, path: string[], result: Set<string>): void {\n\t\tfor (const [key, value] of Object.entries(filter)) {\n\t\t\tif (key === 'and' || key === 'or') {\n\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\t\t\t\tvalue?.forEach(it => this.collectFieldsInternal(it, entity, path, result))\n\t\t\t} else if (key === 'not') {\n\t\t\t\tthis.collectFieldsInternal(value as Filter, entity, path, result)\n\t\t\t} else {\n\t\t\t\tconst field = entity.fields.get(key)\n\t\t\t\tif (!field) {\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`Invalid field: the name \"${key}\" does not exist on entity \"${entity.name}\" `\n\t\t\t\t\t\t\t+ `in a ${path.length === 0 ? 'root' : `path \"${path.join('.')}\"`} of a following filter:\\n`\n\t\t\t\t\t\t\t+ JSON.stringify(this.rootFilter, null, ' '),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tif (field.__typename === '_Column') {\n\t\t\t\t\tresult.add([...path, key].join('.'))\n\t\t\t\t} else {\n\t\t\t\t\tconst entity = this.schema.getEntity(field.targetEntity)\n\t\t\t\t\tthis.collectFieldsInternal(value as Filter, entity, [...path, key], result)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["entity"],"mappings":";AAIO,MAAM,sBAAsB;AAAA,EAClC,YACkB,QACA,YAChB;AAFgB,SAAA,SAAA;AACA,SAAA,aAAA;AAAA,EAElB;AAAA,EAEA,cAAc,QAAmC;AAChD,UAAM,6BAAa,IAAA;AACnB,SAAK,sBAAsB,KAAK,YAAY,QAAQ,CAAA,GAAI,MAAM;AAC9D,WAAO;AAAA,EACR;AAAA,EAEQ,sBAAsB,QAAgB,QAAsB,MAAgB,QAA2B;AAC9G,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAClD,UAAI,QAAQ,SAAS,QAAQ,MAAM;AAClC,YAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,gBAAM,IAAI,aAAA;AAAA,QACX;AACA,eAAO,QAAQ,QAAM,KAAK,sBAAsB,IAAI,QAAQ,MAAM,MAAM,CAAC;AAAA,MAC1E,WAAW,QAAQ,OAAO;AACzB,aAAK,sBAAsB,OAAiB,QAAQ,MAAM,MAAM;AAAA,MACjE,OAAO;AACN,cAAM,QAAQ,OAAO,OAAO,IAAI,GAAG;AACnC,YAAI,CAAC,OAAO;AACX,gBAAM,IAAI;AAAA,YACT,4BAA4B,GAAG,+BAA+B,OAAO,IAAI,UAC9D,KAAK,WAAW,IAAI,SAAS,SAAS,KAAK,KAAK,GAAG,CAAC,GAAG;AAAA,IAC/D,KAAK,UAAU,KAAK,YAAY,MAAM,IAAI;AAAA,UAAA;AAAA,QAE/C;AACA,YAAI,MAAM,eAAe,WAAW;AACnC,iBAAO,IAAI,CAAC,GAAG,MAAM,GAAG,EAAE,KAAK,GAAG,CAAC;AAAA,QACpC,OAAO;AACN,gBAAMA,UAAS,KAAK,OAAO,UAAU,MAAM,YAAY;AACvD,eAAK,sBAAsB,OAAiBA,SAAQ,CAAC,GAAG,MAAM,GAAG,GAAG,MAAM;AAAA,QAC3E;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"evaluateCondition.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/evaluateCondition.ts"],"sourcesContent":["import { Input } from '@contember/client'\nimport { FieldValue } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nexport const evaluateCondition = (value: FieldValue | null, condition: Input.Condition<Input.ColumnValue>) => {\n\tconst handlers: {\n\t\t[K in keyof Required<Input.Condition<any>>]: (\n\t\t\tparam: Exclude<Input.Condition<any>[K], undefined>,\n\t\t) => boolean\n\t} = {\n\t\tand: expr => expr.every(it => evaluateCondition(value, it)),\n\t\tor: expr => expr.some(it => evaluateCondition(value, it)),\n\t\tnot: expr => !evaluateCondition(value, expr),\n\t\teq: expr => value === expr,\n\t\tnotEq: expr => value !== expr,\n\t\tisNull: expr => (value === null) === expr,\n\t\tin: expr => expr.includes(value),\n\t\tnotIn: expr => !expr.includes(value),\n\t\tlt: expr => value !== null && value < expr,\n\t\tlte: expr => value !== null && value <= expr,\n\t\tgt: expr => value !== null && value > expr,\n\t\tgte: expr => value !== null && value >= expr,\n\t\tincludes: expr => Array.isArray(value) && value.includes(expr),\n\t\tmaxLength: expr => Array.isArray(value) && value.length <= expr,\n\t\tminLength: expr => Array.isArray(value) && value.length >= expr,\n\t\tcontains: expr => typeof value === 'string' && value.includes(expr),\n\t\tstartsWith: expr => typeof value === 'string' && value.startsWith(expr),\n\t\tendsWith: expr => typeof value === 'string' && value.endsWith(expr),\n\t\tcontainsCI: expr => typeof value === 'string' && value.toLowerCase().includes(expr.toLowerCase()),\n\t\tstartsWithCI: expr => typeof value === 'string' && value.toLowerCase().startsWith(expr.toLowerCase()),\n\t\tendsWithCI: expr => typeof value === 'string' && value.toLowerCase().endsWith(expr.toLowerCase()),\n\t\tnever: () => false,\n\t\talways: () => true,\n\t\t// deprecated\n\t\tnull: expr => (value === null) === expr,\n\t}\n\treturn Object.entries(condition).every(([operator, argument]) => {\n\t\tif (value === undefined) {\n\t\t\treturn true\n\t\t}\n\t\tconst handlerKey = operator as keyof typeof handlers\n\t\tconst handler = handlers[handlerKey]\n\t\tif (!handler) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn (handler as any)(argument)\n\t})\n}\n"],"names":["BindingError"],"mappings":";;;AAIa,MAAA,oBAAoB,CAAC,OAA0B,cAAkD;AAC7G,QAAM,WAIF;AAAA,IACH,KAAK,UAAQ,KAAK,MAAM,QAAM,kBAAkB,OAAO,EAAE,CAAC;AAAA,IAC1D,IAAI,UAAQ,KAAK,KAAK,QAAM,kBAAkB,OAAO,EAAE,CAAC;AAAA,IACxD,KAAK,CAAA,SAAQ,CAAC,kBAAkB,OAAO,IAAI;AAAA,IAC3C,IAAI,UAAQ,UAAU;AAAA,IACtB,OAAO,UAAQ,UAAU;AAAA,IACzB,QAAQ,CAAS,SAAA,UAAU,SAAU;AAAA,IACrC,IAAI,CAAA,SAAQ,KAAK,SAAS,KAAK;AAAA,IAC/B,OAAO,CAAA,SAAQ,CAAC,KAAK,SAAS,KAAK;AAAA,IACnC,IAAI,CAAA,SAAQ,UAAU,QAAQ,QAAQ;AAAA,IACtC,KAAK,CAAA,SAAQ,UAAU,QAAQ,SAAS;AAAA,IACxC,IAAI,CAAA,SAAQ,UAAU,QAAQ,QAAQ;AAAA,IACtC,KAAK,CAAA,SAAQ,UAAU,QAAQ,SAAS;AAAA,IACxC,UAAU,UAAQ,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,IAAI;AAAA,IAC7D,WAAW,CAAQ,SAAA,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU;AAAA,IAC3D,WAAW,CAAQ,SAAA,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU;AAAA,IAC3D,UAAU,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI;AAAA,IAClE,YAAY,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,WAAW,IAAI;AAAA,IACtE,UAAU,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI;AAAA,IAClE,YAAY,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,cAAc,SAAS,KAAK,YAAA,CAAa;AAAA,IAChG,cAAc,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,cAAc,WAAW,KAAK,YAAA,CAAa;AAAA,IACpG,YAAY,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,cAAc,SAAS,KAAK,YAAA,CAAa;AAAA,IAChG,OAAO,MAAM;AAAA,IACb,QAAQ,MAAM;AAAA;AAAA,IAEd,MAAM,CAAS,SAAA,UAAU,SAAU;AAAA,EACpC;AACO,SAAA,OAAO,QAAQ,SAAS,EAAE,MAAM,CAAC,CAAC,UAAU,QAAQ,MAAM;AAChE,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IAAA;AAER,UAAM,aAAa;AACb,UAAA,UAAU,SAAS,UAAU;AACnC,QAAI,CAAC,SAAS;AACb,YAAM,IAAIA,QAAAA,aAAa;AAAA,IAAA;AAExB,WAAQ,QAAgB,QAAQ;AAAA,EAAA,CAChC;AACF;;"}
1
+ {"version":3,"file":"evaluateCondition.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/evaluateCondition.ts"],"sourcesContent":["import { Input } from '@contember/client'\nimport { FieldValue } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nexport const evaluateCondition = (value: FieldValue | null, condition: Input.Condition<Input.ColumnValue>) => {\n\tconst handlers: {\n\t\t[K in keyof Required<Input.Condition<any>>]: (\n\t\t\tparam: Exclude<Input.Condition<any>[K], undefined>,\n\t\t) => boolean\n\t} = {\n\t\tand: expr => expr.every(it => evaluateCondition(value, it)),\n\t\tor: expr => expr.some(it => evaluateCondition(value, it)),\n\t\tnot: expr => !evaluateCondition(value, expr),\n\t\teq: expr => value === expr,\n\t\tnotEq: expr => value !== expr,\n\t\tisNull: expr => (value === null) === expr,\n\t\tin: expr => expr.includes(value),\n\t\tnotIn: expr => !expr.includes(value),\n\t\tlt: expr => value !== null && value < expr,\n\t\tlte: expr => value !== null && value <= expr,\n\t\tgt: expr => value !== null && value > expr,\n\t\tgte: expr => value !== null && value >= expr,\n\t\tincludes: (expr: any) => Array.isArray(value) && value.includes(expr),\n\t\tmaxLength: expr => Array.isArray(value) && value.length <= expr,\n\t\tminLength: expr => Array.isArray(value) && value.length >= expr,\n\t\tcontains: expr => typeof value === 'string' && value.includes(expr),\n\t\tstartsWith: expr => typeof value === 'string' && value.startsWith(expr),\n\t\tendsWith: expr => typeof value === 'string' && value.endsWith(expr),\n\t\tcontainsCI: expr => typeof value === 'string' && value.toLowerCase().includes(expr.toLowerCase()),\n\t\tstartsWithCI: expr => typeof value === 'string' && value.toLowerCase().startsWith(expr.toLowerCase()),\n\t\tendsWithCI: expr => typeof value === 'string' && value.toLowerCase().endsWith(expr.toLowerCase()),\n\t\tnever: () => false,\n\t\talways: () => true,\n\t\t// deprecated\n\t\tnull: expr => (value === null) === expr,\n\t}\n\treturn Object.entries(condition).every(([operator, argument]) => {\n\t\tif (value === undefined) {\n\t\t\treturn true\n\t\t}\n\t\tconst handlerKey = operator as keyof typeof handlers\n\t\tconst handler = handlers[handlerKey]\n\t\tif (!handler) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn (handler as any)(argument)\n\t})\n}\n"],"names":["BindingError"],"mappings":";;;AAIO,MAAM,oBAAoB,CAAC,OAA0B,cAAkD;AAC7G,QAAM,WAIF;AAAA,IACH,KAAK,UAAQ,KAAK,MAAM,QAAM,kBAAkB,OAAO,EAAE,CAAC;AAAA,IAC1D,IAAI,UAAQ,KAAK,KAAK,QAAM,kBAAkB,OAAO,EAAE,CAAC;AAAA,IACxD,KAAK,CAAA,SAAQ,CAAC,kBAAkB,OAAO,IAAI;AAAA,IAC3C,IAAI,UAAQ,UAAU;AAAA,IACtB,OAAO,UAAQ,UAAU;AAAA,IACzB,QAAQ,CAAA,SAAS,UAAU,SAAU;AAAA,IACrC,IAAI,CAAA,SAAQ,KAAK,SAAS,KAAK;AAAA,IAC/B,OAAO,CAAA,SAAQ,CAAC,KAAK,SAAS,KAAK;AAAA,IACnC,IAAI,CAAA,SAAQ,UAAU,QAAQ,QAAQ;AAAA,IACtC,KAAK,CAAA,SAAQ,UAAU,QAAQ,SAAS;AAAA,IACxC,IAAI,CAAA,SAAQ,UAAU,QAAQ,QAAQ;AAAA,IACtC,KAAK,CAAA,SAAQ,UAAU,QAAQ,SAAS;AAAA,IACxC,UAAU,CAAC,SAAc,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,IAAI;AAAA,IACpE,WAAW,CAAA,SAAQ,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU;AAAA,IAC3D,WAAW,CAAA,SAAQ,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU;AAAA,IAC3D,UAAU,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI;AAAA,IAClE,YAAY,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,WAAW,IAAI;AAAA,IACtE,UAAU,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI;AAAA,IAClE,YAAY,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,cAAc,SAAS,KAAK,YAAA,CAAa;AAAA,IAChG,cAAc,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,cAAc,WAAW,KAAK,YAAA,CAAa;AAAA,IACpG,YAAY,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,cAAc,SAAS,KAAK,YAAA,CAAa;AAAA,IAChG,OAAO,MAAM;AAAA,IACb,QAAQ,MAAM;AAAA;AAAA,IAEd,MAAM,CAAA,SAAS,UAAU,SAAU;AAAA,EAAA;AAEpC,SAAO,OAAO,QAAQ,SAAS,EAAE,MAAM,CAAC,CAAC,UAAU,QAAQ,MAAM;AAChE,QAAI,UAAU,QAAW;AACxB,aAAO;AAAA,IACR;AACA,UAAM,aAAa;AACnB,UAAM,UAAU,SAAS,UAAU;AACnC,QAAI,CAAC,SAAS;AACb,YAAM,IAAIA,QAAAA,aAAA;AAAA,IACX;AACA,WAAQ,QAAgB,QAAQ;AAAA,EACjC,CAAC;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"evaluateCondition.js","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/evaluateCondition.ts"],"sourcesContent":["import { Input } from '@contember/client'\nimport { FieldValue } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nexport const evaluateCondition = (value: FieldValue | null, condition: Input.Condition<Input.ColumnValue>) => {\n\tconst handlers: {\n\t\t[K in keyof Required<Input.Condition<any>>]: (\n\t\t\tparam: Exclude<Input.Condition<any>[K], undefined>,\n\t\t) => boolean\n\t} = {\n\t\tand: expr => expr.every(it => evaluateCondition(value, it)),\n\t\tor: expr => expr.some(it => evaluateCondition(value, it)),\n\t\tnot: expr => !evaluateCondition(value, expr),\n\t\teq: expr => value === expr,\n\t\tnotEq: expr => value !== expr,\n\t\tisNull: expr => (value === null) === expr,\n\t\tin: expr => expr.includes(value),\n\t\tnotIn: expr => !expr.includes(value),\n\t\tlt: expr => value !== null && value < expr,\n\t\tlte: expr => value !== null && value <= expr,\n\t\tgt: expr => value !== null && value > expr,\n\t\tgte: expr => value !== null && value >= expr,\n\t\tincludes: expr => Array.isArray(value) && value.includes(expr),\n\t\tmaxLength: expr => Array.isArray(value) && value.length <= expr,\n\t\tminLength: expr => Array.isArray(value) && value.length >= expr,\n\t\tcontains: expr => typeof value === 'string' && value.includes(expr),\n\t\tstartsWith: expr => typeof value === 'string' && value.startsWith(expr),\n\t\tendsWith: expr => typeof value === 'string' && value.endsWith(expr),\n\t\tcontainsCI: expr => typeof value === 'string' && value.toLowerCase().includes(expr.toLowerCase()),\n\t\tstartsWithCI: expr => typeof value === 'string' && value.toLowerCase().startsWith(expr.toLowerCase()),\n\t\tendsWithCI: expr => typeof value === 'string' && value.toLowerCase().endsWith(expr.toLowerCase()),\n\t\tnever: () => false,\n\t\talways: () => true,\n\t\t// deprecated\n\t\tnull: expr => (value === null) === expr,\n\t}\n\treturn Object.entries(condition).every(([operator, argument]) => {\n\t\tif (value === undefined) {\n\t\t\treturn true\n\t\t}\n\t\tconst handlerKey = operator as keyof typeof handlers\n\t\tconst handler = handlers[handlerKey]\n\t\tif (!handler) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn (handler as any)(argument)\n\t})\n}\n"],"names":[],"mappings":";AAIa,MAAA,oBAAoB,CAAC,OAA0B,cAAkD;AAC7G,QAAM,WAIF;AAAA,IACH,KAAK,UAAQ,KAAK,MAAM,QAAM,kBAAkB,OAAO,EAAE,CAAC;AAAA,IAC1D,IAAI,UAAQ,KAAK,KAAK,QAAM,kBAAkB,OAAO,EAAE,CAAC;AAAA,IACxD,KAAK,CAAA,SAAQ,CAAC,kBAAkB,OAAO,IAAI;AAAA,IAC3C,IAAI,UAAQ,UAAU;AAAA,IACtB,OAAO,UAAQ,UAAU;AAAA,IACzB,QAAQ,CAAS,SAAA,UAAU,SAAU;AAAA,IACrC,IAAI,CAAA,SAAQ,KAAK,SAAS,KAAK;AAAA,IAC/B,OAAO,CAAA,SAAQ,CAAC,KAAK,SAAS,KAAK;AAAA,IACnC,IAAI,CAAA,SAAQ,UAAU,QAAQ,QAAQ;AAAA,IACtC,KAAK,CAAA,SAAQ,UAAU,QAAQ,SAAS;AAAA,IACxC,IAAI,CAAA,SAAQ,UAAU,QAAQ,QAAQ;AAAA,IACtC,KAAK,CAAA,SAAQ,UAAU,QAAQ,SAAS;AAAA,IACxC,UAAU,UAAQ,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,IAAI;AAAA,IAC7D,WAAW,CAAQ,SAAA,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU;AAAA,IAC3D,WAAW,CAAQ,SAAA,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU;AAAA,IAC3D,UAAU,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI;AAAA,IAClE,YAAY,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,WAAW,IAAI;AAAA,IACtE,UAAU,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI;AAAA,IAClE,YAAY,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,cAAc,SAAS,KAAK,YAAA,CAAa;AAAA,IAChG,cAAc,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,cAAc,WAAW,KAAK,YAAA,CAAa;AAAA,IACpG,YAAY,CAAQ,SAAA,OAAO,UAAU,YAAY,MAAM,cAAc,SAAS,KAAK,YAAA,CAAa;AAAA,IAChG,OAAO,MAAM;AAAA,IACb,QAAQ,MAAM;AAAA;AAAA,IAEd,MAAM,CAAS,SAAA,UAAU,SAAU;AAAA,EACpC;AACO,SAAA,OAAO,QAAQ,SAAS,EAAE,MAAM,CAAC,CAAC,UAAU,QAAQ,MAAM;AAChE,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IAAA;AAER,UAAM,aAAa;AACb,UAAA,UAAU,SAAS,UAAU;AACnC,QAAI,CAAC,SAAS;AACb,YAAM,IAAI,aAAa;AAAA,IAAA;AAExB,WAAQ,QAAgB,QAAQ;AAAA,EAAA,CAChC;AACF;"}
1
+ {"version":3,"file":"evaluateCondition.js","sources":["../../../../../../packages/react-binding/src/helperComponents/helpers/evaluateCondition.ts"],"sourcesContent":["import { Input } from '@contember/client'\nimport { FieldValue } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nexport const evaluateCondition = (value: FieldValue | null, condition: Input.Condition<Input.ColumnValue>) => {\n\tconst handlers: {\n\t\t[K in keyof Required<Input.Condition<any>>]: (\n\t\t\tparam: Exclude<Input.Condition<any>[K], undefined>,\n\t\t) => boolean\n\t} = {\n\t\tand: expr => expr.every(it => evaluateCondition(value, it)),\n\t\tor: expr => expr.some(it => evaluateCondition(value, it)),\n\t\tnot: expr => !evaluateCondition(value, expr),\n\t\teq: expr => value === expr,\n\t\tnotEq: expr => value !== expr,\n\t\tisNull: expr => (value === null) === expr,\n\t\tin: expr => expr.includes(value),\n\t\tnotIn: expr => !expr.includes(value),\n\t\tlt: expr => value !== null && value < expr,\n\t\tlte: expr => value !== null && value <= expr,\n\t\tgt: expr => value !== null && value > expr,\n\t\tgte: expr => value !== null && value >= expr,\n\t\tincludes: (expr: any) => Array.isArray(value) && value.includes(expr),\n\t\tmaxLength: expr => Array.isArray(value) && value.length <= expr,\n\t\tminLength: expr => Array.isArray(value) && value.length >= expr,\n\t\tcontains: expr => typeof value === 'string' && value.includes(expr),\n\t\tstartsWith: expr => typeof value === 'string' && value.startsWith(expr),\n\t\tendsWith: expr => typeof value === 'string' && value.endsWith(expr),\n\t\tcontainsCI: expr => typeof value === 'string' && value.toLowerCase().includes(expr.toLowerCase()),\n\t\tstartsWithCI: expr => typeof value === 'string' && value.toLowerCase().startsWith(expr.toLowerCase()),\n\t\tendsWithCI: expr => typeof value === 'string' && value.toLowerCase().endsWith(expr.toLowerCase()),\n\t\tnever: () => false,\n\t\talways: () => true,\n\t\t// deprecated\n\t\tnull: expr => (value === null) === expr,\n\t}\n\treturn Object.entries(condition).every(([operator, argument]) => {\n\t\tif (value === undefined) {\n\t\t\treturn true\n\t\t}\n\t\tconst handlerKey = operator as keyof typeof handlers\n\t\tconst handler = handlers[handlerKey]\n\t\tif (!handler) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn (handler as any)(argument)\n\t})\n}\n"],"names":[],"mappings":";AAIO,MAAM,oBAAoB,CAAC,OAA0B,cAAkD;AAC7G,QAAM,WAIF;AAAA,IACH,KAAK,UAAQ,KAAK,MAAM,QAAM,kBAAkB,OAAO,EAAE,CAAC;AAAA,IAC1D,IAAI,UAAQ,KAAK,KAAK,QAAM,kBAAkB,OAAO,EAAE,CAAC;AAAA,IACxD,KAAK,CAAA,SAAQ,CAAC,kBAAkB,OAAO,IAAI;AAAA,IAC3C,IAAI,UAAQ,UAAU;AAAA,IACtB,OAAO,UAAQ,UAAU;AAAA,IACzB,QAAQ,CAAA,SAAS,UAAU,SAAU;AAAA,IACrC,IAAI,CAAA,SAAQ,KAAK,SAAS,KAAK;AAAA,IAC/B,OAAO,CAAA,SAAQ,CAAC,KAAK,SAAS,KAAK;AAAA,IACnC,IAAI,CAAA,SAAQ,UAAU,QAAQ,QAAQ;AAAA,IACtC,KAAK,CAAA,SAAQ,UAAU,QAAQ,SAAS;AAAA,IACxC,IAAI,CAAA,SAAQ,UAAU,QAAQ,QAAQ;AAAA,IACtC,KAAK,CAAA,SAAQ,UAAU,QAAQ,SAAS;AAAA,IACxC,UAAU,CAAC,SAAc,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,IAAI;AAAA,IACpE,WAAW,CAAA,SAAQ,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU;AAAA,IAC3D,WAAW,CAAA,SAAQ,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU;AAAA,IAC3D,UAAU,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI;AAAA,IAClE,YAAY,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,WAAW,IAAI;AAAA,IACtE,UAAU,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI;AAAA,IAClE,YAAY,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,cAAc,SAAS,KAAK,YAAA,CAAa;AAAA,IAChG,cAAc,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,cAAc,WAAW,KAAK,YAAA,CAAa;AAAA,IACpG,YAAY,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,cAAc,SAAS,KAAK,YAAA,CAAa;AAAA,IAChG,OAAO,MAAM;AAAA,IACb,QAAQ,MAAM;AAAA;AAAA,IAEd,MAAM,CAAA,SAAS,UAAU,SAAU;AAAA,EAAA;AAEpC,SAAO,OAAO,QAAQ,SAAS,EAAE,MAAM,CAAC,CAAC,UAAU,QAAQ,MAAM;AAChE,QAAI,UAAU,QAAW;AACxB,aAAO;AAAA,IACR;AACA,UAAM,aAAa;AACnB,UAAM,UAAU,SAAS,UAAU;AACnC,QAAI,CAAC,SAAS;AACb,YAAM,IAAI,aAAA;AAAA,IACX;AACA,WAAQ,QAAgB,QAAQ;AAAA,EACjC,CAAC;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PersistOnFieldChange.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnFieldChange.tsx"],"sourcesContent":["import { ErrorPersistResult, SuccessfulPersistResult, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEffect } from 'react'\nimport { useField } from '../../accessorPropagation'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { Component, Field } from '../../coreComponents'\n\nexport type PersistOnFieldChangeProps = {\n\n\t/**\n\t * The field that should trigger persist when changed.\n\t */\n\tfield: SugaredRelativeSingleField['field']\n\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * Triggers persist when the specified field changes.\n * This only works for scalar fields, for relations, see {@link PersistOnHasOneChange}.\n *\n * ## Props {@link PersistOnFieldChangeProps}\n * - field, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnFieldChange field=\"name\" />\n * ```\n */\nexport const PersistOnFieldChange = Component(({ field, onPersistError, onPersistSuccess }: PersistOnFieldChangeProps) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\tconst getField = useField(field).getAccessor\n\n\tuseEffect(() => {\n\t\tconst unregister = getField().addEventListener({ type: 'update' }, async field => {\n\t\t\tif (!field.hasUnpersistedChanges) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait doPersist()\n\t\t})\n\n\t\treturn unregister\n\t}, [getField, doPersist])\n\n\treturn null\n}, ({ field }) => <Field field={field} />)\n"],"names":["Component","useDecoratedPersist","useField","useEffect","field","jsx","Field"],"mappings":";;;;;;;;AAoCO,MAAM,uBAAuBA,UAAU,UAAA,CAAC,EAAE,OAAO,gBAAgB,uBAAkD;AACzH,QAAM,YAAYC,oBAAA,oBAAoB,EAAE,gBAAgB,kBAAkB;AACpE,QAAA,WAAWC,SAAAA,SAAS,KAAK,EAAE;AAEjCC,QAAAA,UAAU,MAAM;AACT,UAAA,aAAa,WAAW,iBAAiB,EAAE,MAAM,SAAA,GAAY,OAAMC,WAAS;AAC7E,UAAA,CAACA,OAAM,uBAAuB;AACjC;AAAA,MAAA;AAED,YAAM,UAAU;AAAA,IAAA,CAChB;AAEM,WAAA;AAAA,EAAA,GACL,CAAC,UAAU,SAAS,CAAC;AAEjB,SAAA;AACR,GAAG,CAAC,EAAE,YAAaC,2BAAA,IAAAC,MAAA,OAAA,EAAM,OAAc,CAAE;;"}
1
+ {"version":3,"file":"PersistOnFieldChange.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnFieldChange.tsx"],"sourcesContent":["import { ErrorPersistResult, SuccessfulPersistResult, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEffect } from 'react'\nimport { useField } from '../../accessorPropagation'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { Component, Field } from '../../coreComponents'\n\nexport type PersistOnFieldChangeProps = {\n\t/**\n\t * The field that should trigger persist when changed.\n\t */\n\tfield: SugaredRelativeSingleField['field']\n\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * Triggers persist when the specified field changes.\n * This only works for scalar fields, for relations, see {@link PersistOnHasOneChange}.\n *\n * ## Props {@link PersistOnFieldChangeProps}\n * - field, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnFieldChange field=\"name\" />\n * ```\n */\nexport const PersistOnFieldChange = Component(({ field, onPersistError, onPersistSuccess }: PersistOnFieldChangeProps) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\tconst getField = useField(field).getAccessor\n\n\tuseEffect(() => {\n\t\tconst unregister = getField().addEventListener({ type: 'update' }, async field => {\n\t\t\tif (!field.hasUnpersistedChanges) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait doPersist()\n\t\t})\n\n\t\treturn unregister\n\t}, [getField, doPersist])\n\n\treturn null\n}, ({ field }) => <Field field={field} />)\n"],"names":["Component","useDecoratedPersist","useField","useEffect","field","jsx","Field"],"mappings":";;;;;;;;AAmCO,MAAM,uBAAuBA,UAAAA,UAAU,CAAC,EAAE,OAAO,gBAAgB,uBAAkD;AACzH,QAAM,YAAYC,oBAAAA,oBAAoB,EAAE,gBAAgB,kBAAkB;AAC1E,QAAM,WAAWC,SAAAA,SAAS,KAAK,EAAE;AAEjCC,QAAAA,UAAU,MAAM;AACf,UAAM,aAAa,WAAW,iBAAiB,EAAE,MAAM,SAAA,GAAY,OAAMC,WAAS;AACjF,UAAI,CAACA,OAAM,uBAAuB;AACjC;AAAA,MACD;AACA,YAAM,UAAA;AAAA,IACP,CAAC;AAED,WAAO;AAAA,EACR,GAAG,CAAC,UAAU,SAAS,CAAC;AAExB,SAAO;AACR,GAAG,CAAC,EAAE,MAAA,MAAYC,2BAAAA,IAACC,MAAAA,OAAA,EAAM,OAAc,CAAE;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PersistOnFieldChange.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnFieldChange.tsx"],"sourcesContent":["import { ErrorPersistResult, SuccessfulPersistResult, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEffect } from 'react'\nimport { useField } from '../../accessorPropagation'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { Component, Field } from '../../coreComponents'\n\nexport type PersistOnFieldChangeProps = {\n\n\t/**\n\t * The field that should trigger persist when changed.\n\t */\n\tfield: SugaredRelativeSingleField['field']\n\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * Triggers persist when the specified field changes.\n * This only works for scalar fields, for relations, see {@link PersistOnHasOneChange}.\n *\n * ## Props {@link PersistOnFieldChangeProps}\n * - field, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnFieldChange field=\"name\" />\n * ```\n */\nexport const PersistOnFieldChange = Component(({ field, onPersistError, onPersistSuccess }: PersistOnFieldChangeProps) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\tconst getField = useField(field).getAccessor\n\n\tuseEffect(() => {\n\t\tconst unregister = getField().addEventListener({ type: 'update' }, async field => {\n\t\t\tif (!field.hasUnpersistedChanges) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait doPersist()\n\t\t})\n\n\t\treturn unregister\n\t}, [getField, doPersist])\n\n\treturn null\n}, ({ field }) => <Field field={field} />)\n"],"names":["field"],"mappings":";;;;;;AAoCO,MAAM,uBAAuB,UAAU,CAAC,EAAE,OAAO,gBAAgB,uBAAkD;AACzH,QAAM,YAAY,oBAAoB,EAAE,gBAAgB,kBAAkB;AACpE,QAAA,WAAW,SAAS,KAAK,EAAE;AAEjC,YAAU,MAAM;AACT,UAAA,aAAa,WAAW,iBAAiB,EAAE,MAAM,SAAA,GAAY,OAAMA,WAAS;AAC7E,UAAA,CAACA,OAAM,uBAAuB;AACjC;AAAA,MAAA;AAED,YAAM,UAAU;AAAA,IAAA,CAChB;AAEM,WAAA;AAAA,EAAA,GACL,CAAC,UAAU,SAAS,CAAC;AAEjB,SAAA;AACR,GAAG,CAAC,EAAE,YAAa,oBAAA,OAAA,EAAM,OAAc,CAAE;"}
1
+ {"version":3,"file":"PersistOnFieldChange.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnFieldChange.tsx"],"sourcesContent":["import { ErrorPersistResult, SuccessfulPersistResult, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEffect } from 'react'\nimport { useField } from '../../accessorPropagation'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { Component, Field } from '../../coreComponents'\n\nexport type PersistOnFieldChangeProps = {\n\t/**\n\t * The field that should trigger persist when changed.\n\t */\n\tfield: SugaredRelativeSingleField['field']\n\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * Triggers persist when the specified field changes.\n * This only works for scalar fields, for relations, see {@link PersistOnHasOneChange}.\n *\n * ## Props {@link PersistOnFieldChangeProps}\n * - field, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnFieldChange field=\"name\" />\n * ```\n */\nexport const PersistOnFieldChange = Component(({ field, onPersistError, onPersistSuccess }: PersistOnFieldChangeProps) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\tconst getField = useField(field).getAccessor\n\n\tuseEffect(() => {\n\t\tconst unregister = getField().addEventListener({ type: 'update' }, async field => {\n\t\t\tif (!field.hasUnpersistedChanges) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait doPersist()\n\t\t})\n\n\t\treturn unregister\n\t}, [getField, doPersist])\n\n\treturn null\n}, ({ field }) => <Field field={field} />)\n"],"names":["field"],"mappings":";;;;;;AAmCO,MAAM,uBAAuB,UAAU,CAAC,EAAE,OAAO,gBAAgB,uBAAkD;AACzH,QAAM,YAAY,oBAAoB,EAAE,gBAAgB,kBAAkB;AAC1E,QAAM,WAAW,SAAS,KAAK,EAAE;AAEjC,YAAU,MAAM;AACf,UAAM,aAAa,WAAW,iBAAiB,EAAE,MAAM,SAAA,GAAY,OAAMA,WAAS;AACjF,UAAI,CAACA,OAAM,uBAAuB;AACjC;AAAA,MACD;AACA,YAAM,UAAA;AAAA,IACP,CAAC;AAED,WAAO;AAAA,EACR,GAAG,CAAC,UAAU,SAAS,CAAC;AAExB,SAAO;AACR,GAAG,CAAC,EAAE,MAAA,MAAY,oBAAC,OAAA,EAAM,OAAc,CAAE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PersistOnHasOneChange.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnHasOneChange.tsx"],"sourcesContent":["import { ErrorPersistResult, QueryLanguage, SuccessfulPersistResult, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEffect, useMemo } from 'react'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { useEntity, useEnvironment } from '../../accessorPropagation'\nimport { Component, HasOne } from '../../coreComponents'\n\nexport type PersistOnHasOneChangeProps = {\n\n\t/**\n\t * The relation field that should trigger persist when changed.\n\t */\n\tfield: SugaredRelativeSingleEntity['field']\n\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * Triggers persist when the specified relation field changes.\n * This only works for has-one relation fields, for scalar fields, see {@link PersistOnFieldChange}.\n *\n * ## Props {@link PersistOnHasOneChangeProps}\n * - field, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnHasOneChange field=\"author\" />\n * ```\n */\nexport const PersistOnHasOneChange = Component<PersistOnHasOneChangeProps>(({ field, onPersistError, onPersistSuccess }) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\tconst env = useEnvironment()\n\tconst desugaredPath = useMemo(() => QueryLanguage.desugarRelativeSingleEntity({ field }, env), [field, env])\n\tconst getEntity = useEntity(useMemo(() => ({\n\t\tfield: desugaredPath.hasOneRelationPath.slice(0, -1),\n\t}), [desugaredPath])).getAccessor\n\n\tconst lastField = desugaredPath.hasOneRelationPath[desugaredPath.hasOneRelationPath.length - 1].field\n\n\tuseEffect(() => {\n\t\tconst unregister = getEntity().addEventListener({ type: 'connectionUpdate', key: lastField }, async accessor => {\n\t\t\tif (!accessor.hasUnpersistedChanges) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait doPersist()\n\t\t})\n\n\t\treturn unregister\n\t}, [getEntity, doPersist, lastField])\n\n\treturn null\n}, ({ field }) => <HasOne field={field}/>)\n"],"names":["Component","useDecoratedPersist","useEnvironment","useMemo","QueryLanguage","useEntity","useEffect","jsx","HasOne"],"mappings":";;;;;;;;;;AAoCO,MAAM,wBAAwBA,UAAsC,UAAA,CAAC,EAAE,OAAO,gBAAgB,uBAAuB;AAC3H,QAAM,YAAYC,oBAAA,oBAAoB,EAAE,gBAAgB,kBAAkB;AAC1E,QAAM,MAAMC,eAAAA,eAAe;AAC3B,QAAM,gBAAgBC,MAAAA,QAAQ,MAAMC,QAAAA,cAAc,4BAA4B,EAAE,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,GAAG,CAAC;AACrG,QAAA,YAAYC,oBAAUF,MAAAA,QAAQ,OAAO;AAAA,IAC1C,OAAO,cAAc,mBAAmB,MAAM,GAAG,EAAE;AAAA,EAChD,IAAA,CAAC,aAAa,CAAC,CAAC,EAAE;AAEtB,QAAM,YAAY,cAAc,mBAAmB,cAAc,mBAAmB,SAAS,CAAC,EAAE;AAEhGG,QAAAA,UAAU,MAAM;AACT,UAAA,aAAa,YAAY,iBAAiB,EAAE,MAAM,oBAAoB,KAAK,aAAa,OAAM,aAAY;AAC3G,UAAA,CAAC,SAAS,uBAAuB;AACpC;AAAA,MAAA;AAED,YAAM,UAAU;AAAA,IAAA,CAChB;AAEM,WAAA;AAAA,EACL,GAAA,CAAC,WAAW,WAAW,SAAS,CAAC;AAE7B,SAAA;AACR,GAAG,CAAC,EAAE,YAAaC,2BAAA,IAAAC,OAAA,QAAA,EAAO,OAAa,CAAE;;"}
1
+ {"version":3,"file":"PersistOnHasOneChange.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnHasOneChange.tsx"],"sourcesContent":["import { ErrorPersistResult, QueryLanguage, SuccessfulPersistResult, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEffect, useMemo } from 'react'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { useEntity, useEnvironment } from '../../accessorPropagation'\nimport { Component, HasOne } from '../../coreComponents'\n\nexport type PersistOnHasOneChangeProps = {\n\t/**\n\t * The relation field that should trigger persist when changed.\n\t */\n\tfield: SugaredRelativeSingleEntity['field']\n\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * Triggers persist when the specified relation field changes.\n * This only works for has-one relation fields, for scalar fields, see {@link PersistOnFieldChange}.\n *\n * ## Props {@link PersistOnHasOneChangeProps}\n * - field, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnHasOneChange field=\"author\" />\n * ```\n */\nexport const PersistOnHasOneChange = Component<PersistOnHasOneChangeProps>(({ field, onPersistError, onPersistSuccess }) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\tconst env = useEnvironment()\n\tconst desugaredPath = useMemo(() => QueryLanguage.desugarRelativeSingleEntity({ field }, env), [field, env])\n\tconst getEntity = useEntity(useMemo(() => ({\n\t\tfield: desugaredPath.hasOneRelationPath.slice(0, -1),\n\t}), [desugaredPath])).getAccessor\n\n\tconst lastField = desugaredPath.hasOneRelationPath[desugaredPath.hasOneRelationPath.length - 1].field\n\n\tuseEffect(() => {\n\t\tconst unregister = getEntity().addEventListener({ type: 'connectionUpdate', key: lastField }, async accessor => {\n\t\t\tif (!accessor.hasUnpersistedChanges) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait doPersist()\n\t\t})\n\n\t\treturn unregister\n\t}, [getEntity, doPersist, lastField])\n\n\treturn null\n}, ({ field }) => <HasOne field={field} />)\n"],"names":["Component","useDecoratedPersist","useEnvironment","useMemo","QueryLanguage","useEntity","useEffect","jsx","HasOne"],"mappings":";;;;;;;;;;AAmCO,MAAM,wBAAwBA,UAAAA,UAAsC,CAAC,EAAE,OAAO,gBAAgB,uBAAuB;AAC3H,QAAM,YAAYC,oBAAAA,oBAAoB,EAAE,gBAAgB,kBAAkB;AAC1E,QAAM,MAAMC,eAAAA,eAAA;AACZ,QAAM,gBAAgBC,MAAAA,QAAQ,MAAMC,QAAAA,cAAc,4BAA4B,EAAE,MAAA,GAAS,GAAG,GAAG,CAAC,OAAO,GAAG,CAAC;AAC3G,QAAM,YAAYC,oBAAUF,MAAAA,QAAQ,OAAO;AAAA,IAC1C,OAAO,cAAc,mBAAmB,MAAM,GAAG,EAAE;AAAA,EAAA,IAChD,CAAC,aAAa,CAAC,CAAC,EAAE;AAEtB,QAAM,YAAY,cAAc,mBAAmB,cAAc,mBAAmB,SAAS,CAAC,EAAE;AAEhGG,QAAAA,UAAU,MAAM;AACf,UAAM,aAAa,YAAY,iBAAiB,EAAE,MAAM,oBAAoB,KAAK,aAAa,OAAM,aAAY;AAC/G,UAAI,CAAC,SAAS,uBAAuB;AACpC;AAAA,MACD;AACA,YAAM,UAAA;AAAA,IACP,CAAC;AAED,WAAO;AAAA,EACR,GAAG,CAAC,WAAW,WAAW,SAAS,CAAC;AAEpC,SAAO;AACR,GAAG,CAAC,EAAE,MAAA,MAAYC,2BAAAA,IAACC,OAAAA,QAAA,EAAO,OAAc,CAAE;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PersistOnHasOneChange.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnHasOneChange.tsx"],"sourcesContent":["import { ErrorPersistResult, QueryLanguage, SuccessfulPersistResult, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEffect, useMemo } from 'react'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { useEntity, useEnvironment } from '../../accessorPropagation'\nimport { Component, HasOne } from '../../coreComponents'\n\nexport type PersistOnHasOneChangeProps = {\n\n\t/**\n\t * The relation field that should trigger persist when changed.\n\t */\n\tfield: SugaredRelativeSingleEntity['field']\n\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * Triggers persist when the specified relation field changes.\n * This only works for has-one relation fields, for scalar fields, see {@link PersistOnFieldChange}.\n *\n * ## Props {@link PersistOnHasOneChangeProps}\n * - field, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnHasOneChange field=\"author\" />\n * ```\n */\nexport const PersistOnHasOneChange = Component<PersistOnHasOneChangeProps>(({ field, onPersistError, onPersistSuccess }) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\tconst env = useEnvironment()\n\tconst desugaredPath = useMemo(() => QueryLanguage.desugarRelativeSingleEntity({ field }, env), [field, env])\n\tconst getEntity = useEntity(useMemo(() => ({\n\t\tfield: desugaredPath.hasOneRelationPath.slice(0, -1),\n\t}), [desugaredPath])).getAccessor\n\n\tconst lastField = desugaredPath.hasOneRelationPath[desugaredPath.hasOneRelationPath.length - 1].field\n\n\tuseEffect(() => {\n\t\tconst unregister = getEntity().addEventListener({ type: 'connectionUpdate', key: lastField }, async accessor => {\n\t\t\tif (!accessor.hasUnpersistedChanges) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait doPersist()\n\t\t})\n\n\t\treturn unregister\n\t}, [getEntity, doPersist, lastField])\n\n\treturn null\n}, ({ field }) => <HasOne field={field}/>)\n"],"names":[],"mappings":";;;;;;;;AAoCO,MAAM,wBAAwB,UAAsC,CAAC,EAAE,OAAO,gBAAgB,uBAAuB;AAC3H,QAAM,YAAY,oBAAoB,EAAE,gBAAgB,kBAAkB;AAC1E,QAAM,MAAM,eAAe;AAC3B,QAAM,gBAAgB,QAAQ,MAAM,cAAc,4BAA4B,EAAE,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,GAAG,CAAC;AACrG,QAAA,YAAY,UAAU,QAAQ,OAAO;AAAA,IAC1C,OAAO,cAAc,mBAAmB,MAAM,GAAG,EAAE;AAAA,EAChD,IAAA,CAAC,aAAa,CAAC,CAAC,EAAE;AAEtB,QAAM,YAAY,cAAc,mBAAmB,cAAc,mBAAmB,SAAS,CAAC,EAAE;AAEhG,YAAU,MAAM;AACT,UAAA,aAAa,YAAY,iBAAiB,EAAE,MAAM,oBAAoB,KAAK,aAAa,OAAM,aAAY;AAC3G,UAAA,CAAC,SAAS,uBAAuB;AACpC;AAAA,MAAA;AAED,YAAM,UAAU;AAAA,IAAA,CAChB;AAEM,WAAA;AAAA,EACL,GAAA,CAAC,WAAW,WAAW,SAAS,CAAC;AAE7B,SAAA;AACR,GAAG,CAAC,EAAE,YAAa,oBAAA,QAAA,EAAO,OAAa,CAAE;"}
1
+ {"version":3,"file":"PersistOnHasOneChange.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnHasOneChange.tsx"],"sourcesContent":["import { ErrorPersistResult, QueryLanguage, SuccessfulPersistResult, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEffect, useMemo } from 'react'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { useEntity, useEnvironment } from '../../accessorPropagation'\nimport { Component, HasOne } from '../../coreComponents'\n\nexport type PersistOnHasOneChangeProps = {\n\t/**\n\t * The relation field that should trigger persist when changed.\n\t */\n\tfield: SugaredRelativeSingleEntity['field']\n\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * Triggers persist when the specified relation field changes.\n * This only works for has-one relation fields, for scalar fields, see {@link PersistOnFieldChange}.\n *\n * ## Props {@link PersistOnHasOneChangeProps}\n * - field, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnHasOneChange field=\"author\" />\n * ```\n */\nexport const PersistOnHasOneChange = Component<PersistOnHasOneChangeProps>(({ field, onPersistError, onPersistSuccess }) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\tconst env = useEnvironment()\n\tconst desugaredPath = useMemo(() => QueryLanguage.desugarRelativeSingleEntity({ field }, env), [field, env])\n\tconst getEntity = useEntity(useMemo(() => ({\n\t\tfield: desugaredPath.hasOneRelationPath.slice(0, -1),\n\t}), [desugaredPath])).getAccessor\n\n\tconst lastField = desugaredPath.hasOneRelationPath[desugaredPath.hasOneRelationPath.length - 1].field\n\n\tuseEffect(() => {\n\t\tconst unregister = getEntity().addEventListener({ type: 'connectionUpdate', key: lastField }, async accessor => {\n\t\t\tif (!accessor.hasUnpersistedChanges) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait doPersist()\n\t\t})\n\n\t\treturn unregister\n\t}, [getEntity, doPersist, lastField])\n\n\treturn null\n}, ({ field }) => <HasOne field={field} />)\n"],"names":[],"mappings":";;;;;;;;AAmCO,MAAM,wBAAwB,UAAsC,CAAC,EAAE,OAAO,gBAAgB,uBAAuB;AAC3H,QAAM,YAAY,oBAAoB,EAAE,gBAAgB,kBAAkB;AAC1E,QAAM,MAAM,eAAA;AACZ,QAAM,gBAAgB,QAAQ,MAAM,cAAc,4BAA4B,EAAE,MAAA,GAAS,GAAG,GAAG,CAAC,OAAO,GAAG,CAAC;AAC3G,QAAM,YAAY,UAAU,QAAQ,OAAO;AAAA,IAC1C,OAAO,cAAc,mBAAmB,MAAM,GAAG,EAAE;AAAA,EAAA,IAChD,CAAC,aAAa,CAAC,CAAC,EAAE;AAEtB,QAAM,YAAY,cAAc,mBAAmB,cAAc,mBAAmB,SAAS,CAAC,EAAE;AAEhG,YAAU,MAAM;AACf,UAAM,aAAa,YAAY,iBAAiB,EAAE,MAAM,oBAAoB,KAAK,aAAa,OAAM,aAAY;AAC/G,UAAI,CAAC,SAAS,uBAAuB;AACpC;AAAA,MACD;AACA,YAAM,UAAA;AAAA,IACP,CAAC;AAED,WAAO;AAAA,EACR,GAAG,CAAC,WAAW,WAAW,SAAS,CAAC;AAEpC,SAAO;AACR,GAAG,CAAC,EAAE,MAAA,MAAY,oBAAC,QAAA,EAAO,OAAc,CAAE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PersistOnKey.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnKey.tsx"],"sourcesContent":["import { ErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useEffect } from 'react'\nimport { useDecoratedPersist } from './useDecoratedPersist'\n\nexport type PersistOnKeyProps = {\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n\t/**\n\t * Optional function that decides whether a given KeyboardEvent\n\t * should trigger the persist action.\n\t */\n\tisHotkey?: (event: KeyboardEvent) => boolean\n}\n\n/**\n * Triggers persist when the specified hotkey is pressed.\n *\n * ## Props {@link PersistOnKeyProps}\n * - ?isHotkey, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnKey />\n * ```\n */\nexport const PersistOnKey = ({\n\tonPersistSuccess,\n\tonPersistError,\n\tisHotkey,\n}: PersistOnKeyProps) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\n\tuseEffect(() => {\n\t\tconst shouldHandleHotkey = isHotkey ?? defaultHotkeyCheck\n\n\t\tconst listener = (event: KeyboardEvent) => {\n\t\t\tif (shouldHandleHotkey(event)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tdoPersist()\n\t\t\t}\n\t\t}\n\n\t\tdocument.body.addEventListener('keydown', listener)\n\t\treturn () => {\n\t\t\tdocument.body.removeEventListener('keydown', listener)\n\t\t}\n\t}, [doPersist, isHotkey]) // Re-run effect if these change\n\n\treturn null\n}\n\n// Default hotkey check: ctrl+s or command+s\nconst defaultHotkeyCheck = (event: KeyboardEvent) => {\n\treturn (\n\t\t(event.ctrlKey || event.metaKey) &&\n\t\tevent.key.toLowerCase() === 's'\n\t)\n}\n"],"names":["useDecoratedPersist","useEffect"],"mappings":";;;;AA+BO,MAAM,eAAe,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AACD,MAAyB;AACxB,QAAM,YAAYA,oBAAA,oBAAoB,EAAE,gBAAgB,kBAAkB;AAE1EC,QAAAA,UAAU,MAAM;AACf,UAAM,qBAAqB,YAAY;AAEjC,UAAA,WAAW,CAAC,UAAyB;AACtC,UAAA,mBAAmB,KAAK,GAAG;AAC9B,cAAM,eAAe;AACX,kBAAA;AAAA,MAAA;AAAA,IAEZ;AAES,aAAA,KAAK,iBAAiB,WAAW,QAAQ;AAClD,WAAO,MAAM;AACH,eAAA,KAAK,oBAAoB,WAAW,QAAQ;AAAA,IACtD;AAAA,EAAA,GACE,CAAC,WAAW,QAAQ,CAAC;AAEjB,SAAA;AACR;AAGA,MAAM,qBAAqB,CAAC,UAAyB;AACpD,UACE,MAAM,WAAW,MAAM,YACxB,MAAM,IAAI,kBAAkB;AAE9B;;"}
1
+ {"version":3,"file":"PersistOnKey.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnKey.tsx"],"sourcesContent":["import { ErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useEffect } from 'react'\nimport { useDecoratedPersist } from './useDecoratedPersist'\n\nexport type PersistOnKeyProps = {\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n\t/**\n\t * Optional function that decides whether a given KeyboardEvent\n\t * should trigger the persist action.\n\t */\n\tisHotkey?: (event: KeyboardEvent) => boolean\n}\n\n/**\n * Triggers persist when the specified hotkey is pressed.\n *\n * ## Props {@link PersistOnKeyProps}\n * - ?isHotkey, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnKey />\n * ```\n */\nexport const PersistOnKey = ({\n\tonPersistSuccess,\n\tonPersistError,\n\tisHotkey,\n}: PersistOnKeyProps) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\n\tuseEffect(() => {\n\t\tconst shouldHandleHotkey = isHotkey ?? defaultHotkeyCheck\n\n\t\tconst listener = (event: KeyboardEvent) => {\n\t\t\tif (shouldHandleHotkey(event)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tdoPersist()\n\t\t\t}\n\t\t}\n\n\t\tdocument.body.addEventListener('keydown', listener)\n\t\treturn () => {\n\t\t\tdocument.body.removeEventListener('keydown', listener)\n\t\t}\n\t}, [doPersist, isHotkey]) // Re-run effect if these change\n\n\treturn null\n}\n\n// Default hotkey check: ctrl+s or command+s\nconst defaultHotkeyCheck = (event: KeyboardEvent) => {\n\treturn (\n\t\t(event.ctrlKey || event.metaKey)\n\t\t&& event.key.toLowerCase() === 's'\n\t)\n}\n"],"names":["useDecoratedPersist","useEffect"],"mappings":";;;;AA+BO,MAAM,eAAe,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AACD,MAAyB;AACxB,QAAM,YAAYA,oBAAAA,oBAAoB,EAAE,gBAAgB,kBAAkB;AAE1EC,QAAAA,UAAU,MAAM;AACf,UAAM,qBAAqB,YAAY;AAEvC,UAAM,WAAW,CAAC,UAAyB;AAC1C,UAAI,mBAAmB,KAAK,GAAG;AAC9B,cAAM,eAAA;AACN,kBAAA;AAAA,MACD;AAAA,IACD;AAEA,aAAS,KAAK,iBAAiB,WAAW,QAAQ;AAClD,WAAO,MAAM;AACZ,eAAS,KAAK,oBAAoB,WAAW,QAAQ;AAAA,IACtD;AAAA,EACD,GAAG,CAAC,WAAW,QAAQ,CAAC;AAExB,SAAO;AACR;AAGA,MAAM,qBAAqB,CAAC,UAAyB;AACpD,UACE,MAAM,WAAW,MAAM,YACrB,MAAM,IAAI,kBAAkB;AAEjC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PersistOnKey.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnKey.tsx"],"sourcesContent":["import { ErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useEffect } from 'react'\nimport { useDecoratedPersist } from './useDecoratedPersist'\n\nexport type PersistOnKeyProps = {\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n\t/**\n\t * Optional function that decides whether a given KeyboardEvent\n\t * should trigger the persist action.\n\t */\n\tisHotkey?: (event: KeyboardEvent) => boolean\n}\n\n/**\n * Triggers persist when the specified hotkey is pressed.\n *\n * ## Props {@link PersistOnKeyProps}\n * - ?isHotkey, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnKey />\n * ```\n */\nexport const PersistOnKey = ({\n\tonPersistSuccess,\n\tonPersistError,\n\tisHotkey,\n}: PersistOnKeyProps) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\n\tuseEffect(() => {\n\t\tconst shouldHandleHotkey = isHotkey ?? defaultHotkeyCheck\n\n\t\tconst listener = (event: KeyboardEvent) => {\n\t\t\tif (shouldHandleHotkey(event)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tdoPersist()\n\t\t\t}\n\t\t}\n\n\t\tdocument.body.addEventListener('keydown', listener)\n\t\treturn () => {\n\t\t\tdocument.body.removeEventListener('keydown', listener)\n\t\t}\n\t}, [doPersist, isHotkey]) // Re-run effect if these change\n\n\treturn null\n}\n\n// Default hotkey check: ctrl+s or command+s\nconst defaultHotkeyCheck = (event: KeyboardEvent) => {\n\treturn (\n\t\t(event.ctrlKey || event.metaKey) &&\n\t\tevent.key.toLowerCase() === 's'\n\t)\n}\n"],"names":[],"mappings":";;AA+BO,MAAM,eAAe,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AACD,MAAyB;AACxB,QAAM,YAAY,oBAAoB,EAAE,gBAAgB,kBAAkB;AAE1E,YAAU,MAAM;AACf,UAAM,qBAAqB,YAAY;AAEjC,UAAA,WAAW,CAAC,UAAyB;AACtC,UAAA,mBAAmB,KAAK,GAAG;AAC9B,cAAM,eAAe;AACX,kBAAA;AAAA,MAAA;AAAA,IAEZ;AAES,aAAA,KAAK,iBAAiB,WAAW,QAAQ;AAClD,WAAO,MAAM;AACH,eAAA,KAAK,oBAAoB,WAAW,QAAQ;AAAA,IACtD;AAAA,EAAA,GACE,CAAC,WAAW,QAAQ,CAAC;AAEjB,SAAA;AACR;AAGA,MAAM,qBAAqB,CAAC,UAAyB;AACpD,UACE,MAAM,WAAW,MAAM,YACxB,MAAM,IAAI,kBAAkB;AAE9B;"}
1
+ {"version":3,"file":"PersistOnKey.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistOnKey.tsx"],"sourcesContent":["import { ErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useEffect } from 'react'\nimport { useDecoratedPersist } from './useDecoratedPersist'\n\nexport type PersistOnKeyProps = {\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\t/**\n\t * Callback that is called when an error occurs during persist.\n\t */\n\tonPersistError?: (result: ErrorPersistResult) => void\n\t/**\n\t * Optional function that decides whether a given KeyboardEvent\n\t * should trigger the persist action.\n\t */\n\tisHotkey?: (event: KeyboardEvent) => boolean\n}\n\n/**\n * Triggers persist when the specified hotkey is pressed.\n *\n * ## Props {@link PersistOnKeyProps}\n * - ?isHotkey, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistOnKey />\n * ```\n */\nexport const PersistOnKey = ({\n\tonPersistSuccess,\n\tonPersistError,\n\tisHotkey,\n}: PersistOnKeyProps) => {\n\tconst doPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\n\tuseEffect(() => {\n\t\tconst shouldHandleHotkey = isHotkey ?? defaultHotkeyCheck\n\n\t\tconst listener = (event: KeyboardEvent) => {\n\t\t\tif (shouldHandleHotkey(event)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tdoPersist()\n\t\t\t}\n\t\t}\n\n\t\tdocument.body.addEventListener('keydown', listener)\n\t\treturn () => {\n\t\t\tdocument.body.removeEventListener('keydown', listener)\n\t\t}\n\t}, [doPersist, isHotkey]) // Re-run effect if these change\n\n\treturn null\n}\n\n// Default hotkey check: ctrl+s or command+s\nconst defaultHotkeyCheck = (event: KeyboardEvent) => {\n\treturn (\n\t\t(event.ctrlKey || event.metaKey)\n\t\t&& event.key.toLowerCase() === 's'\n\t)\n}\n"],"names":[],"mappings":";;AA+BO,MAAM,eAAe,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AACD,MAAyB;AACxB,QAAM,YAAY,oBAAoB,EAAE,gBAAgB,kBAAkB;AAE1E,YAAU,MAAM;AACf,UAAM,qBAAqB,YAAY;AAEvC,UAAM,WAAW,CAAC,UAAyB;AAC1C,UAAI,mBAAmB,KAAK,GAAG;AAC9B,cAAM,eAAA;AACN,kBAAA;AAAA,MACD;AAAA,IACD;AAEA,aAAS,KAAK,iBAAiB,WAAW,QAAQ;AAClD,WAAO,MAAM;AACZ,eAAS,KAAK,oBAAoB,WAAW,QAAQ;AAAA,IACtD;AAAA,EACD,GAAG,CAAC,WAAW,QAAQ,CAAC;AAExB,SAAO;AACR;AAGA,MAAM,qBAAqB,CAAC,UAAyB;AACpD,UACE,MAAM,WAAW,MAAM,YACrB,MAAM,IAAI,kBAAkB;AAEjC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PersistTrigger.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistTrigger.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { dataAttribute } from '@contember/utilities'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { ErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useDirtinessState, useMutationState } from '../../accessorTree'\nimport { composeEventHandlers } from '@radix-ui/primitive'\n\nexport interface PersistTriggerAttributes {\n\t['data-dirty']?: ''\n\t['data-loading']?: ''\n}\n\nconst SlotType = Slot as React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement> & PersistTriggerAttributes>\n\nexport interface PersistTriggerProps {\n\t/**\n\t * The button element.\n\t */\n\tchildren: ReactElement\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * A button that triggers persist when clicked.\n *\n * ## Props {@link PersistTriggerProps}\n * - children, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistTrigger>\n * <button>Save</button>\n * </PersistTrigger>\n * ```\n */\nexport const PersistTrigger = ({ onPersistError, onPersistSuccess, ...props }: PersistTriggerProps) => {\n\tconst isMutating = useMutationState()\n\tconst isDirty = useDirtinessState()\n\tconst triggerPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\n\tconst isDisabled = isMutating || !isDirty\n\n\tconst { onClick, ...otherProps } = props as React.ButtonHTMLAttributes<HTMLButtonElement>\n\n\treturn (\n\t\t<SlotType\n\t\t\tdisabled={isDisabled}\n\t\t\tdata-dirty={dataAttribute(isDirty)}\n\t\t\tdata-loading={dataAttribute(isMutating)}\n\t\t\tonClick={composeEventHandlers(triggerPersist, onClick)}\n\t\t\t{...otherProps}\n\t\t/>\n\t)\n}\n"],"names":["Slot","useMutationState","useDirtinessState","useDecoratedPersist","jsx","dataAttribute","composeEventHandlers"],"mappings":";;;;;;;;;AAaA,MAAM,WAAWA,UAAA;AA2BV,MAAM,iBAAiB,CAAC,EAAE,gBAAgB,kBAAkB,GAAG,YAAiC;AACtG,QAAM,aAAaC,iBAAAA,iBAAiB;AACpC,QAAM,UAAUC,kBAAAA,kBAAkB;AAClC,QAAM,iBAAiBC,oBAAA,oBAAoB,EAAE,gBAAgB,kBAAkB;AAEzE,QAAA,aAAa,cAAc,CAAC;AAElC,QAAM,EAAE,SAAS,GAAG,WAAA,IAAe;AAGlC,SAAAC,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,UAAU;AAAA,MACV,cAAYC,wBAAc,OAAO;AAAA,MACjC,gBAAcA,wBAAc,UAAU;AAAA,MACtC,SAASC,UAAAA,qBAAqB,gBAAgB,OAAO;AAAA,MACpD,GAAG;AAAA,IAAA;AAAA,EACL;AAEF;;"}
1
+ {"version":3,"file":"PersistTrigger.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistTrigger.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { dataAttribute } from '@contember/utilities'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { ErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useDirtinessState, useMutationState } from '../../accessorTree'\nimport { composeEventHandlers } from '@radix-ui/primitive'\n\nexport interface PersistTriggerAttributes {\n\t['data-dirty']?: ''\n\t['data-loading']?: ''\n}\n\nconst SlotType = Slot as React.ForwardRefExoticComponent<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement> & PersistTriggerAttributes\n>\n\nexport interface PersistTriggerProps {\n\t/**\n\t * The button element.\n\t */\n\tchildren: ReactElement\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * A button that triggers persist when clicked.\n *\n * ## Props {@link PersistTriggerProps}\n * - children, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistTrigger>\n * <button>Save</button>\n * </PersistTrigger>\n * ```\n */\nexport const PersistTrigger = ({ onPersistError, onPersistSuccess, ...props }: PersistTriggerProps) => {\n\tconst isMutating = useMutationState()\n\tconst isDirty = useDirtinessState()\n\tconst triggerPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\n\tconst isDisabled = isMutating || !isDirty\n\n\tconst { onClick, ...otherProps } = props as React.ButtonHTMLAttributes<HTMLButtonElement>\n\n\treturn (\n\t\t<SlotType\n\t\t\tdisabled={isDisabled}\n\t\t\tdata-dirty={dataAttribute(isDirty)}\n\t\t\tdata-loading={dataAttribute(isMutating)}\n\t\t\tonClick={composeEventHandlers(triggerPersist, onClick)}\n\t\t\t{...otherProps}\n\t\t/>\n\t)\n}\n"],"names":["Slot","useMutationState","useDirtinessState","useDecoratedPersist","jsx","dataAttribute","composeEventHandlers"],"mappings":";;;;;;;;;AAaA,MAAM,WAAWA,UAAAA;AA6BV,MAAM,iBAAiB,CAAC,EAAE,gBAAgB,kBAAkB,GAAG,YAAiC;AACtG,QAAM,aAAaC,iBAAAA,iBAAA;AACnB,QAAM,UAAUC,kBAAAA,kBAAA;AAChB,QAAM,iBAAiBC,oBAAAA,oBAAoB,EAAE,gBAAgB,kBAAkB;AAE/E,QAAM,aAAa,cAAc,CAAC;AAElC,QAAM,EAAE,SAAS,GAAG,WAAA,IAAe;AAEnC,SACCC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACA,UAAU;AAAA,MACV,cAAYC,UAAAA,cAAc,OAAO;AAAA,MACjC,gBAAcA,UAAAA,cAAc,UAAU;AAAA,MACtC,SAASC,UAAAA,qBAAqB,gBAAgB,OAAO;AAAA,MACpD,GAAG;AAAA,IAAA;AAAA,EAAA;AAGP;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PersistTrigger.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistTrigger.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { dataAttribute } from '@contember/utilities'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { ErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useDirtinessState, useMutationState } from '../../accessorTree'\nimport { composeEventHandlers } from '@radix-ui/primitive'\n\nexport interface PersistTriggerAttributes {\n\t['data-dirty']?: ''\n\t['data-loading']?: ''\n}\n\nconst SlotType = Slot as React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement> & PersistTriggerAttributes>\n\nexport interface PersistTriggerProps {\n\t/**\n\t * The button element.\n\t */\n\tchildren: ReactElement\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * A button that triggers persist when clicked.\n *\n * ## Props {@link PersistTriggerProps}\n * - children, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistTrigger>\n * <button>Save</button>\n * </PersistTrigger>\n * ```\n */\nexport const PersistTrigger = ({ onPersistError, onPersistSuccess, ...props }: PersistTriggerProps) => {\n\tconst isMutating = useMutationState()\n\tconst isDirty = useDirtinessState()\n\tconst triggerPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\n\tconst isDisabled = isMutating || !isDirty\n\n\tconst { onClick, ...otherProps } = props as React.ButtonHTMLAttributes<HTMLButtonElement>\n\n\treturn (\n\t\t<SlotType\n\t\t\tdisabled={isDisabled}\n\t\t\tdata-dirty={dataAttribute(isDirty)}\n\t\t\tdata-loading={dataAttribute(isMutating)}\n\t\t\tonClick={composeEventHandlers(triggerPersist, onClick)}\n\t\t\t{...otherProps}\n\t\t/>\n\t)\n}\n"],"names":[],"mappings":";;;;;;;AAaA,MAAM,WAAW;AA2BV,MAAM,iBAAiB,CAAC,EAAE,gBAAgB,kBAAkB,GAAG,YAAiC;AACtG,QAAM,aAAa,iBAAiB;AACpC,QAAM,UAAU,kBAAkB;AAClC,QAAM,iBAAiB,oBAAoB,EAAE,gBAAgB,kBAAkB;AAEzE,QAAA,aAAa,cAAc,CAAC;AAElC,QAAM,EAAE,SAAS,GAAG,WAAA,IAAe;AAGlC,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,UAAU;AAAA,MACV,cAAY,cAAc,OAAO;AAAA,MACjC,gBAAc,cAAc,UAAU;AAAA,MACtC,SAAS,qBAAqB,gBAAgB,OAAO;AAAA,MACpD,GAAG;AAAA,IAAA;AAAA,EACL;AAEF;"}
1
+ {"version":3,"file":"PersistTrigger.js","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/PersistTrigger.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { dataAttribute } from '@contember/utilities'\nimport { useDecoratedPersist } from './useDecoratedPersist'\nimport { ErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useDirtinessState, useMutationState } from '../../accessorTree'\nimport { composeEventHandlers } from '@radix-ui/primitive'\n\nexport interface PersistTriggerAttributes {\n\t['data-dirty']?: ''\n\t['data-loading']?: ''\n}\n\nconst SlotType = Slot as React.ForwardRefExoticComponent<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement> & PersistTriggerAttributes\n>\n\nexport interface PersistTriggerProps {\n\t/**\n\t * The button element.\n\t */\n\tchildren: ReactElement\n\t/**\n\t * Callback that is called when persist is successful.\n\t */\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\n/**\n * A button that triggers persist when clicked.\n *\n * ## Props {@link PersistTriggerProps}\n * - children, ?onPersistError, ?onPersistSuccess\n *\n * ## Example\n * ```tsx\n * <PersistTrigger>\n * <button>Save</button>\n * </PersistTrigger>\n * ```\n */\nexport const PersistTrigger = ({ onPersistError, onPersistSuccess, ...props }: PersistTriggerProps) => {\n\tconst isMutating = useMutationState()\n\tconst isDirty = useDirtinessState()\n\tconst triggerPersist = useDecoratedPersist({ onPersistError, onPersistSuccess })\n\n\tconst isDisabled = isMutating || !isDirty\n\n\tconst { onClick, ...otherProps } = props as React.ButtonHTMLAttributes<HTMLButtonElement>\n\n\treturn (\n\t\t<SlotType\n\t\t\tdisabled={isDisabled}\n\t\t\tdata-dirty={dataAttribute(isDirty)}\n\t\t\tdata-loading={dataAttribute(isMutating)}\n\t\t\tonClick={composeEventHandlers(triggerPersist, onClick)}\n\t\t\t{...otherProps}\n\t\t/>\n\t)\n}\n"],"names":[],"mappings":";;;;;;;AAaA,MAAM,WAAW;AA6BV,MAAM,iBAAiB,CAAC,EAAE,gBAAgB,kBAAkB,GAAG,YAAiC;AACtG,QAAM,aAAa,iBAAA;AACnB,QAAM,UAAU,kBAAA;AAChB,QAAM,iBAAiB,oBAAoB,EAAE,gBAAgB,kBAAkB;AAE/E,QAAM,aAAa,cAAc,CAAC;AAElC,QAAM,EAAE,SAAS,GAAG,WAAA,IAAe;AAEnC,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,UAAU;AAAA,MACV,cAAY,cAAc,OAAO;AAAA,MACjC,gBAAc,cAAc,UAAU;AAAA,MACtC,SAAS,qBAAqB,gBAAgB,OAAO;AAAA,MACpD,GAAG;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDecoratedPersist.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/useDecoratedPersist.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport { usePersist } from '../../accessorPropagation'\nimport { ErrorPersistResult, isErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nexport interface UseDecoratedPersistOptions {\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\nexport const useDecoratedPersist = ({ onPersistSuccess, onPersistError }: UseDecoratedPersistOptions = {}) => {\n\tconst triggerPersist = usePersist()\n\n\treturn useReferentiallyStableCallback(async () => {\n\t\ttry {\n\t\t\tconst result = await triggerPersist()\n\t\t\tonPersistSuccess?.(result)\n\t\t} catch (e) {\n\t\t\tif (isErrorPersistResult(e)) {\n\t\t\t\tonPersistError?.(e)\n\t\t\t} else {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":["usePersist","useReferentiallyStableCallback","isErrorPersistResult"],"mappings":";;;;;AAUO,MAAM,sBAAsB,CAAC,EAAE,kBAAkB,eAAe,IAAgC,CAAA,MAAO;AAC7G,QAAM,iBAAiBA,WAAAA,WAAW;AAElC,SAAOC,0CAA+B,YAAY;AAC7C,QAAA;AACG,YAAA,SAAS,MAAM,eAAe;AACpC,yBAAmB,MAAM;AAAA,aACjB,GAAG;AACP,UAAAC,QAAAA,qBAAqB,CAAC,GAAG;AAC5B,yBAAiB,CAAC;AAAA,MAAA,OACZ;AACA,cAAA;AAAA,MAAA;AAAA,IACP;AAAA,EACD,CACA;AACF;;"}
1
+ {"version":3,"file":"useDecoratedPersist.cjs","sources":["../../../../../../packages/react-binding/src/helperComponents/persist/useDecoratedPersist.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport { usePersist } from '../../accessorPropagation'\nimport { ErrorPersistResult, isErrorPersistResult, SuccessfulPersistResult } from '@contember/binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nexport interface UseDecoratedPersistOptions {\n\tonPersistSuccess?: (result: SuccessfulPersistResult) => void\n\tonPersistError?: (result: ErrorPersistResult) => void\n}\n\nexport const useDecoratedPersist = ({ onPersistSuccess, onPersistError }: UseDecoratedPersistOptions = {}) => {\n\tconst triggerPersist = usePersist()\n\n\treturn useReferentiallyStableCallback(async () => {\n\t\ttry {\n\t\t\tconst result = await triggerPersist()\n\t\t\tonPersistSuccess?.(result)\n\t\t} catch (e) {\n\t\t\tif (isErrorPersistResult(e)) {\n\t\t\t\tonPersistError?.(e)\n\t\t\t} else {\n\t\t\t\tthrow e\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":["usePersist","useReferentiallyStableCallback","isErrorPersistResult"],"mappings":";;;;;AAUO,MAAM,sBAAsB,CAAC,EAAE,kBAAkB,eAAA,IAA+C,CAAA,MAAO;AAC7G,QAAM,iBAAiBA,WAAAA,WAAA;AAEvB,SAAOC,WAAAA,+BAA+B,YAAY;AACjD,QAAI;AACH,YAAM,SAAS,MAAM,eAAA;AACrB,yBAAmB,MAAM;AAAA,IAC1B,SAAS,GAAG;AACX,UAAIC,QAAAA,qBAAqB,CAAC,GAAG;AAC5B,yBAAiB,CAAC;AAAA,MACnB,OAAO;AACN,cAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD,CAAC;AACF;;"}