@contember/binding 1.1.0-alpha.12 → 1.1.0-alpha.14

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 (628) hide show
  1. package/dist/development/BindingError.js +4 -1
  2. package/dist/development/BindingError.js.map +1 -1
  3. package/dist/development/accessorPropagation/AccessorProvider.js +20 -7
  4. package/dist/development/accessorPropagation/AccessorProvider.js.map +1 -1
  5. package/dist/development/accessorPropagation/BindingOperationsContext.js +7 -2
  6. package/dist/development/accessorPropagation/BindingOperationsContext.js.map +1 -1
  7. package/dist/development/accessorPropagation/BindingOperationsProvider.js +13 -5
  8. package/dist/development/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  9. package/dist/development/accessorPropagation/EntityKeyContext.js +3 -1
  10. package/dist/development/accessorPropagation/EntityKeyContext.js.map +1 -1
  11. package/dist/development/accessorPropagation/EntityKeyProvider.js +13 -5
  12. package/dist/development/accessorPropagation/EntityKeyProvider.js.map +1 -1
  13. package/dist/development/accessorPropagation/EnvironmentContext.js +55 -17
  14. package/dist/development/accessorPropagation/EnvironmentContext.js.map +1 -1
  15. package/dist/development/accessorPropagation/TreeRootIdContext.js +3 -1
  16. package/dist/development/accessorPropagation/TreeRootIdContext.js.map +1 -1
  17. package/dist/development/accessorPropagation/TreeRootIdProvider.js +13 -5
  18. package/dist/development/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  19. package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js +3 -1
  20. package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
  21. package/dist/development/accessorPropagation/useBindingOperations.js +3 -1
  22. package/dist/development/accessorPropagation/useBindingOperations.js.map +1 -1
  23. package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js +26 -18
  24. package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
  25. package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js +14 -6
  26. package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
  27. package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js +14 -6
  28. package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
  29. package/dist/development/accessorPropagation/useEntity.js +7 -2
  30. package/dist/development/accessorPropagation/useEntity.js.map +1 -1
  31. package/dist/development/accessorPropagation/useEntityKey.js +6 -2
  32. package/dist/development/accessorPropagation/useEntityKey.js.map +1 -1
  33. package/dist/development/accessorPropagation/useEntityList.js +11 -3
  34. package/dist/development/accessorPropagation/useEntityList.js.map +1 -1
  35. package/dist/development/accessorPropagation/useEntityListSubTree.js +7 -2
  36. package/dist/development/accessorPropagation/useEntityListSubTree.js.map +1 -1
  37. package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js +50 -30
  38. package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
  39. package/dist/development/accessorPropagation/useEntitySubTree.js +7 -2
  40. package/dist/development/accessorPropagation/useEntitySubTree.js.map +1 -1
  41. package/dist/development/accessorPropagation/useEntitySubTreeParameters.js +27 -16
  42. package/dist/development/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
  43. package/dist/development/accessorPropagation/useEnvironment.js +3 -1
  44. package/dist/development/accessorPropagation/useEnvironment.js.map +1 -1
  45. package/dist/development/accessorPropagation/useExtendTree.js +7 -2
  46. package/dist/development/accessorPropagation/useExtendTree.js.map +1 -1
  47. package/dist/development/accessorPropagation/useField.js +11 -3
  48. package/dist/development/accessorPropagation/useField.js.map +1 -1
  49. package/dist/development/accessorPropagation/useGetEntityByKey.js +3 -1
  50. package/dist/development/accessorPropagation/useGetEntityByKey.js.map +1 -1
  51. package/dist/development/accessorPropagation/useGetEntityListSubTree.js +7 -2
  52. package/dist/development/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
  53. package/dist/development/accessorPropagation/useGetEntitySubTree.js +7 -2
  54. package/dist/development/accessorPropagation/useGetEntitySubTree.js.map +1 -1
  55. package/dist/development/accessorPropagation/useGetTreeFilters.js +3 -1
  56. package/dist/development/accessorPropagation/useGetTreeFilters.js.map +1 -1
  57. package/dist/development/accessorPropagation/useHasEntity.js +3 -1
  58. package/dist/development/accessorPropagation/useHasEntity.js.map +1 -1
  59. package/dist/development/accessorPropagation/usePersist.js +3 -1
  60. package/dist/development/accessorPropagation/usePersist.js.map +1 -1
  61. package/dist/development/accessorPropagation/useTreeRootId.js +3 -1
  62. package/dist/development/accessorPropagation/useTreeRootId.js.map +1 -1
  63. package/dist/development/accessorSorting/SetOrderFieldOnCreate.js +84 -44
  64. package/dist/development/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  65. package/dist/development/accessorSorting/addEntityAtIndex.js +3 -1
  66. package/dist/development/accessorSorting/addEntityAtIndex.js.map +1 -1
  67. package/dist/development/accessorSorting/errors.js +6 -2
  68. package/dist/development/accessorSorting/errors.js.map +1 -1
  69. package/dist/development/accessorSorting/moveEntity.js +4 -1
  70. package/dist/development/accessorSorting/moveEntity.js.map +1 -1
  71. package/dist/development/accessorSorting/repairEntitiesOrder.js +3 -1
  72. package/dist/development/accessorSorting/repairEntitiesOrder.js.map +1 -1
  73. package/dist/development/accessorSorting/sortEntities.js +3 -1
  74. package/dist/development/accessorSorting/sortEntities.js.map +1 -1
  75. package/dist/development/accessorSorting/useSortedEntities.js +61 -23
  76. package/dist/development/accessorSorting/useSortedEntities.js.map +1 -1
  77. package/dist/development/accessorTree/AccessorTree.js +45 -14
  78. package/dist/development/accessorTree/AccessorTree.js.map +1 -1
  79. package/dist/development/accessorTree/AccessorTreeStateContext.js +3 -1
  80. package/dist/development/accessorTree/AccessorTreeStateContext.js.map +1 -1
  81. package/dist/development/accessorTree/DirtinessContext.js +3 -1
  82. package/dist/development/accessorTree/DirtinessContext.js.map +1 -1
  83. package/dist/development/accessorTree/MutationStateContext.js +3 -1
  84. package/dist/development/accessorTree/MutationStateContext.js.map +1 -1
  85. package/dist/development/accessorTree/NormalizedPersistedData.js +3 -1
  86. package/dist/development/accessorTree/NormalizedPersistedData.js.map +1 -1
  87. package/dist/development/accessorTree/RuntimeId.js +8 -2
  88. package/dist/development/accessorTree/RuntimeId.js.map +1 -1
  89. package/dist/development/accessorTree/accessorTreeStateReducer.js +3 -1
  90. package/dist/development/accessorTree/accessorTreeStateReducer.js.map +1 -1
  91. package/dist/development/accessorTree/metadataToRequestError.js +3 -1
  92. package/dist/development/accessorTree/metadataToRequestError.js.map +1 -1
  93. package/dist/development/accessorTree/useAccessorTreeState.js +3 -1
  94. package/dist/development/accessorTree/useAccessorTreeState.js.map +1 -1
  95. package/dist/development/accessorTree/useDataBinding.js +3 -1
  96. package/dist/development/accessorTree/useDataBinding.js.map +1 -1
  97. package/dist/development/accessorTree/useDirtinessState.js +3 -1
  98. package/dist/development/accessorTree/useDirtinessState.js.map +1 -1
  99. package/dist/development/accessorTree/useMutationState.js +3 -1
  100. package/dist/development/accessorTree/useMutationState.js.map +1 -1
  101. package/dist/development/accessors/EntityAccessor.js +16 -6
  102. package/dist/development/accessors/EntityAccessor.js.map +1 -1
  103. package/dist/development/accessors/EntityListAccessor.js +3 -1
  104. package/dist/development/accessors/EntityListAccessor.js.map +1 -1
  105. package/dist/development/accessors/ErrorAccessor.js +3 -1
  106. package/dist/development/accessors/ErrorAccessor.js.map +1 -1
  107. package/dist/development/accessors/FieldAccessor.js +3 -1
  108. package/dist/development/accessors/FieldAccessor.js.map +1 -1
  109. package/dist/development/accessors/TreeRootAccessor.js +3 -1
  110. package/dist/development/accessors/TreeRootAccessor.js.map +1 -1
  111. package/dist/development/bindingTypes.js +5 -1
  112. package/dist/development/bindingTypes.js.map +1 -1
  113. package/dist/development/core/AccessorErrorManager.js +3 -1
  114. package/dist/development/core/AccessorErrorManager.js.map +1 -1
  115. package/dist/development/core/Config.js +3 -1
  116. package/dist/development/core/Config.js.map +1 -1
  117. package/dist/development/core/DataBinding.js +42 -14
  118. package/dist/development/core/DataBinding.js.map +1 -1
  119. package/dist/development/core/DirtinessTracker.js +3 -1
  120. package/dist/development/core/DirtinessTracker.js.map +1 -1
  121. package/dist/development/core/ErrorsPreprocessor.js +12 -4
  122. package/dist/development/core/ErrorsPreprocessor.js.map +1 -1
  123. package/dist/development/core/EventManager.js +21 -7
  124. package/dist/development/core/EventManager.js.map +1 -1
  125. package/dist/development/core/IncrementalMarkerBuilder.js +35 -7
  126. package/dist/development/core/IncrementalMarkerBuilder.js.map +1 -1
  127. package/dist/development/core/MarkerComparator.js +7 -2
  128. package/dist/development/core/MarkerComparator.js.map +1 -1
  129. package/dist/development/core/MarkerMerger.js +51 -12
  130. package/dist/development/core/MarkerMerger.js.map +1 -1
  131. package/dist/development/core/MarkerTreeGenerator.js +11 -3
  132. package/dist/development/core/MarkerTreeGenerator.js.map +1 -1
  133. package/dist/development/core/MutationGenerator.js +121 -25
  134. package/dist/development/core/MutationGenerator.js.map +1 -1
  135. package/dist/development/core/QueryGenerator.js +40 -9
  136. package/dist/development/core/QueryGenerator.js.map +1 -1
  137. package/dist/development/core/RealmKeyGenerator.js +12 -3
  138. package/dist/development/core/RealmKeyGenerator.js.map +1 -1
  139. package/dist/development/core/RequestResponseNormalizer.js +3 -1
  140. package/dist/development/core/RequestResponseNormalizer.js.map +1 -1
  141. package/dist/development/core/StateInitializer.js +89 -23
  142. package/dist/development/core/StateInitializer.js.map +1 -1
  143. package/dist/development/core/TreeAugmenter.js +21 -4
  144. package/dist/development/core/TreeAugmenter.js.map +1 -1
  145. package/dist/development/core/TreeFilterGenerator.js +8 -2
  146. package/dist/development/core/TreeFilterGenerator.js.map +1 -1
  147. package/dist/development/core/TreeParameterMerger.js +25 -7
  148. package/dist/development/core/TreeParameterMerger.js.map +1 -1
  149. package/dist/development/core/TreeStore.js +20 -4
  150. package/dist/development/core/TreeStore.js.map +1 -1
  151. package/dist/development/core/VariableInputTransformer.js +3 -1
  152. package/dist/development/core/VariableInputTransformer.js.map +1 -1
  153. package/dist/development/core/exceptions/ErrorLocator.js +11 -3
  154. package/dist/development/core/exceptions/ErrorLocator.js.map +1 -1
  155. package/dist/development/core/exceptions/LocalizedBindingError.js +3 -1
  156. package/dist/development/core/exceptions/LocalizedBindingError.js.map +1 -1
  157. package/dist/development/core/exceptions/MarkerSugarer.js +8 -2
  158. package/dist/development/core/exceptions/MarkerSugarer.js.map +1 -1
  159. package/dist/development/core/exceptions/TreeParameterSugarer.js +3 -1
  160. package/dist/development/core/exceptions/TreeParameterSugarer.js.map +1 -1
  161. package/dist/development/core/factories/createBatchUpdatesOptions.js +3 -1
  162. package/dist/development/core/factories/createBatchUpdatesOptions.js.map +1 -1
  163. package/dist/development/core/operations/EntityOperations.js +45 -14
  164. package/dist/development/core/operations/EntityOperations.js.map +1 -1
  165. package/dist/development/core/operations/FieldOperations.js +22 -8
  166. package/dist/development/core/operations/FieldOperations.js.map +1 -1
  167. package/dist/development/core/operations/ListOperations.js +22 -9
  168. package/dist/development/core/operations/ListOperations.js.map +1 -1
  169. package/dist/development/core/operations/OperationsHelpers.js +6 -2
  170. package/dist/development/core/operations/OperationsHelpers.js.map +1 -1
  171. package/dist/development/core/requestAliases/MutationAlias.js +3 -1
  172. package/dist/development/core/requestAliases/MutationAlias.js.map +1 -1
  173. package/dist/development/core/schema/Schema.js +3 -1
  174. package/dist/development/core/schema/Schema.js.map +1 -1
  175. package/dist/development/core/schema/SchemaLoader.js +3 -1
  176. package/dist/development/core/schema/SchemaLoader.js.map +1 -1
  177. package/dist/development/core/schema/SchemaPreprocessor.js +3 -1
  178. package/dist/development/core/schema/SchemaPreprocessor.js.map +1 -1
  179. package/dist/development/core/state/StateIterator.js +3 -1
  180. package/dist/development/core/state/StateIterator.js.map +1 -1
  181. package/dist/development/core/state/getEntityMarker.js +3 -1
  182. package/dist/development/core/state/getEntityMarker.js.map +1 -1
  183. package/dist/development/core/utils/getCombinedSignal.js +3 -1
  184. package/dist/development/core/utils/getCombinedSignal.js.map +1 -1
  185. package/dist/development/coreComponents/Component.js +3 -1
  186. package/dist/development/coreComponents/Component.js.map +1 -1
  187. package/dist/development/coreComponents/DataBindingProvider.js +13 -4
  188. package/dist/development/coreComponents/DataBindingProvider.js.map +1 -1
  189. package/dist/development/coreComponents/Entity.js +16 -6
  190. package/dist/development/coreComponents/Entity.js.map +1 -1
  191. package/dist/development/coreComponents/EntityList.js +21 -9
  192. package/dist/development/coreComponents/EntityList.js.map +1 -1
  193. package/dist/development/coreComponents/EntityListSubTree.js +26 -9
  194. package/dist/development/coreComponents/EntityListSubTree.js.map +1 -1
  195. package/dist/development/coreComponents/EntitySubTree.js +37 -14
  196. package/dist/development/coreComponents/EntitySubTree.js.map +1 -1
  197. package/dist/development/coreComponents/Field.js +10 -4
  198. package/dist/development/coreComponents/Field.js.map +1 -1
  199. package/dist/development/coreComponents/HasMany.js +25 -9
  200. package/dist/development/coreComponents/HasMany.js.map +1 -1
  201. package/dist/development/coreComponents/HasOne.js +25 -9
  202. package/dist/development/coreComponents/HasOne.js.map +1 -1
  203. package/dist/development/coreComponents/ParentEntity.js +7 -3
  204. package/dist/development/coreComponents/ParentEntity.js.map +1 -1
  205. package/dist/development/dao/Environment.js +3 -1
  206. package/dist/development/dao/Environment.js.map +1 -1
  207. package/dist/development/dao/TreeNodeEnvironmentFactory.js +10 -3
  208. package/dist/development/dao/TreeNodeEnvironmentFactory.js.map +1 -1
  209. package/dist/development/dao/VariableFieldValue.js +3 -1
  210. package/dist/development/dao/VariableFieldValue.js.map +1 -1
  211. package/dist/development/entityEvents/useDerivedField.js +25 -17
  212. package/dist/development/entityEvents/useDerivedField.js.map +1 -1
  213. package/dist/development/entityEvents/useEntityBeforePersist.js +3 -1
  214. package/dist/development/entityEvents/useEntityBeforePersist.js.map +1 -1
  215. package/dist/development/entityEvents/useEntityBeforeUpdate.js +3 -1
  216. package/dist/development/entityEvents/useEntityBeforeUpdate.js.map +1 -1
  217. package/dist/development/entityEvents/useEntityEvent.js +16 -8
  218. package/dist/development/entityEvents/useEntityEvent.js.map +1 -1
  219. package/dist/development/entityEvents/useEntityPersistError.js +3 -1
  220. package/dist/development/entityEvents/useEntityPersistError.js.map +1 -1
  221. package/dist/development/entityEvents/useEntityPersistSuccess.js +3 -1
  222. package/dist/development/entityEvents/useEntityPersistSuccess.js.map +1 -1
  223. package/dist/development/entityEvents/useOnConnectionUpdate.js +3 -1
  224. package/dist/development/entityEvents/useOnConnectionUpdate.js.map +1 -1
  225. package/dist/development/fieldHelpers/helpers/FieldHelper.js +3 -1
  226. package/dist/development/fieldHelpers/helpers/FieldHelper.js.map +1 -1
  227. package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.js +3 -1
  228. package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -1
  229. package/dist/development/fieldHelpers/helpers/UuidFieldHelper.js +3 -1
  230. package/dist/development/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -1
  231. package/dist/development/helperComponents/DeferredSubTrees.js +46 -13
  232. package/dist/development/helperComponents/DeferredSubTrees.js.map +1 -1
  233. package/dist/development/helperComponents/EntityView.js +7 -3
  234. package/dist/development/helperComponents/EntityView.js.map +1 -1
  235. package/dist/development/helperComponents/FieldView.js +22 -8
  236. package/dist/development/helperComponents/FieldView.js.map +1 -1
  237. package/dist/development/helperComponents/If.js +57 -19
  238. package/dist/development/helperComponents/If.js.map +1 -1
  239. package/dist/development/helperComponents/StaticRender.js +9 -3
  240. package/dist/development/helperComponents/StaticRender.js.map +1 -1
  241. package/dist/development/helperComponents/SugaredField.js +17 -6
  242. package/dist/development/helperComponents/SugaredField.js.map +1 -1
  243. package/dist/development/helperComponents/helpers/FilterEvaluator.js +3 -1
  244. package/dist/development/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  245. package/dist/development/helperComponents/helpers/FilterFieldsCollector.js +3 -1
  246. package/dist/development/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
  247. package/dist/development/helperComponents/helpers/evaluateCondition.js +3 -1
  248. package/dist/development/helperComponents/helpers/evaluateCondition.js.map +1 -1
  249. package/dist/development/index.js +225 -106
  250. package/dist/development/markers/EntityFieldMarkersContainer.js +3 -1
  251. package/dist/development/markers/EntityFieldMarkersContainer.js.map +1 -1
  252. package/dist/development/markers/EntityFieldsWithHoistablesMarker.js +3 -1
  253. package/dist/development/markers/EntityFieldsWithHoistablesMarker.js.map +1 -1
  254. package/dist/development/markers/EntityListSubTreeMarker.js +3 -1
  255. package/dist/development/markers/EntityListSubTreeMarker.js.map +1 -1
  256. package/dist/development/markers/EntitySubTreeMarker.js +3 -1
  257. package/dist/development/markers/EntitySubTreeMarker.js.map +1 -1
  258. package/dist/development/markers/FieldMarker.js +3 -1
  259. package/dist/development/markers/FieldMarker.js.map +1 -1
  260. package/dist/development/markers/HasManyRelationMarker.js +3 -1
  261. package/dist/development/markers/HasManyRelationMarker.js.map +1 -1
  262. package/dist/development/markers/HasOneRelationMarker.js +3 -1
  263. package/dist/development/markers/HasOneRelationMarker.js.map +1 -1
  264. package/dist/development/markers/MarkerTreeRoot.js +3 -1
  265. package/dist/development/markers/MarkerTreeRoot.js.map +1 -1
  266. package/dist/development/markers/ParentEntityMarker.js +3 -1
  267. package/dist/development/markers/ParentEntityMarker.js.map +1 -1
  268. package/dist/development/markers/PlaceholderGenerator.js +3 -1
  269. package/dist/development/markers/PlaceholderGenerator.js.map +1 -1
  270. package/dist/development/queryLanguage/CacheStore.js +3 -1
  271. package/dist/development/queryLanguage/CacheStore.js.map +1 -1
  272. package/dist/development/queryLanguage/MarkerFactory.js +115 -23
  273. package/dist/development/queryLanguage/MarkerFactory.js.map +1 -1
  274. package/dist/development/queryLanguage/Parser.js +114 -79
  275. package/dist/development/queryLanguage/Parser.js.map +1 -1
  276. package/dist/development/queryLanguage/QueryLanguage.js +72 -19
  277. package/dist/development/queryLanguage/QueryLanguage.js.map +1 -1
  278. package/dist/development/queryLanguage/QueryLanguageError.js +3 -1
  279. package/dist/development/queryLanguage/QueryLanguageError.js.map +1 -1
  280. package/dist/development/queryLanguage/tokenList.js +5 -1
  281. package/dist/development/queryLanguage/tokenList.js.map +1 -1
  282. package/dist/development/structures/BijectiveIndexedMap.js +3 -1
  283. package/dist/development/structures/BijectiveIndexedMap.js.map +1 -1
  284. package/dist/development/structures/LRUCache.js +3 -1
  285. package/dist/development/structures/LRUCache.js.map +1 -1
  286. package/dist/development/structures/WeakIdCache.js +3 -1
  287. package/dist/development/structures/WeakIdCache.js.map +1 -1
  288. package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.js +3 -1
  289. package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.js.map +1 -1
  290. package/dist/development/treeParameters/EntityCreationParameters.js +3 -1
  291. package/dist/development/treeParameters/EntityCreationParameters.js.map +1 -1
  292. package/dist/development/treeParameters/EntityListPreferences.js +3 -1
  293. package/dist/development/treeParameters/EntityListPreferences.js.map +1 -1
  294. package/dist/development/treeParameters/EventListenersStore.js +3 -1
  295. package/dist/development/treeParameters/EventListenersStore.js.map +1 -1
  296. package/dist/development/treeParameters/LeafField.js +3 -1
  297. package/dist/development/treeParameters/LeafField.js.map +1 -1
  298. package/dist/development/treeParameters/QualifiedEntityParameters.js +3 -1
  299. package/dist/development/treeParameters/QualifiedEntityParameters.js.map +1 -1
  300. package/dist/development/treeParameters/Relation.js +3 -1
  301. package/dist/development/treeParameters/Relation.js.map +1 -1
  302. package/dist/development/utils/Hashing.js +3 -1
  303. package/dist/development/utils/Hashing.js.map +1 -1
  304. package/dist/development/utils/assert.js +3 -1
  305. package/dist/development/utils/assert.js.map +1 -1
  306. package/dist/development/utils/assertNever.js +6 -2
  307. package/dist/development/utils/assertNever.js.map +1 -1
  308. package/dist/development/utils/generateEnumerabilityPreventingEntropy.js +3 -1
  309. package/dist/development/utils/generateEnumerabilityPreventingEntropy.js.map +1 -1
  310. package/dist/development/utils/isEmptyObject.js +3 -1
  311. package/dist/development/utils/isEmptyObject.js.map +1 -1
  312. package/dist/development/utils/ucfirst.js +3 -1
  313. package/dist/development/utils/ucfirst.js.map +1 -1
  314. package/dist/production/BindingError.js +4 -1
  315. package/dist/production/BindingError.js.map +1 -1
  316. package/dist/production/accessorPropagation/AccessorProvider.js +11 -7
  317. package/dist/production/accessorPropagation/AccessorProvider.js.map +1 -1
  318. package/dist/production/accessorPropagation/BindingOperationsContext.js +7 -2
  319. package/dist/production/accessorPropagation/BindingOperationsContext.js.map +1 -1
  320. package/dist/production/accessorPropagation/BindingOperationsProvider.js +8 -5
  321. package/dist/production/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  322. package/dist/production/accessorPropagation/EntityKeyContext.js +3 -1
  323. package/dist/production/accessorPropagation/EntityKeyContext.js.map +1 -1
  324. package/dist/production/accessorPropagation/EntityKeyProvider.js +8 -5
  325. package/dist/production/accessorPropagation/EntityKeyProvider.js.map +1 -1
  326. package/dist/production/accessorPropagation/EnvironmentContext.js +42 -17
  327. package/dist/production/accessorPropagation/EnvironmentContext.js.map +1 -1
  328. package/dist/production/accessorPropagation/TreeRootIdContext.js +3 -1
  329. package/dist/production/accessorPropagation/TreeRootIdContext.js.map +1 -1
  330. package/dist/production/accessorPropagation/TreeRootIdProvider.js +8 -5
  331. package/dist/production/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  332. package/dist/production/accessorPropagation/useAccessorUpdateSubscription.js +3 -1
  333. package/dist/production/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
  334. package/dist/production/accessorPropagation/useBindingOperations.js +3 -1
  335. package/dist/production/accessorPropagation/useBindingOperations.js.map +1 -1
  336. package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js +26 -18
  337. package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
  338. package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js +14 -6
  339. package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
  340. package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js +14 -6
  341. package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
  342. package/dist/production/accessorPropagation/useEntity.js +7 -2
  343. package/dist/production/accessorPropagation/useEntity.js.map +1 -1
  344. package/dist/production/accessorPropagation/useEntityKey.js +6 -2
  345. package/dist/production/accessorPropagation/useEntityKey.js.map +1 -1
  346. package/dist/production/accessorPropagation/useEntityList.js +11 -3
  347. package/dist/production/accessorPropagation/useEntityList.js.map +1 -1
  348. package/dist/production/accessorPropagation/useEntityListSubTree.js +7 -2
  349. package/dist/production/accessorPropagation/useEntityListSubTree.js.map +1 -1
  350. package/dist/production/accessorPropagation/useEntityListSubTreeParameters.js +50 -30
  351. package/dist/production/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
  352. package/dist/production/accessorPropagation/useEntitySubTree.js +7 -2
  353. package/dist/production/accessorPropagation/useEntitySubTree.js.map +1 -1
  354. package/dist/production/accessorPropagation/useEntitySubTreeParameters.js +27 -16
  355. package/dist/production/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
  356. package/dist/production/accessorPropagation/useEnvironment.js +3 -1
  357. package/dist/production/accessorPropagation/useEnvironment.js.map +1 -1
  358. package/dist/production/accessorPropagation/useExtendTree.js +7 -2
  359. package/dist/production/accessorPropagation/useExtendTree.js.map +1 -1
  360. package/dist/production/accessorPropagation/useField.js +11 -3
  361. package/dist/production/accessorPropagation/useField.js.map +1 -1
  362. package/dist/production/accessorPropagation/useGetEntityByKey.js +3 -1
  363. package/dist/production/accessorPropagation/useGetEntityByKey.js.map +1 -1
  364. package/dist/production/accessorPropagation/useGetEntityListSubTree.js +7 -2
  365. package/dist/production/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
  366. package/dist/production/accessorPropagation/useGetEntitySubTree.js +7 -2
  367. package/dist/production/accessorPropagation/useGetEntitySubTree.js.map +1 -1
  368. package/dist/production/accessorPropagation/useGetTreeFilters.js +3 -1
  369. package/dist/production/accessorPropagation/useGetTreeFilters.js.map +1 -1
  370. package/dist/production/accessorPropagation/useHasEntity.js +3 -1
  371. package/dist/production/accessorPropagation/useHasEntity.js.map +1 -1
  372. package/dist/production/accessorPropagation/usePersist.js +3 -1
  373. package/dist/production/accessorPropagation/usePersist.js.map +1 -1
  374. package/dist/production/accessorPropagation/useTreeRootId.js +3 -1
  375. package/dist/production/accessorPropagation/useTreeRootId.js.map +1 -1
  376. package/dist/production/accessorSorting/SetOrderFieldOnCreate.js +55 -44
  377. package/dist/production/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  378. package/dist/production/accessorSorting/addEntityAtIndex.js +3 -1
  379. package/dist/production/accessorSorting/addEntityAtIndex.js.map +1 -1
  380. package/dist/production/accessorSorting/errors.js +6 -2
  381. package/dist/production/accessorSorting/errors.js.map +1 -1
  382. package/dist/production/accessorSorting/moveEntity.js +4 -1
  383. package/dist/production/accessorSorting/moveEntity.js.map +1 -1
  384. package/dist/production/accessorSorting/repairEntitiesOrder.js +3 -1
  385. package/dist/production/accessorSorting/repairEntitiesOrder.js.map +1 -1
  386. package/dist/production/accessorSorting/sortEntities.js +3 -1
  387. package/dist/production/accessorSorting/sortEntities.js.map +1 -1
  388. package/dist/production/accessorSorting/useSortedEntities.js +61 -23
  389. package/dist/production/accessorSorting/useSortedEntities.js.map +1 -1
  390. package/dist/production/accessorTree/AccessorTree.js +24 -14
  391. package/dist/production/accessorTree/AccessorTree.js.map +1 -1
  392. package/dist/production/accessorTree/AccessorTreeStateContext.js +3 -1
  393. package/dist/production/accessorTree/AccessorTreeStateContext.js.map +1 -1
  394. package/dist/production/accessorTree/DirtinessContext.js +3 -1
  395. package/dist/production/accessorTree/DirtinessContext.js.map +1 -1
  396. package/dist/production/accessorTree/MutationStateContext.js +3 -1
  397. package/dist/production/accessorTree/MutationStateContext.js.map +1 -1
  398. package/dist/production/accessorTree/NormalizedPersistedData.js +3 -1
  399. package/dist/production/accessorTree/NormalizedPersistedData.js.map +1 -1
  400. package/dist/production/accessorTree/RuntimeId.js +8 -2
  401. package/dist/production/accessorTree/RuntimeId.js.map +1 -1
  402. package/dist/production/accessorTree/accessorTreeStateReducer.js +3 -1
  403. package/dist/production/accessorTree/accessorTreeStateReducer.js.map +1 -1
  404. package/dist/production/accessorTree/metadataToRequestError.js +3 -1
  405. package/dist/production/accessorTree/metadataToRequestError.js.map +1 -1
  406. package/dist/production/accessorTree/useAccessorTreeState.js +3 -1
  407. package/dist/production/accessorTree/useAccessorTreeState.js.map +1 -1
  408. package/dist/production/accessorTree/useDataBinding.js +3 -1
  409. package/dist/production/accessorTree/useDataBinding.js.map +1 -1
  410. package/dist/production/accessorTree/useDirtinessState.js +3 -1
  411. package/dist/production/accessorTree/useDirtinessState.js.map +1 -1
  412. package/dist/production/accessorTree/useMutationState.js +3 -1
  413. package/dist/production/accessorTree/useMutationState.js.map +1 -1
  414. package/dist/production/accessors/EntityAccessor.js +16 -6
  415. package/dist/production/accessors/EntityAccessor.js.map +1 -1
  416. package/dist/production/accessors/EntityListAccessor.js +3 -1
  417. package/dist/production/accessors/EntityListAccessor.js.map +1 -1
  418. package/dist/production/accessors/ErrorAccessor.js +3 -1
  419. package/dist/production/accessors/ErrorAccessor.js.map +1 -1
  420. package/dist/production/accessors/FieldAccessor.js +3 -1
  421. package/dist/production/accessors/FieldAccessor.js.map +1 -1
  422. package/dist/production/accessors/TreeRootAccessor.js +3 -1
  423. package/dist/production/accessors/TreeRootAccessor.js.map +1 -1
  424. package/dist/production/bindingTypes.js +5 -1
  425. package/dist/production/bindingTypes.js.map +1 -1
  426. package/dist/production/core/AccessorErrorManager.js +3 -1
  427. package/dist/production/core/AccessorErrorManager.js.map +1 -1
  428. package/dist/production/core/Config.js +3 -1
  429. package/dist/production/core/Config.js.map +1 -1
  430. package/dist/production/core/DataBinding.js +42 -14
  431. package/dist/production/core/DataBinding.js.map +1 -1
  432. package/dist/production/core/DirtinessTracker.js +3 -1
  433. package/dist/production/core/DirtinessTracker.js.map +1 -1
  434. package/dist/production/core/ErrorsPreprocessor.js +12 -4
  435. package/dist/production/core/ErrorsPreprocessor.js.map +1 -1
  436. package/dist/production/core/EventManager.js +9 -3
  437. package/dist/production/core/EventManager.js.map +1 -1
  438. package/dist/production/core/IncrementalMarkerBuilder.js +35 -7
  439. package/dist/production/core/IncrementalMarkerBuilder.js.map +1 -1
  440. package/dist/production/core/MarkerComparator.js +7 -2
  441. package/dist/production/core/MarkerComparator.js.map +1 -1
  442. package/dist/production/core/MarkerMerger.js +51 -12
  443. package/dist/production/core/MarkerMerger.js.map +1 -1
  444. package/dist/production/core/MarkerTreeGenerator.js +11 -3
  445. package/dist/production/core/MarkerTreeGenerator.js.map +1 -1
  446. package/dist/production/core/MutationGenerator.js +121 -25
  447. package/dist/production/core/MutationGenerator.js.map +1 -1
  448. package/dist/production/core/QueryGenerator.js +40 -9
  449. package/dist/production/core/QueryGenerator.js.map +1 -1
  450. package/dist/production/core/RealmKeyGenerator.js +12 -3
  451. package/dist/production/core/RealmKeyGenerator.js.map +1 -1
  452. package/dist/production/core/RequestResponseNormalizer.js +3 -1
  453. package/dist/production/core/RequestResponseNormalizer.js.map +1 -1
  454. package/dist/production/core/StateInitializer.js +89 -23
  455. package/dist/production/core/StateInitializer.js.map +1 -1
  456. package/dist/production/core/TreeAugmenter.js +21 -4
  457. package/dist/production/core/TreeAugmenter.js.map +1 -1
  458. package/dist/production/core/TreeFilterGenerator.js +8 -2
  459. package/dist/production/core/TreeFilterGenerator.js.map +1 -1
  460. package/dist/production/core/TreeParameterMerger.js +25 -7
  461. package/dist/production/core/TreeParameterMerger.js.map +1 -1
  462. package/dist/production/core/TreeStore.js +20 -4
  463. package/dist/production/core/TreeStore.js.map +1 -1
  464. package/dist/production/core/VariableInputTransformer.js +3 -1
  465. package/dist/production/core/VariableInputTransformer.js.map +1 -1
  466. package/dist/production/core/exceptions/ErrorLocator.js +11 -3
  467. package/dist/production/core/exceptions/ErrorLocator.js.map +1 -1
  468. package/dist/production/core/exceptions/LocalizedBindingError.js +3 -1
  469. package/dist/production/core/exceptions/LocalizedBindingError.js.map +1 -1
  470. package/dist/production/core/exceptions/MarkerSugarer.js +8 -2
  471. package/dist/production/core/exceptions/MarkerSugarer.js.map +1 -1
  472. package/dist/production/core/exceptions/TreeParameterSugarer.js +3 -1
  473. package/dist/production/core/exceptions/TreeParameterSugarer.js.map +1 -1
  474. package/dist/production/core/factories/createBatchUpdatesOptions.js +3 -1
  475. package/dist/production/core/factories/createBatchUpdatesOptions.js.map +1 -1
  476. package/dist/production/core/operations/EntityOperations.js +45 -14
  477. package/dist/production/core/operations/EntityOperations.js.map +1 -1
  478. package/dist/production/core/operations/FieldOperations.js +11 -3
  479. package/dist/production/core/operations/FieldOperations.js.map +1 -1
  480. package/dist/production/core/operations/ListOperations.js +22 -9
  481. package/dist/production/core/operations/ListOperations.js.map +1 -1
  482. package/dist/production/core/operations/OperationsHelpers.js +6 -2
  483. package/dist/production/core/operations/OperationsHelpers.js.map +1 -1
  484. package/dist/production/core/requestAliases/MutationAlias.js +3 -1
  485. package/dist/production/core/requestAliases/MutationAlias.js.map +1 -1
  486. package/dist/production/core/schema/Schema.js +3 -1
  487. package/dist/production/core/schema/Schema.js.map +1 -1
  488. package/dist/production/core/schema/SchemaLoader.js +3 -1
  489. package/dist/production/core/schema/SchemaLoader.js.map +1 -1
  490. package/dist/production/core/schema/SchemaPreprocessor.js +3 -1
  491. package/dist/production/core/schema/SchemaPreprocessor.js.map +1 -1
  492. package/dist/production/core/state/StateIterator.js +3 -1
  493. package/dist/production/core/state/StateIterator.js.map +1 -1
  494. package/dist/production/core/state/getEntityMarker.js +3 -1
  495. package/dist/production/core/state/getEntityMarker.js.map +1 -1
  496. package/dist/production/core/utils/getCombinedSignal.js +3 -1
  497. package/dist/production/core/utils/getCombinedSignal.js.map +1 -1
  498. package/dist/production/coreComponents/Component.js +3 -1
  499. package/dist/production/coreComponents/Component.js.map +1 -1
  500. package/dist/production/coreComponents/DataBindingProvider.js +8 -4
  501. package/dist/production/coreComponents/DataBindingProvider.js.map +1 -1
  502. package/dist/production/coreComponents/Entity.js +11 -6
  503. package/dist/production/coreComponents/Entity.js.map +1 -1
  504. package/dist/production/coreComponents/EntityList.js +16 -9
  505. package/dist/production/coreComponents/EntityList.js.map +1 -1
  506. package/dist/production/coreComponents/EntityListSubTree.js +12 -8
  507. package/dist/production/coreComponents/EntityListSubTree.js.map +1 -1
  508. package/dist/production/coreComponents/EntitySubTree.js +19 -13
  509. package/dist/production/coreComponents/EntitySubTree.js.map +1 -1
  510. package/dist/production/coreComponents/Field.js +10 -4
  511. package/dist/production/coreComponents/Field.js.map +1 -1
  512. package/dist/production/coreComponents/HasMany.js +11 -8
  513. package/dist/production/coreComponents/HasMany.js.map +1 -1
  514. package/dist/production/coreComponents/HasOne.js +11 -8
  515. package/dist/production/coreComponents/HasOne.js.map +1 -1
  516. package/dist/production/coreComponents/ParentEntity.js +7 -3
  517. package/dist/production/coreComponents/ParentEntity.js.map +1 -1
  518. package/dist/production/dao/Environment.js +3 -1
  519. package/dist/production/dao/Environment.js.map +1 -1
  520. package/dist/production/dao/TreeNodeEnvironmentFactory.js +10 -3
  521. package/dist/production/dao/TreeNodeEnvironmentFactory.js.map +1 -1
  522. package/dist/production/dao/VariableFieldValue.js +3 -1
  523. package/dist/production/dao/VariableFieldValue.js.map +1 -1
  524. package/dist/production/entityEvents/useDerivedField.js +25 -17
  525. package/dist/production/entityEvents/useDerivedField.js.map +1 -1
  526. package/dist/production/entityEvents/useEntityBeforePersist.js +3 -1
  527. package/dist/production/entityEvents/useEntityBeforePersist.js.map +1 -1
  528. package/dist/production/entityEvents/useEntityBeforeUpdate.js +3 -1
  529. package/dist/production/entityEvents/useEntityBeforeUpdate.js.map +1 -1
  530. package/dist/production/entityEvents/useEntityEvent.js +16 -8
  531. package/dist/production/entityEvents/useEntityEvent.js.map +1 -1
  532. package/dist/production/entityEvents/useEntityPersistError.js +3 -1
  533. package/dist/production/entityEvents/useEntityPersistError.js.map +1 -1
  534. package/dist/production/entityEvents/useEntityPersistSuccess.js +3 -1
  535. package/dist/production/entityEvents/useEntityPersistSuccess.js.map +1 -1
  536. package/dist/production/entityEvents/useOnConnectionUpdate.js +3 -1
  537. package/dist/production/entityEvents/useOnConnectionUpdate.js.map +1 -1
  538. package/dist/production/fieldHelpers/helpers/FieldHelper.js +3 -1
  539. package/dist/production/fieldHelpers/helpers/FieldHelper.js.map +1 -1
  540. package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.js +3 -1
  541. package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -1
  542. package/dist/production/fieldHelpers/helpers/UuidFieldHelper.js +3 -1
  543. package/dist/production/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -1
  544. package/dist/production/helperComponents/DeferredSubTrees.js +37 -13
  545. package/dist/production/helperComponents/DeferredSubTrees.js.map +1 -1
  546. package/dist/production/helperComponents/EntityView.js +7 -3
  547. package/dist/production/helperComponents/EntityView.js.map +1 -1
  548. package/dist/production/helperComponents/FieldView.js +17 -8
  549. package/dist/production/helperComponents/FieldView.js.map +1 -1
  550. package/dist/production/helperComponents/If.js +44 -19
  551. package/dist/production/helperComponents/If.js.map +1 -1
  552. package/dist/production/helperComponents/StaticRender.js +9 -3
  553. package/dist/production/helperComponents/StaticRender.js.map +1 -1
  554. package/dist/production/helperComponents/SugaredField.js +6 -4
  555. package/dist/production/helperComponents/SugaredField.js.map +1 -1
  556. package/dist/production/helperComponents/helpers/FilterEvaluator.js +3 -1
  557. package/dist/production/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  558. package/dist/production/helperComponents/helpers/FilterFieldsCollector.js +3 -1
  559. package/dist/production/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
  560. package/dist/production/helperComponents/helpers/evaluateCondition.js +3 -1
  561. package/dist/production/helperComponents/helpers/evaluateCondition.js.map +1 -1
  562. package/dist/production/index.js +225 -106
  563. package/dist/production/markers/EntityFieldMarkersContainer.js +3 -1
  564. package/dist/production/markers/EntityFieldMarkersContainer.js.map +1 -1
  565. package/dist/production/markers/EntityFieldsWithHoistablesMarker.js +3 -1
  566. package/dist/production/markers/EntityFieldsWithHoistablesMarker.js.map +1 -1
  567. package/dist/production/markers/EntityListSubTreeMarker.js +3 -1
  568. package/dist/production/markers/EntityListSubTreeMarker.js.map +1 -1
  569. package/dist/production/markers/EntitySubTreeMarker.js +3 -1
  570. package/dist/production/markers/EntitySubTreeMarker.js.map +1 -1
  571. package/dist/production/markers/FieldMarker.js +3 -1
  572. package/dist/production/markers/FieldMarker.js.map +1 -1
  573. package/dist/production/markers/HasManyRelationMarker.js +3 -1
  574. package/dist/production/markers/HasManyRelationMarker.js.map +1 -1
  575. package/dist/production/markers/HasOneRelationMarker.js +3 -1
  576. package/dist/production/markers/HasOneRelationMarker.js.map +1 -1
  577. package/dist/production/markers/MarkerTreeRoot.js +3 -1
  578. package/dist/production/markers/MarkerTreeRoot.js.map +1 -1
  579. package/dist/production/markers/ParentEntityMarker.js +3 -1
  580. package/dist/production/markers/ParentEntityMarker.js.map +1 -1
  581. package/dist/production/markers/PlaceholderGenerator.js +3 -1
  582. package/dist/production/markers/PlaceholderGenerator.js.map +1 -1
  583. package/dist/production/queryLanguage/CacheStore.js +3 -1
  584. package/dist/production/queryLanguage/CacheStore.js.map +1 -1
  585. package/dist/production/queryLanguage/MarkerFactory.js +115 -23
  586. package/dist/production/queryLanguage/MarkerFactory.js.map +1 -1
  587. package/dist/production/queryLanguage/Parser.js +114 -79
  588. package/dist/production/queryLanguage/Parser.js.map +1 -1
  589. package/dist/production/queryLanguage/QueryLanguage.js +72 -19
  590. package/dist/production/queryLanguage/QueryLanguage.js.map +1 -1
  591. package/dist/production/queryLanguage/QueryLanguageError.js +3 -1
  592. package/dist/production/queryLanguage/QueryLanguageError.js.map +1 -1
  593. package/dist/production/queryLanguage/tokenList.js +5 -1
  594. package/dist/production/queryLanguage/tokenList.js.map +1 -1
  595. package/dist/production/structures/BijectiveIndexedMap.js +3 -1
  596. package/dist/production/structures/BijectiveIndexedMap.js.map +1 -1
  597. package/dist/production/structures/LRUCache.js +3 -1
  598. package/dist/production/structures/LRUCache.js.map +1 -1
  599. package/dist/production/structures/WeakIdCache.js +3 -1
  600. package/dist/production/structures/WeakIdCache.js.map +1 -1
  601. package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.js +3 -1
  602. package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.js.map +1 -1
  603. package/dist/production/treeParameters/EntityCreationParameters.js +3 -1
  604. package/dist/production/treeParameters/EntityCreationParameters.js.map +1 -1
  605. package/dist/production/treeParameters/EntityListPreferences.js +3 -1
  606. package/dist/production/treeParameters/EntityListPreferences.js.map +1 -1
  607. package/dist/production/treeParameters/EventListenersStore.js +3 -1
  608. package/dist/production/treeParameters/EventListenersStore.js.map +1 -1
  609. package/dist/production/treeParameters/LeafField.js +3 -1
  610. package/dist/production/treeParameters/LeafField.js.map +1 -1
  611. package/dist/production/treeParameters/QualifiedEntityParameters.js +3 -1
  612. package/dist/production/treeParameters/QualifiedEntityParameters.js.map +1 -1
  613. package/dist/production/treeParameters/Relation.js +3 -1
  614. package/dist/production/treeParameters/Relation.js.map +1 -1
  615. package/dist/production/utils/Hashing.js +3 -1
  616. package/dist/production/utils/Hashing.js.map +1 -1
  617. package/dist/production/utils/assert.js +3 -1
  618. package/dist/production/utils/assert.js.map +1 -1
  619. package/dist/production/utils/assertNever.js +6 -2
  620. package/dist/production/utils/assertNever.js.map +1 -1
  621. package/dist/production/utils/generateEnumerabilityPreventingEntropy.js +3 -1
  622. package/dist/production/utils/generateEnumerabilityPreventingEntropy.js.map +1 -1
  623. package/dist/production/utils/isEmptyObject.js +3 -1
  624. package/dist/production/utils/isEmptyObject.js.map +1 -1
  625. package/dist/production/utils/ucfirst.js +3 -1
  626. package/dist/production/utils/ucfirst.js.map +1 -1
  627. package/dist/types/tsconfig.tsbuildinfo +1 -1
  628. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"OperationsHelpers.js","sources":["../../../../src/core/operations/OperationsHelpers.ts"],"sourcesContent":["import type { EntityAccessor } from '../../accessors'\nimport type { RuntimeId } from '../../accessorTree'\nimport { BindingError } from '../../BindingError'\nimport { PRIMARY_KEY_NAME } from '../../bindingTypes'\nimport { EventManager } from '../EventManager'\nimport { RealmKeyGenerator } from '../RealmKeyGenerator'\nimport type { EntityRealmState, EntityRealmStateStub, EntityState } from '../state'\nimport type { StateInitializer } from '../StateInitializer'\nimport type { TreeStore } from '../TreeStore'\n\nexport class OperationsHelpers {\n\tpublic static rejectInvalidAccessorTree(): never {\n\t\tthrow new BindingError(\n\t\t\t`The accessor tree does not correspond to the MarkerTree. This should absolutely never happen.`,\n\t\t)\n\t}\n\n\tpublic static resolveAndPrepareEntityToConnect(\n\t\ttreeStore: TreeStore,\n\t\tentityToConnect: EntityAccessor,\n\t): EntityRealmState | EntityRealmStateStub {\n\t\tconst entityToConnectKey = entityToConnect.key\n\t\tconst stateToConnect = treeStore.entityRealmStore.get(entityToConnectKey)\n\n\t\tif (stateToConnect === undefined) {\n\t\t\tthrow new BindingError(`Attempting to connect an entity with key '${entityToConnectKey}' but it doesn't exist.`)\n\t\t}\n\t\t// TODO This is commented out for now in order to at least somewhat mitigate the limitations of dealing with\n\t\t//\t\tinverse relations. However, once that has been addressed systemically, this code needs to be re-enabled.\n\t\t// if (!stateToConnect.entity.id.existsOnServer) {\n\t\t// \tthrow new BindingError(\n\t\t// \t\t`Attempting to connect an entity with key '${stateToConnect.realmKey}' that ` +\n\t\t// \t\t\t`doesn't exist on server. That is currently impossible.`, // At least for now.\n\t\t// \t)\n\t\t// }\n\n\t\t// TODO\n\t\t// if (stateToConnect.entity.isScheduledForDeletion) {\n\t\t// \t// As far as the other realms are concerned, this entity is deleted. We don't want to just make it re-appear\n\t\t// \t// for them just because some other random relation decided to connect it.\n\t\t// \tstateToConnect.entity.realms.clear()\n\t\t// \tstateToConnect.entity.isScheduledForDeletion = false\n\t\t// }\n\n\t\treturn stateToConnect\n\t}\n\n\tpublic static changeEntityId(\n\t\ttreeStore: TreeStore,\n\t\teventManager: EventManager,\n\t\tstateInitializer: StateInitializer,\n\t\tentity: EntityState,\n\t\tnewId: RuntimeId,\n\t) {\n\t\tconst previousId = entity.id\n\n\t\ttreeStore.entityStore.delete(previousId.uniqueValue)\n\t\ttreeStore.entityStore.set(newId.uniqueValue, entity)\n\n\t\tlet counter = 0\n\t\tfor (const realm of entity.realms.values()) {\n\t\t\tthis.changeRealmId(treeStore, eventManager, stateInitializer, realm, newId)\n\n\t\t\tif (++counter === entity.realms.size) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tentity.hasIdSetInStone = true\n\t\tentity.id = newId\n\t}\n\n\tpublic static changeRealmId(\n\t\ttreeStore: TreeStore,\n\t\teventManager: EventManager,\n\t\tstateInitializer: StateInitializer,\n\t\trealm: EntityRealmState | EntityRealmStateStub,\n\t\tnewId: RuntimeId,\n\t) {\n\t\tconst oldEntity = realm.entity\n\t\tconst oldRealmKey = realm.realmKey\n\t\tconst oldId = oldEntity.id\n\n\t\tconst realmBlueprint = realm.blueprint\n\n\t\tconst newEntity = stateInitializer.initializeEntityState(newId, oldEntity.entityName)\n\t\tconst newRealmKey = RealmKeyGenerator.getRealmKey(newId, realmBlueprint)\n\n\t\trealm.realmKey = newRealmKey\n\t\trealm.entity = newEntity\n\n\t\t// This may still actually be necessary if we're going from a client to server generated uuid.\n\t\t// They both may have the same value but still be different.\n\t\tnewEntity.id = newId\n\t\toldEntity.realms.delete(oldRealmKey)\n\t\tnewEntity.realms.set(newRealmKey, realm)\n\n\t\tif (realm.type === 'entityRealm') {\n\t\t\tconst childIdState = realm.children.get(PRIMARY_KEY_NAME)\n\t\t\tif (childIdState?.type === 'field') {\n\t\t\t\tchildIdState.value = newId.value\n\t\t\t\teventManager.registerJustUpdated(childIdState, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t}\n\n\t\t\tthis.purgeStaleListenersAfterIdChange(realm)\n\t\t}\n\n\t\tif (oldEntity.realms.size === 0) {\n\t\t\ttreeStore.disposeOfEntity(oldEntity)\n\t\t}\n\n\t\ttreeStore.entityRealmStore.delete(oldRealmKey)\n\t\ttreeStore.entityRealmStore.set(newRealmKey, realm)\n\n\t\tif (realmBlueprint.type === 'listEntity') {\n\t\t\tconst list = realmBlueprint.parent\n\t\t\tlist.children.changeKey(oldId.value, newId.value) // 😎\n\t\t} else if (realmBlueprint.type === 'hasOne') {\n\t\t\teventManager.registerUpdatedConnection(realmBlueprint.parent, realmBlueprint.marker.placeholderName)\n\t\t}\n\t\tconst parent = realmBlueprint.parent\n\t\tif (parent) {\n\t\t\teventManager.registerJustUpdated(parent, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t}\n\t\tif (realm.type === 'entityRealm') {\n\t\t\teventManager.registerJustUpdated(realm, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t}\n\t}\n\n\tpublic static purgeStaleListenersAfterIdChange(realm: EntityRealmState) {\n\t\t// Version 1.\n\t\t// The listeners subscribed to a particular entity key so we no longer want to call these.\n\t\t// The only positionally associated listeners are in the blueprint so we re-initialize those.\n\t\t//realm.eventListeners = stateInitializer.initializeEntityEventListenerStore(realmBlueprint)\n\n\t\t// Version 2.\n\t\t// This is version two of this terrible hack. We want to preserve e.g. persistSuccess handlers.\n\n\t\t// Version 3.\n\t\t// The saga continues. We add a condition to exempt top-level realms. That way they can start\n\t\t// propagating changes from the top.\n\t\tconst listeners = realm.eventListeners\n\t\tif (listeners) {\n\t\t\tif (realm.blueprint.parent) {\n\t\t\t\tlisteners.delete({ type: 'update' })\n\t\t\t}\n\t\t\tlisteners.deleteByType('connectionUpdate')\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;AAUO,MAAM,kBAAkB;AAAA,SAChB,4BAAmC;AAC1C,UAAA,IAAI,aACT,+FACD;AAAA,EACD;AAAA,SAEc,iCACb,WACA,iBAC0C;AAC1C,UAAM,qBAAqB,gBAAgB;AAC3C,UAAM,iBAAiB,UAAU,iBAAiB,IAAI,kBAAkB;AAExE,QAAI,mBAAmB,QAAW;AAC3B,YAAA,IAAI,aAAa,6CAA6C,2CAA2C;AAAA,IAChH;AAkBO,WAAA;AAAA,EACR;AAAA,SAEc,eACb,WACA,cACA,kBACA,QACA,OACC;AACD,UAAM,aAAa,OAAO;AAEhB,cAAA,YAAY,OAAO,WAAW,WAAW;AACnD,cAAU,YAAY,IAAI,MAAM,aAAa,MAAM;AAEnD,QAAI,UAAU;AACd,eAAW,SAAS,OAAO,OAAO,OAAA,GAAU;AAC3C,WAAK,cAAc,WAAW,cAAc,kBAAkB,OAAO,KAAK;AAE1E,UAAI,EAAE,YAAY,OAAO,OAAO,MAAM;AACrC;AAAA,MACD;AAAA,IACD;AAEA,WAAO,kBAAkB;AACzB,WAAO,KAAK;AAAA,EACb;AAAA,SAEc,cACb,WACA,cACA,kBACA,OACA,OACC;AACD,UAAM,YAAY,MAAM;AACxB,UAAM,cAAc,MAAM;AAC1B,UAAM,QAAQ,UAAU;AAExB,UAAM,iBAAiB,MAAM;AAE7B,UAAM,YAAY,iBAAiB,sBAAsB,OAAO,UAAU,UAAU;AACpF,UAAM,cAAc,kBAAkB,YAAY,OAAO,cAAc;AAEvE,UAAM,WAAW;AACjB,UAAM,SAAS;AAIf,cAAU,KAAK;AACL,cAAA,OAAO,OAAO,WAAW;AACzB,cAAA,OAAO,IAAI,aAAa,KAAK;AAEnC,QAAA,MAAM,SAAS,eAAe;AACjC,YAAM,eAAe,MAAM,SAAS,IAAI,gBAAgB;AACpD,UAAA,cAAc,SAAS,SAAS;AACnC,qBAAa,QAAQ,MAAM;AACd,qBAAA,oBAAoB,cAAc,aAAa,qBAAqB;AAAA,MAClF;AAEA,WAAK,iCAAiC,KAAK;AAAA,IAC5C;AAEI,QAAA,UAAU,OAAO,SAAS,GAAG;AAChC,gBAAU,gBAAgB,SAAS;AAAA,IACpC;AAEU,cAAA,iBAAiB,OAAO,WAAW;AACnC,cAAA,iBAAiB,IAAI,aAAa,KAAK;AAE7C,QAAA,eAAe,SAAS,cAAc;AACzC,YAAM,OAAO,eAAe;AAC5B,WAAK,SAAS,UAAU,MAAM,OAAO,MAAM,KAAK;AAAA,IAAA,WACtC,eAAe,SAAS,UAAU;AAC5C,mBAAa,0BAA0B,eAAe,QAAQ,eAAe,OAAO,eAAe;AAAA,IACpG;AACA,UAAM,SAAS,eAAe;AAC9B,QAAI,QAAQ;AACE,mBAAA,oBAAoB,QAAQ,aAAa,qBAAqB;AAAA,IAC5E;AACI,QAAA,MAAM,SAAS,eAAe;AACpB,mBAAA,oBAAoB,OAAO,aAAa,qBAAqB;AAAA,IAC3E;AAAA,EACD;AAAA,SAEc,iCAAiC,OAAyB;AAYvE,UAAM,YAAY,MAAM;AACxB,QAAI,WAAW;AACV,UAAA,MAAM,UAAU,QAAQ;AAC3B,kBAAU,OAAO,EAAE,MAAM,SAAU,CAAA;AAAA,MACpC;AACA,gBAAU,aAAa,kBAAkB;AAAA,IAC1C;AAAA,EACD;AACD;;"}
1
+ {"version":3,"file":"OperationsHelpers.js","sources":["../../../../src/core/operations/OperationsHelpers.ts"],"sourcesContent":["import type { EntityAccessor } from '../../accessors'\nimport type { RuntimeId } from '../../accessorTree'\nimport { BindingError } from '../../BindingError'\nimport { PRIMARY_KEY_NAME } from '../../bindingTypes'\nimport { EventManager } from '../EventManager'\nimport { RealmKeyGenerator } from '../RealmKeyGenerator'\nimport type { EntityRealmState, EntityRealmStateStub, EntityState } from '../state'\nimport type { StateInitializer } from '../StateInitializer'\nimport type { TreeStore } from '../TreeStore'\n\nexport class OperationsHelpers {\n\tpublic static rejectInvalidAccessorTree(): never {\n\t\tthrow new BindingError(\n\t\t\t`The accessor tree does not correspond to the MarkerTree. This should absolutely never happen.`,\n\t\t)\n\t}\n\n\tpublic static resolveAndPrepareEntityToConnect(\n\t\ttreeStore: TreeStore,\n\t\tentityToConnect: EntityAccessor,\n\t): EntityRealmState | EntityRealmStateStub {\n\t\tconst entityToConnectKey = entityToConnect.key\n\t\tconst stateToConnect = treeStore.entityRealmStore.get(entityToConnectKey)\n\n\t\tif (stateToConnect === undefined) {\n\t\t\tthrow new BindingError(`Attempting to connect an entity with key '${entityToConnectKey}' but it doesn't exist.`)\n\t\t}\n\t\t// TODO This is commented out for now in order to at least somewhat mitigate the limitations of dealing with\n\t\t//\t\tinverse relations. However, once that has been addressed systemically, this code needs to be re-enabled.\n\t\t// if (!stateToConnect.entity.id.existsOnServer) {\n\t\t// \tthrow new BindingError(\n\t\t// \t\t`Attempting to connect an entity with key '${stateToConnect.realmKey}' that ` +\n\t\t// \t\t\t`doesn't exist on server. That is currently impossible.`, // At least for now.\n\t\t// \t)\n\t\t// }\n\n\t\t// TODO\n\t\t// if (stateToConnect.entity.isScheduledForDeletion) {\n\t\t// \t// As far as the other realms are concerned, this entity is deleted. We don't want to just make it re-appear\n\t\t// \t// for them just because some other random relation decided to connect it.\n\t\t// \tstateToConnect.entity.realms.clear()\n\t\t// \tstateToConnect.entity.isScheduledForDeletion = false\n\t\t// }\n\n\t\treturn stateToConnect\n\t}\n\n\tpublic static changeEntityId(\n\t\ttreeStore: TreeStore,\n\t\teventManager: EventManager,\n\t\tstateInitializer: StateInitializer,\n\t\tentity: EntityState,\n\t\tnewId: RuntimeId,\n\t) {\n\t\tconst previousId = entity.id\n\n\t\ttreeStore.entityStore.delete(previousId.uniqueValue)\n\t\ttreeStore.entityStore.set(newId.uniqueValue, entity)\n\n\t\tlet counter = 0\n\t\tfor (const realm of entity.realms.values()) {\n\t\t\tthis.changeRealmId(treeStore, eventManager, stateInitializer, realm, newId)\n\n\t\t\tif (++counter === entity.realms.size) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tentity.hasIdSetInStone = true\n\t\tentity.id = newId\n\t}\n\n\tpublic static changeRealmId(\n\t\ttreeStore: TreeStore,\n\t\teventManager: EventManager,\n\t\tstateInitializer: StateInitializer,\n\t\trealm: EntityRealmState | EntityRealmStateStub,\n\t\tnewId: RuntimeId,\n\t) {\n\t\tconst oldEntity = realm.entity\n\t\tconst oldRealmKey = realm.realmKey\n\t\tconst oldId = oldEntity.id\n\n\t\tconst realmBlueprint = realm.blueprint\n\n\t\tconst newEntity = stateInitializer.initializeEntityState(newId, oldEntity.entityName)\n\t\tconst newRealmKey = RealmKeyGenerator.getRealmKey(newId, realmBlueprint)\n\n\t\trealm.realmKey = newRealmKey\n\t\trealm.entity = newEntity\n\n\t\t// This may still actually be necessary if we're going from a client to server generated uuid.\n\t\t// They both may have the same value but still be different.\n\t\tnewEntity.id = newId\n\t\toldEntity.realms.delete(oldRealmKey)\n\t\tnewEntity.realms.set(newRealmKey, realm)\n\n\t\tif (realm.type === 'entityRealm') {\n\t\t\tconst childIdState = realm.children.get(PRIMARY_KEY_NAME)\n\t\t\tif (childIdState?.type === 'field') {\n\t\t\t\tchildIdState.value = newId.value\n\t\t\t\teventManager.registerJustUpdated(childIdState, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t}\n\n\t\t\tthis.purgeStaleListenersAfterIdChange(realm)\n\t\t}\n\n\t\tif (oldEntity.realms.size === 0) {\n\t\t\ttreeStore.disposeOfEntity(oldEntity)\n\t\t}\n\n\t\ttreeStore.entityRealmStore.delete(oldRealmKey)\n\t\ttreeStore.entityRealmStore.set(newRealmKey, realm)\n\n\t\tif (realmBlueprint.type === 'listEntity') {\n\t\t\tconst list = realmBlueprint.parent\n\t\t\tlist.children.changeKey(oldId.value, newId.value) // 😎\n\t\t} else if (realmBlueprint.type === 'hasOne') {\n\t\t\teventManager.registerUpdatedConnection(realmBlueprint.parent, realmBlueprint.marker.placeholderName)\n\t\t}\n\t\tconst parent = realmBlueprint.parent\n\t\tif (parent) {\n\t\t\teventManager.registerJustUpdated(parent, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t}\n\t\tif (realm.type === 'entityRealm') {\n\t\t\teventManager.registerJustUpdated(realm, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t}\n\t}\n\n\tpublic static purgeStaleListenersAfterIdChange(realm: EntityRealmState) {\n\t\t// Version 1.\n\t\t// The listeners subscribed to a particular entity key so we no longer want to call these.\n\t\t// The only positionally associated listeners are in the blueprint so we re-initialize those.\n\t\t//realm.eventListeners = stateInitializer.initializeEntityEventListenerStore(realmBlueprint)\n\n\t\t// Version 2.\n\t\t// This is version two of this terrible hack. We want to preserve e.g. persistSuccess handlers.\n\n\t\t// Version 3.\n\t\t// The saga continues. We add a condition to exempt top-level realms. That way they can start\n\t\t// propagating changes from the top.\n\t\tconst listeners = realm.eventListeners\n\t\tif (listeners) {\n\t\t\tif (realm.blueprint.parent) {\n\t\t\t\tlisteners.delete({ type: 'update' })\n\t\t\t}\n\t\t\tlisteners.deleteByType('connectionUpdate')\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;AAUO,MAAM,kBAAkB;AAAA,EAC9B,OAAc,4BAAmC;AAChD,UAAM,IAAI;AAAA,MACT;AAAA,IAAA;AAAA,EAEF;AAAA,EAEA,OAAc,iCACb,WACA,iBAC0C;AAC1C,UAAM,qBAAqB,gBAAgB;AAC3C,UAAM,iBAAiB,UAAU,iBAAiB,IAAI,kBAAkB;AAExE,QAAI,mBAAmB,QAAW;AAC3B,YAAA,IAAI,aAAa,6CAA6C,2CAA2C;AAAA,IAChH;AAkBO,WAAA;AAAA,EACR;AAAA,EAEA,OAAc,eACb,WACA,cACA,kBACA,QACA,OACC;AACD,UAAM,aAAa,OAAO;AAEhB,cAAA,YAAY,OAAO,WAAW,WAAW;AACnD,cAAU,YAAY,IAAI,MAAM,aAAa,MAAM;AAEnD,QAAI,UAAU;AACd,eAAW,SAAS,OAAO,OAAO,OAAA,GAAU;AAC3C,WAAK,cAAc,WAAW,cAAc,kBAAkB,OAAO,KAAK;AAE1E,UAAI,EAAE,YAAY,OAAO,OAAO,MAAM;AACrC;AAAA,MACD;AAAA,IACD;AAEA,WAAO,kBAAkB;AACzB,WAAO,KAAK;AAAA,EACb;AAAA,EAEA,OAAc,cACb,WACA,cACA,kBACA,OACA,OACC;AACD,UAAM,YAAY,MAAM;AACxB,UAAM,cAAc,MAAM;AAC1B,UAAM,QAAQ,UAAU;AAExB,UAAM,iBAAiB,MAAM;AAE7B,UAAM,YAAY,iBAAiB,sBAAsB,OAAO,UAAU,UAAU;AACpF,UAAM,cAAc,kBAAkB,YAAY,OAAO,cAAc;AAEvE,UAAM,WAAW;AACjB,UAAM,SAAS;AAIf,cAAU,KAAK;AACL,cAAA,OAAO,OAAO,WAAW;AACzB,cAAA,OAAO,IAAI,aAAa,KAAK;AAEnC,QAAA,MAAM,SAAS,eAAe;AACjC,YAAM,eAAe,MAAM,SAAS,IAAI,gBAAgB;AACpD,UAAA,cAAc,SAAS,SAAS;AACnC,qBAAa,QAAQ,MAAM;AACd,qBAAA,oBAAoB,cAAc,aAAa,qBAAqB;AAAA,MAClF;AAEA,WAAK,iCAAiC,KAAK;AAAA,IAC5C;AAEI,QAAA,UAAU,OAAO,SAAS,GAAG;AAChC,gBAAU,gBAAgB,SAAS;AAAA,IACpC;AAEU,cAAA,iBAAiB,OAAO,WAAW;AACnC,cAAA,iBAAiB,IAAI,aAAa,KAAK;AAE7C,QAAA,eAAe,SAAS,cAAc;AACzC,YAAM,OAAO,eAAe;AAC5B,WAAK,SAAS,UAAU,MAAM,OAAO,MAAM,KAAK;AAAA,IAAA,WACtC,eAAe,SAAS,UAAU;AAC5C,mBAAa,0BAA0B,eAAe,QAAQ,eAAe,OAAO,eAAe;AAAA,IACpG;AACA,UAAM,SAAS,eAAe;AAC9B,QAAI,QAAQ;AACE,mBAAA,oBAAoB,QAAQ,aAAa,qBAAqB;AAAA,IAC5E;AACI,QAAA,MAAM,SAAS,eAAe;AACpB,mBAAA,oBAAoB,OAAO,aAAa,qBAAqB;AAAA,IAC3E;AAAA,EACD;AAAA,EAEA,OAAc,iCAAiC,OAAyB;AAYvE,UAAM,YAAY,MAAM;AACxB,QAAI,WAAW;AACV,UAAA,MAAM,UAAU,QAAQ;AAC3B,kBAAU,OAAO,EAAE,MAAM,SAAU,CAAA;AAAA,MACpC;AACA,gBAAU,aAAa,kBAAkB;AAAA,IAC1C;AAAA,EACD;AACD;"}
@@ -8,5 +8,7 @@ class MutationAlias {
8
8
  return intId.toString() === stringId ? intId : stringId;
9
9
  }
10
10
  }
11
- export { MutationAlias };
11
+ export {
12
+ MutationAlias
13
+ };
12
14
  //# sourceMappingURL=MutationAlias.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutationAlias.js","sources":["../../../../src/core/requestAliases/MutationAlias.ts"],"sourcesContent":["import type { RuntimeId } from '../../accessorTree'\n\nexport class MutationAlias {\n\tpublic static encodeEntityId(entityId: RuntimeId): string {\n\t\treturn `_${String(entityId.value).replace(/-/g, '_')}`\n\t}\n\n\tpublic static decodeEntityId(alias: string): RuntimeId['value'] {\n\t\tconst stringId = `${alias.substring(1).replace(/_/g, '-')}`\n\t\tconst intId = parseInt(stringId)\n\t\treturn intId.toString() === stringId ? intId : stringId\n\t}\n}\n"],"names":[],"mappings":"AAEO,MAAM,cAAc;AAAA,SACZ,eAAe,UAA6B;AACzD,WAAO,IAAI,OAAO,SAAS,KAAK,EAAE,QAAQ,MAAM,GAAG;AAAA,EACpD;AAAA,SAEc,eAAe,OAAmC;AACzD,UAAA,WAAW,GAAG,MAAM,UAAU,CAAC,EAAE,QAAQ,MAAM,GAAG;AAClD,UAAA,QAAQ,SAAS,QAAQ;AAC/B,WAAO,MAAM,SAAA,MAAe,WAAW,QAAQ;AAAA,EAChD;AACD;;"}
1
+ {"version":3,"file":"MutationAlias.js","sources":["../../../../src/core/requestAliases/MutationAlias.ts"],"sourcesContent":["import type { RuntimeId } from '../../accessorTree'\n\nexport class MutationAlias {\n\tpublic static encodeEntityId(entityId: RuntimeId): string {\n\t\treturn `_${String(entityId.value).replace(/-/g, '_')}`\n\t}\n\n\tpublic static decodeEntityId(alias: string): RuntimeId['value'] {\n\t\tconst stringId = `${alias.substring(1).replace(/_/g, '-')}`\n\t\tconst intId = parseInt(stringId)\n\t\treturn intId.toString() === stringId ? intId : stringId\n\t}\n}\n"],"names":[],"mappings":"AAEO,MAAM,cAAc;AAAA,EAC1B,OAAc,eAAe,UAA6B;AACzD,WAAO,IAAI,OAAO,SAAS,KAAK,EAAE,QAAQ,MAAM,GAAG;AAAA,EACpD;AAAA,EAEA,OAAc,eAAe,OAAmC;AACzD,UAAA,WAAW,GAAG,MAAM,UAAU,CAAC,EAAE,QAAQ,MAAM,GAAG;AAClD,UAAA,QAAQ,SAAS,QAAQ;AAC/B,WAAO,MAAM,SAAA,MAAe,WAAW,QAAQ;AAAA,EAChD;AACD;"}
@@ -33,5 +33,7 @@ class Schema {
33
33
  throw new BindingError(message);
34
34
  }
35
35
  }
36
- export { Schema };
36
+ export {
37
+ Schema
38
+ };
37
39
  //# sourceMappingURL=Schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.js","sources":["../../../../src/core/schema/Schema.ts"],"sourcesContent":["import type { EntityName, FieldName } from '../../treeParameters'\nimport { BindingError } from '../../BindingError'\nimport type { SchemaField } from './SchemaField'\nimport type { SchemaStore } from './SchemaStore'\nimport { SchemaEntity } from './SchemaEntity'\nimport { SchemaColumn } from './SchemaColumn'\nimport { SchemaRelation } from './SchemaRelation'\nimport { SchemaEnumName } from './SchemaEnums'\n\nexport class Schema {\n\tpublic constructor(private readonly store: SchemaStore) {}\n\n\tpublic getEnumValues(enumName: SchemaEnumName): string[] {\n\t\treturn Array.from(this.store.enums.get(enumName) ?? this.throwError(`Missing schema for enum ${enumName}`))\n\t}\n\n\tpublic getEntityOrUndefined(entityName: EntityName): SchemaEntity | undefined {\n\t\treturn this.store.entities.get(entityName)\n\t}\n\n\tpublic getEntityNames(): string[] {\n\t\treturn Array.from(this.store.entities.keys())\n\t}\n\n\tpublic getEntity(entityName: EntityName): SchemaEntity {\n\t\treturn this.getEntityOrUndefined(entityName) ?? this.throwError(`Missing schema for entity ${entityName}`)\n\t}\n\n\tpublic getEntityFieldOrUndefined(entityName: EntityName, fieldName: FieldName): SchemaField | undefined {\n\t\treturn this.store.entities.get(entityName)?.fields.get(fieldName)\n\t}\n\n\tpublic getEntityField(entityName: EntityName, fieldName: FieldName): SchemaField {\n\t\treturn this.getEntityFieldOrUndefined(entityName, fieldName) ?? this.throwError(`Missing schema for field ${entityName}.${fieldName}`)\n\t}\n\n\tpublic getEntityColumn(entityName: EntityName, fieldName: FieldName): SchemaColumn {\n\t\tconst field = this.getEntityField(entityName, fieldName)\n\t\treturn field.__typename === '_Column' ? field : this.throwError(`Field ${entityName}.${fieldName} is not of type column`)\n\t}\n\n\tpublic getEntityRelation(entityName: EntityName, fieldName: FieldName): SchemaRelation {\n\t\tconst field = this.getEntityField(entityName, fieldName)\n\t\treturn field.__typename === '_Relation' ? field : this.throwError(`Field ${entityName}.${fieldName} is not of type relation`)\n\t}\n\n\tprivate throwError(message: string): never {\n\t\tthrow new BindingError(message)\n\t}\n}\n"],"names":[],"mappings":";AASO,MAAM,OAAO;AAAA,EACZ,YAA6B,OAAoB;AAApB,SAAA,QAAA;AAAA,EAAqB;AAAA,EAElD,cAAc,UAAoC;AACxD,WAAO,MAAM,KAAK,KAAK,MAAM,MAAM,IAAI,QAAQ,KAAK,KAAK,WAAW,2BAA2B,UAAU,CAAC;AAAA,EAC3G;AAAA,EAEO,qBAAqB,YAAkD;AAC7E,WAAO,KAAK,MAAM,SAAS,IAAI,UAAU;AAAA,EAC1C;AAAA,EAEO,iBAA2B;AACjC,WAAO,MAAM,KAAK,KAAK,MAAM,SAAS,MAAM;AAAA,EAC7C;AAAA,EAEO,UAAU,YAAsC;AACtD,WAAO,KAAK,qBAAqB,UAAU,KAAK,KAAK,WAAW,6BAA6B,YAAY;AAAA,EAC1G;AAAA,EAEO,0BAA0B,YAAwB,WAA+C;AAChG,WAAA,KAAK,MAAM,SAAS,IAAI,UAAU,GAAG,OAAO,IAAI,SAAS;AAAA,EACjE;AAAA,EAEO,eAAe,YAAwB,WAAmC;AACzE,WAAA,KAAK,0BAA0B,YAAY,SAAS,KAAK,KAAK,WAAW,4BAA4B,cAAc,WAAW;AAAA,EACtI;AAAA,EAEO,gBAAgB,YAAwB,WAAoC;AAClF,UAAM,QAAQ,KAAK,eAAe,YAAY,SAAS;AAChD,WAAA,MAAM,eAAe,YAAY,QAAQ,KAAK,WAAW,SAAS,cAAc,iCAAiC;AAAA,EACzH;AAAA,EAEO,kBAAkB,YAAwB,WAAsC;AACtF,UAAM,QAAQ,KAAK,eAAe,YAAY,SAAS;AAChD,WAAA,MAAM,eAAe,cAAc,QAAQ,KAAK,WAAW,SAAS,cAAc,mCAAmC;AAAA,EAC7H;AAAA,EAEQ,WAAW,SAAwB;AACpC,UAAA,IAAI,aAAa,OAAO;AAAA,EAC/B;AACD;;"}
1
+ {"version":3,"file":"Schema.js","sources":["../../../../src/core/schema/Schema.ts"],"sourcesContent":["import type { EntityName, FieldName } from '../../treeParameters'\nimport { BindingError } from '../../BindingError'\nimport type { SchemaField } from './SchemaField'\nimport type { SchemaStore } from './SchemaStore'\nimport { SchemaEntity } from './SchemaEntity'\nimport { SchemaColumn } from './SchemaColumn'\nimport { SchemaRelation } from './SchemaRelation'\nimport { SchemaEnumName } from './SchemaEnums'\n\nexport class Schema {\n\tpublic constructor(private readonly store: SchemaStore) {}\n\n\tpublic getEnumValues(enumName: SchemaEnumName): string[] {\n\t\treturn Array.from(this.store.enums.get(enumName) ?? this.throwError(`Missing schema for enum ${enumName}`))\n\t}\n\n\tpublic getEntityOrUndefined(entityName: EntityName): SchemaEntity | undefined {\n\t\treturn this.store.entities.get(entityName)\n\t}\n\n\tpublic getEntityNames(): string[] {\n\t\treturn Array.from(this.store.entities.keys())\n\t}\n\n\tpublic getEntity(entityName: EntityName): SchemaEntity {\n\t\treturn this.getEntityOrUndefined(entityName) ?? this.throwError(`Missing schema for entity ${entityName}`)\n\t}\n\n\tpublic getEntityFieldOrUndefined(entityName: EntityName, fieldName: FieldName): SchemaField | undefined {\n\t\treturn this.store.entities.get(entityName)?.fields.get(fieldName)\n\t}\n\n\tpublic getEntityField(entityName: EntityName, fieldName: FieldName): SchemaField {\n\t\treturn this.getEntityFieldOrUndefined(entityName, fieldName) ?? this.throwError(`Missing schema for field ${entityName}.${fieldName}`)\n\t}\n\n\tpublic getEntityColumn(entityName: EntityName, fieldName: FieldName): SchemaColumn {\n\t\tconst field = this.getEntityField(entityName, fieldName)\n\t\treturn field.__typename === '_Column' ? field : this.throwError(`Field ${entityName}.${fieldName} is not of type column`)\n\t}\n\n\tpublic getEntityRelation(entityName: EntityName, fieldName: FieldName): SchemaRelation {\n\t\tconst field = this.getEntityField(entityName, fieldName)\n\t\treturn field.__typename === '_Relation' ? field : this.throwError(`Field ${entityName}.${fieldName} is not of type relation`)\n\t}\n\n\tprivate throwError(message: string): never {\n\t\tthrow new BindingError(message)\n\t}\n}\n"],"names":[],"mappings":";AASO,MAAM,OAAO;AAAA,EACZ,YAA6B,OAAoB;AAApB,SAAA,QAAA;AAAA,EAAqB;AAAA,EAElD,cAAc,UAAoC;AACxD,WAAO,MAAM,KAAK,KAAK,MAAM,MAAM,IAAI,QAAQ,KAAK,KAAK,WAAW,2BAA2B,UAAU,CAAC;AAAA,EAC3G;AAAA,EAEO,qBAAqB,YAAkD;AAC7E,WAAO,KAAK,MAAM,SAAS,IAAI,UAAU;AAAA,EAC1C;AAAA,EAEO,iBAA2B;AACjC,WAAO,MAAM,KAAK,KAAK,MAAM,SAAS,MAAM;AAAA,EAC7C;AAAA,EAEO,UAAU,YAAsC;AACtD,WAAO,KAAK,qBAAqB,UAAU,KAAK,KAAK,WAAW,6BAA6B,YAAY;AAAA,EAC1G;AAAA,EAEO,0BAA0B,YAAwB,WAA+C;AAChG,WAAA,KAAK,MAAM,SAAS,IAAI,UAAU,GAAG,OAAO,IAAI,SAAS;AAAA,EACjE;AAAA,EAEO,eAAe,YAAwB,WAAmC;AACzE,WAAA,KAAK,0BAA0B,YAAY,SAAS,KAAK,KAAK,WAAW,4BAA4B,cAAc,WAAW;AAAA,EACtI;AAAA,EAEO,gBAAgB,YAAwB,WAAoC;AAClF,UAAM,QAAQ,KAAK,eAAe,YAAY,SAAS;AAChD,WAAA,MAAM,eAAe,YAAY,QAAQ,KAAK,WAAW,SAAS,cAAc,iCAAiC;AAAA,EACzH;AAAA,EAEO,kBAAkB,YAAwB,WAAsC;AACtF,UAAM,QAAQ,KAAK,eAAe,YAAY,SAAS;AAChD,WAAA,MAAM,eAAe,cAAc,QAAQ,KAAK,WAAW,SAAS,cAAc,mCAAmC;AAAA,EAC7H;AAAA,EAEQ,WAAW,SAAwB;AACpC,UAAA,IAAI,aAAa,OAAO;AAAA,EAC/B;AACD;"}
@@ -22,5 +22,7 @@ class SchemaLoader {
22
22
  }
23
23
  __publicField(SchemaLoader, "schemaLoadCache", /* @__PURE__ */ new Map());
24
24
  __publicField(SchemaLoader, "schemaQuery", "query {\n schema {\n enums {\n name\n values\n }\n entities {\n name\n customPrimaryAllowed\n unique {\n fields\n }\n fields {\n __typename\n name\n type\n nullable\n ... on _Column {\n enumName\n defaultValue\n }\n ... on _Relation {\n side\n targetEntity\n ownedBy\n inversedBy\n onDelete\n orphanRemoval\n orderBy {\n path\n direction\n }\n }\n }\n }\n }\n}");
25
- export { SchemaLoader };
25
+ export {
26
+ SchemaLoader
27
+ };
26
28
  //# sourceMappingURL=SchemaLoader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaLoader.js","sources":["../../../../src/core/schema/SchemaLoader.ts"],"sourcesContent":["import type { GraphQlClient, GraphQlClientRequestOptions } from '@contember/client'\nimport type { RawSchema } from './RawSchema'\nimport { Schema } from './Schema'\nimport { SchemaPreprocessor } from './SchemaPreprocessor'\n\nexport class SchemaLoader {\n\tprivate static readonly schemaLoadCache: Map<string, Promise<Schema>> = new Map()\n\n\tprivate static readonly schemaQuery =\n\t\t'query {\\n' +\n\t\t' schema {\\n' +\n\t\t' enums {\\n' +\n\t\t' name\\n' +\n\t\t' values\\n' +\n\t\t' }\\n' +\n\t\t' entities {\\n' +\n\t\t' name\\n' +\n\t\t' customPrimaryAllowed\\n' +\n\t\t' unique {\\n' +\n\t\t' fields\\n' +\n\t\t' }\\n' +\n\t\t' fields {\\n' +\n\t\t' __typename\\n' +\n\t\t' name\\n' +\n\t\t' type\\n' +\n\t\t' nullable\\n' +\n\t\t' ... on _Column {\\n' +\n\t\t' enumName\\n' +\n\t\t' defaultValue\\n' +\n\t\t' }\\n' +\n\t\t' ... on _Relation {\\n' +\n\t\t' side\\n' +\n\t\t' targetEntity\\n' +\n\t\t' ownedBy\\n' +\n\t\t' inversedBy\\n' +\n\t\t' onDelete\\n' +\n\t\t' orphanRemoval\\n' +\n\t\t' orderBy {\\n' +\n\t\t' path\\n' +\n\t\t' direction\\n' +\n\t\t' }\\n' +\n\t\t' }\\n' +\n\t\t' }\\n' +\n\t\t' }\\n' +\n\t\t' }\\n' +\n\t\t'}'\n\n\tpublic static async loadSchema(\n\t\tclient: GraphQlClient,\n\t\toptions?: GraphQlClientRequestOptions,\n\t): Promise<Schema> {\n\n\t\tconst existing = this.schemaLoadCache.get(client.apiUrl)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\t\tconst schemaPromise = (async () => {\n\t\t\tconst raw: { data: { schema: RawSchema } } = await client.sendRequest(this.schemaQuery, options)\n\t\t\treturn new Schema(SchemaPreprocessor.processRawSchema(raw.data.schema))\n\t\t})()\n\t\tthis.schemaLoadCache.set(client.apiUrl, schemaPromise)\n\t\treturn await schemaPromise\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAKO,MAAM,aAAa;AAAA,eA0CL,WACnB,QACA,SACkB;AAElB,UAAM,WAAW,KAAK,gBAAgB,IAAI,OAAO,MAAM;AACvD,QAAI,aAAa,QAAW;AACpB,aAAA;AAAA,IACR;AACA,UAAM,gBAA6B,aAAA;AAClC,YAAM,MAAuC,MAAM,OAAO,YAAY,KAAK,aAAa,OAAO;AAC/F,aAAO,IAAI,OAAO,mBAAmB,iBAAiB,IAAI,KAAK,MAAM,CAAC;AAAA,IAAA;AAEvE,SAAK,gBAAgB,IAAI,OAAO,QAAQ,aAAa;AACrD,WAAO,MAAM;AAAA,EACd;AACD;AAzDyB,cADlB,cACkB,uCAAoD;AAEpD,cAHlB,cAGkB,eACvB;;"}
1
+ {"version":3,"file":"SchemaLoader.js","sources":["../../../../src/core/schema/SchemaLoader.ts"],"sourcesContent":["import type { GraphQlClient, GraphQlClientRequestOptions } from '@contember/client'\nimport type { RawSchema } from './RawSchema'\nimport { Schema } from './Schema'\nimport { SchemaPreprocessor } from './SchemaPreprocessor'\n\nexport class SchemaLoader {\n\tprivate static readonly schemaLoadCache: Map<string, Promise<Schema>> = new Map()\n\n\tprivate static readonly schemaQuery =\n\t\t'query {\\n' +\n\t\t' schema {\\n' +\n\t\t' enums {\\n' +\n\t\t' name\\n' +\n\t\t' values\\n' +\n\t\t' }\\n' +\n\t\t' entities {\\n' +\n\t\t' name\\n' +\n\t\t' customPrimaryAllowed\\n' +\n\t\t' unique {\\n' +\n\t\t' fields\\n' +\n\t\t' }\\n' +\n\t\t' fields {\\n' +\n\t\t' __typename\\n' +\n\t\t' name\\n' +\n\t\t' type\\n' +\n\t\t' nullable\\n' +\n\t\t' ... on _Column {\\n' +\n\t\t' enumName\\n' +\n\t\t' defaultValue\\n' +\n\t\t' }\\n' +\n\t\t' ... on _Relation {\\n' +\n\t\t' side\\n' +\n\t\t' targetEntity\\n' +\n\t\t' ownedBy\\n' +\n\t\t' inversedBy\\n' +\n\t\t' onDelete\\n' +\n\t\t' orphanRemoval\\n' +\n\t\t' orderBy {\\n' +\n\t\t' path\\n' +\n\t\t' direction\\n' +\n\t\t' }\\n' +\n\t\t' }\\n' +\n\t\t' }\\n' +\n\t\t' }\\n' +\n\t\t' }\\n' +\n\t\t'}'\n\n\tpublic static async loadSchema(\n\t\tclient: GraphQlClient,\n\t\toptions?: GraphQlClientRequestOptions,\n\t): Promise<Schema> {\n\n\t\tconst existing = this.schemaLoadCache.get(client.apiUrl)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\t\tconst schemaPromise = (async () => {\n\t\t\tconst raw: { data: { schema: RawSchema } } = await client.sendRequest(this.schemaQuery, options)\n\t\t\treturn new Schema(SchemaPreprocessor.processRawSchema(raw.data.schema))\n\t\t})()\n\t\tthis.schemaLoadCache.set(client.apiUrl, schemaPromise)\n\t\treturn await schemaPromise\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAKO,MAAM,aAAa;AAAA,EA0CzB,aAAoB,WACnB,QACA,SACkB;AAElB,UAAM,WAAW,KAAK,gBAAgB,IAAI,OAAO,MAAM;AACvD,QAAI,aAAa,QAAW;AACpB,aAAA;AAAA,IACR;AACA,UAAM,iBAAiB,YAAY;AAClC,YAAM,MAAuC,MAAM,OAAO,YAAY,KAAK,aAAa,OAAO;AAC/F,aAAO,IAAI,OAAO,mBAAmB,iBAAiB,IAAI,KAAK,MAAM,CAAC;AAAA,IAAA;AAEvE,SAAK,gBAAgB,IAAI,OAAO,QAAQ,aAAa;AACrD,WAAO,MAAM;AAAA,EACd;AACD;AAzDC,cADY,cACY,mBAAgD,oBAAI;AAE5E,cAHY,cAGY,eACvB;"}
@@ -32,5 +32,7 @@ class SchemaPreprocessor {
32
32
  return fields;
33
33
  }
34
34
  }
35
- export { SchemaPreprocessor };
35
+ export {
36
+ SchemaPreprocessor
37
+ };
36
38
  //# sourceMappingURL=SchemaPreprocessor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaPreprocessor.js","sources":["../../../../src/core/schema/SchemaPreprocessor.ts"],"sourcesContent":["import type { RawSchema } from './RawSchema'\nimport type { RawSchemaEntity, RawSchemaFields } from './RawSchemaEntity'\nimport type { RawSchemaEnum } from './RawSchemaEnum'\nimport type { SchemaEntities } from './SchemaEntities'\nimport type { SchemaEnums } from './SchemaEnums'\nimport type { SchemaFields } from './SchemaFields'\nimport type { SchemaStore } from './SchemaStore'\n\nexport class SchemaPreprocessor {\n\tpublic static processRawSchema(rawSchema: RawSchema): SchemaStore {\n\t\treturn {\n\t\t\tenums: this.processRawEnums(rawSchema.enums),\n\t\t\tentities: this.processRawEntities(rawSchema.entities),\n\t\t}\n\t}\n\n\tprivate static processRawEnums(rawEnums: RawSchemaEnum[]): SchemaEnums {\n\t\tconst enums: SchemaEnums = new Map()\n\n\t\tfor (const { name, values } of rawEnums) {\n\t\t\tenums.set(name, new Set(values))\n\t\t}\n\n\t\treturn enums\n\t}\n\n\tprivate static processRawEntities(rawEntities: RawSchemaEntity[]): SchemaEntities {\n\t\tconst entities: SchemaEntities = new Map()\n\n\t\tfor (const entity of rawEntities) {\n\t\t\tentities.set(entity.name, {\n\t\t\t\tcustomPrimaryAllowed: entity.customPrimaryAllowed,\n\t\t\t\tfields: this.processRawFields(entity.fields),\n\t\t\t\tname: entity.name,\n\t\t\t\tunique: entity.unique.map(it => ({ fields: new Set(it.fields) })),\n\t\t\t})\n\t\t}\n\n\t\treturn entities\n\t}\n\n\tprivate static processRawFields(rawFields: RawSchemaFields): SchemaFields {\n\t\tconst fields: SchemaFields = new Map()\n\n\t\tfor (const field of rawFields) {\n\t\t\tfields.set(field.name, field)\n\t\t}\n\n\t\treturn fields\n\t}\n}\n"],"names":[],"mappings":"AAQO,MAAM,mBAAmB;AAAA,SACjB,iBAAiB,WAAmC;AAC1D,WAAA;AAAA,MACN,OAAO,KAAK,gBAAgB,UAAU,KAAK;AAAA,MAC3C,UAAU,KAAK,mBAAmB,UAAU,QAAQ;AAAA,IAAA;AAAA,EAEtD;AAAA,SAEe,gBAAgB,UAAwC;AAChE,UAAA,4BAAyB;AAEpB,eAAA,EAAE,MAAM,YAAY,UAAU;AACxC,YAAM,IAAI,MAAM,IAAI,IAAI,MAAM,CAAC;AAAA,IAChC;AAEO,WAAA;AAAA,EACR;AAAA,SAEe,mBAAmB,aAAgD;AAC3E,UAAA,+BAA+B;AAErC,eAAW,UAAU,aAAa;AACxB,eAAA,IAAI,OAAO,MAAM;AAAA,QACzB,sBAAsB,OAAO;AAAA,QAC7B,QAAQ,KAAK,iBAAiB,OAAO,MAAM;AAAA,QAC3C,MAAM,OAAO;AAAA,QACb,QAAQ,OAAO,OAAO,IAAI,CAAO,OAAA,GAAE,QAAQ,IAAI,IAAI,GAAG,MAAM,EAAI,EAAA;AAAA,MAAA,CAChE;AAAA,IACF;AAEO,WAAA;AAAA,EACR;AAAA,SAEe,iBAAiB,WAA0C;AACnE,UAAA,6BAA2B;AAEjC,eAAW,SAAS,WAAW;AACvB,aAAA,IAAI,MAAM,MAAM,KAAK;AAAA,IAC7B;AAEO,WAAA;AAAA,EACR;AACD;;"}
1
+ {"version":3,"file":"SchemaPreprocessor.js","sources":["../../../../src/core/schema/SchemaPreprocessor.ts"],"sourcesContent":["import type { RawSchema } from './RawSchema'\nimport type { RawSchemaEntity, RawSchemaFields } from './RawSchemaEntity'\nimport type { RawSchemaEnum } from './RawSchemaEnum'\nimport type { SchemaEntities } from './SchemaEntities'\nimport type { SchemaEnums } from './SchemaEnums'\nimport type { SchemaFields } from './SchemaFields'\nimport type { SchemaStore } from './SchemaStore'\n\nexport class SchemaPreprocessor {\n\tpublic static processRawSchema(rawSchema: RawSchema): SchemaStore {\n\t\treturn {\n\t\t\tenums: this.processRawEnums(rawSchema.enums),\n\t\t\tentities: this.processRawEntities(rawSchema.entities),\n\t\t}\n\t}\n\n\tprivate static processRawEnums(rawEnums: RawSchemaEnum[]): SchemaEnums {\n\t\tconst enums: SchemaEnums = new Map()\n\n\t\tfor (const { name, values } of rawEnums) {\n\t\t\tenums.set(name, new Set(values))\n\t\t}\n\n\t\treturn enums\n\t}\n\n\tprivate static processRawEntities(rawEntities: RawSchemaEntity[]): SchemaEntities {\n\t\tconst entities: SchemaEntities = new Map()\n\n\t\tfor (const entity of rawEntities) {\n\t\t\tentities.set(entity.name, {\n\t\t\t\tcustomPrimaryAllowed: entity.customPrimaryAllowed,\n\t\t\t\tfields: this.processRawFields(entity.fields),\n\t\t\t\tname: entity.name,\n\t\t\t\tunique: entity.unique.map(it => ({ fields: new Set(it.fields) })),\n\t\t\t})\n\t\t}\n\n\t\treturn entities\n\t}\n\n\tprivate static processRawFields(rawFields: RawSchemaFields): SchemaFields {\n\t\tconst fields: SchemaFields = new Map()\n\n\t\tfor (const field of rawFields) {\n\t\t\tfields.set(field.name, field)\n\t\t}\n\n\t\treturn fields\n\t}\n}\n"],"names":[],"mappings":"AAQO,MAAM,mBAAmB;AAAA,EAC/B,OAAc,iBAAiB,WAAmC;AAC1D,WAAA;AAAA,MACN,OAAO,KAAK,gBAAgB,UAAU,KAAK;AAAA,MAC3C,UAAU,KAAK,mBAAmB,UAAU,QAAQ;AAAA,IAAA;AAAA,EAEtD;AAAA,EAEA,OAAe,gBAAgB,UAAwC;AAChE,UAAA,4BAAyB;AAE/B,eAAW,EAAE,MAAM,OAAO,KAAK,UAAU;AACxC,YAAM,IAAI,MAAM,IAAI,IAAI,MAAM,CAAC;AAAA,IAChC;AAEO,WAAA;AAAA,EACR;AAAA,EAEA,OAAe,mBAAmB,aAAgD;AAC3E,UAAA,+BAA+B;AAErC,eAAW,UAAU,aAAa;AACxB,eAAA,IAAI,OAAO,MAAM;AAAA,QACzB,sBAAsB,OAAO;AAAA,QAC7B,QAAQ,KAAK,iBAAiB,OAAO,MAAM;AAAA,QAC3C,MAAM,OAAO;AAAA,QACb,QAAQ,OAAO,OAAO,IAAI,CAAO,QAAA,EAAE,QAAQ,IAAI,IAAI,GAAG,MAAM,EAAI,EAAA;AAAA,MAAA,CAChE;AAAA,IACF;AAEO,WAAA;AAAA,EACR;AAAA,EAEA,OAAe,iBAAiB,WAA0C;AACnE,UAAA,6BAA2B;AAEjC,eAAW,SAAS,WAAW;AACvB,aAAA,IAAI,MAAM,MAAM,KAAK;AAAA,IAC7B;AAEO,WAAA;AAAA,EACR;AACD;"}
@@ -93,5 +93,7 @@ class StateIterator {
93
93
  }
94
94
  }
95
95
  }
96
- export { StateIterator };
96
+ export {
97
+ StateIterator
98
+ };
97
99
  //# sourceMappingURL=StateIterator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StateIterator.js","sources":["../../../../src/core/state/StateIterator.ts"],"sourcesContent":["import { FieldMarker, HasManyRelationMarker, HasOneRelationMarker } from '../../markers'\nimport type { FieldValue, PlaceholderName } from '../../treeParameters'\nimport { assertNever } from '../../utils'\nimport type { TreeStore } from '../TreeStore'\nimport type { EntityListState } from './EntityListState'\nimport type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\nimport type { FieldState } from './FieldState'\nimport { getEntityMarker } from './getEntityMarker'\nimport type { RootStateNode, StateINode, StateNode } from './StateNode'\n\nexport class StateIterator {\n\tpublic static *eachSiblingRealm(\n\t\tstate: EntityRealmState,\n\t\trelevantPlaceholder?: PlaceholderName,\n\t): IterableIterator<EntityRealmState> {\n\t\tfor (let [realmKey, realm] of state.entity.realms) {\n\t\t\tif (realm.type === 'entityRealmStub') {\n\t\t\t\tif (relevantPlaceholder === undefined || getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {\n\t\t\t\t\trealm.getAccessor()\n\t\t\t\t\trealm = state.entity.realms.get(realmKey) as EntityRealmState\n\t\t\t\t} else {\n\t\t\t\t\t// This realm is irrelevant. No need to force-initialize it.\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield realm\n\t\t}\n\t}\n\n\t// Note that this only yields siblings with the same placeholderName!\n\tpublic static *eachSiblingRealmChild<Value extends FieldValue, S extends EntityListState | FieldState<Value>>(\n\t\ttreeStore: TreeStore,\n\t\tstate: S & StateNode<Value>,\n\t): IterableIterator<S> {\n\t\tif (state.type === 'entityList' && state.blueprint.parent === undefined) {\n\t\t\t// Top-level entity list\n\t\t\tfor (const [, rootStates] of treeStore.subTreeStatesByRoot) {\n\t\t\t\tconst rootList = rootStates.get(state.blueprint.marker.placeholderName)\n\t\t\t\tif (rootList?.type === 'entityList') {\n\t\t\t\t\tyield rootList as S\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet closestEntityRealm: EntityRealmState\n\t\tlet placeholderName: PlaceholderName\n\n\t\tif (state.type === 'field') {\n\t\t\tclosestEntityRealm = state.parent\n\t\t\tplaceholderName = state.placeholderName\n\t\t} else if (state.type === 'entityList') {\n\t\t\tclosestEntityRealm = state.blueprint.parent! // The parent-less case is handled above. Hence the assertion.\n\t\t\tplaceholderName = state.blueprint.marker.placeholderName\n\t\t} else {\n\t\t\treturn assertNever(state)\n\t\t}\n\n\t\tfor (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {\n\t\t\tconst child = realm.children.get(placeholderName)\n\t\t\tif (child === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (child.type === state.type) {\n\t\t\t\tyield child as S\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static *depthFirstAllNodes(root: StateNode): IterableIterator<StateNode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tswitch (childState.type) {\n\t\t\t\t\t\tcase 'field':\n\t\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tyield* this.depthFirstAllNodes(childState)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'entityRealmStub':\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(childState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'field':\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tyield root\n\t}\n\n\tpublic static *depthFirstINodes(\n\t\troot: StateINode,\n\t\tmatch?: (iNode: StateINode) => boolean,\n\t): IterableIterator<StateINode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tif (childState.type === 'entityRealm' || childState.type === 'entityList') {\n\t\t\t\t\t\tyield* this.depthFirstINodes(childState, match)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tif (match === undefined || match(root)) {\n\t\t\tyield root\n\t\t}\n\t}\n\n\tpublic static *eachRootState(treeStore: TreeStore): IterableIterator<[PlaceholderName, RootStateNode]> {\n\t\tfor (const rootStates of treeStore.subTreeStatesByRoot.values()) {\n\t\t\tyield* rootStates.entries()\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAUO,MAAM,cAAc;AAAA,UACX,iBACd,OACA,qBACqC;AACrC,aAAS,CAAC,UAAU,UAAU,MAAM,OAAO,QAAQ;AAC9C,UAAA,MAAM,SAAS,mBAAmB;AACjC,YAAA,wBAAwB,UAAa,gBAAgB,KAAK,EAAE,OAAO,aAAa,IAAI,mBAAmB,GAAG;AAC7G,gBAAM,YAAY;AAClB,kBAAQ,MAAM,OAAO,OAAO,IAAI,QAAQ;AAAA,QAAA,OAClC;AAEN;AAAA,QACD;AAAA,MACD;AACM,YAAA;AAAA,IACP;AAAA,EACD;AAAA,UAGe,sBACd,WACA,OACsB;AACtB,QAAI,MAAM,SAAS,gBAAgB,MAAM,UAAU,WAAW,QAAW;AAExE,iBAAW,CAAG,EAAA,eAAe,UAAU,qBAAqB;AAC3D,cAAM,WAAW,WAAW,IAAI,MAAM,UAAU,OAAO,eAAe;AAClE,YAAA,UAAU,SAAS,cAAc;AAC9B,gBAAA;AAAA,QACP;AAAA,MACD;AACA;AAAA,IACD;AAEI,QAAA;AACA,QAAA;AAEA,QAAA,MAAM,SAAS,SAAS;AAC3B,2BAAqB,MAAM;AAC3B,wBAAkB,MAAM;AAAA,IAAA,WACd,MAAM,SAAS,cAAc;AACvC,2BAAqB,MAAM,UAAU;AACnB,wBAAA,MAAM,UAAU,OAAO;AAAA,IAAA,OACnC;AACN,aAAO,YAAiB;AAAA,IACzB;AAEA,eAAW,SAAS,KAAK,iBAAiB,oBAAoB,eAAe,GAAG;AAC/E,YAAM,QAAQ,MAAM,SAAS,IAAI,eAAe;AAChD,UAAI,UAAU,QAAW;AACxB;AAAA,MACD;AACI,UAAA,MAAM,SAAS,MAAM,MAAM;AACxB,cAAA;AAAA,MACP;AAAA,IACD;AAAA,EACD;AAAA,UAEe,mBAAmB,MAA8C;AAC/E,YAAQ,KAAK;AAAA,WACP;AAAA,WACA;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,kBAAQ,WAAW;AAAA,iBACb;AAAA,iBACA;AAAA,iBACA;AACG,qBAAA,KAAK,mBAAmB,UAAU;AACzC;AAAA,iBACI;AACJ;AAAA;AAEA,qBAAO,YAAsB;AAAA;AAAA,QAEhC;AACA;AAAA,WACI;AACJ;AAAA;AAEA,eAAO,YAAgB;AAAA;AAEnB,UAAA;AAAA,EACP;AAAA,UAEe,iBACd,MACA,OAC+B;AAC/B,YAAQ,KAAK;AAAA,WACP;AAAA,WACA;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,cAAI,WAAW,SAAS,iBAAiB,WAAW,SAAS,cAAc;AACnE,mBAAA,KAAK,iBAAiB,YAAY,KAAK;AAAA,UAC/C;AAAA,QACD;AACA;AAAA;AAEA,eAAO,YAAgB;AAAA;AAEzB,QAAI,UAAU,UAAa,MAAM,IAAI,GAAG;AACjC,YAAA;AAAA,IACP;AAAA,EACD;AAAA,UAEe,cAAc,WAA0E;AACtG,eAAW,cAAc,UAAU,oBAAoB,OAAA,GAAU;AAChE,aAAO,WAAW;IACnB;AAAA,EACD;AACD;;"}
1
+ {"version":3,"file":"StateIterator.js","sources":["../../../../src/core/state/StateIterator.ts"],"sourcesContent":["import { FieldMarker, HasManyRelationMarker, HasOneRelationMarker } from '../../markers'\nimport type { FieldValue, PlaceholderName } from '../../treeParameters'\nimport { assertNever } from '../../utils'\nimport type { TreeStore } from '../TreeStore'\nimport type { EntityListState } from './EntityListState'\nimport type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\nimport type { FieldState } from './FieldState'\nimport { getEntityMarker } from './getEntityMarker'\nimport type { RootStateNode, StateINode, StateNode } from './StateNode'\n\nexport class StateIterator {\n\tpublic static *eachSiblingRealm(\n\t\tstate: EntityRealmState,\n\t\trelevantPlaceholder?: PlaceholderName,\n\t): IterableIterator<EntityRealmState> {\n\t\tfor (let [realmKey, realm] of state.entity.realms) {\n\t\t\tif (realm.type === 'entityRealmStub') {\n\t\t\t\tif (relevantPlaceholder === undefined || getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {\n\t\t\t\t\trealm.getAccessor()\n\t\t\t\t\trealm = state.entity.realms.get(realmKey) as EntityRealmState\n\t\t\t\t} else {\n\t\t\t\t\t// This realm is irrelevant. No need to force-initialize it.\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield realm\n\t\t}\n\t}\n\n\t// Note that this only yields siblings with the same placeholderName!\n\tpublic static *eachSiblingRealmChild<Value extends FieldValue, S extends EntityListState | FieldState<Value>>(\n\t\ttreeStore: TreeStore,\n\t\tstate: S & StateNode<Value>,\n\t): IterableIterator<S> {\n\t\tif (state.type === 'entityList' && state.blueprint.parent === undefined) {\n\t\t\t// Top-level entity list\n\t\t\tfor (const [, rootStates] of treeStore.subTreeStatesByRoot) {\n\t\t\t\tconst rootList = rootStates.get(state.blueprint.marker.placeholderName)\n\t\t\t\tif (rootList?.type === 'entityList') {\n\t\t\t\t\tyield rootList as S\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet closestEntityRealm: EntityRealmState\n\t\tlet placeholderName: PlaceholderName\n\n\t\tif (state.type === 'field') {\n\t\t\tclosestEntityRealm = state.parent\n\t\t\tplaceholderName = state.placeholderName\n\t\t} else if (state.type === 'entityList') {\n\t\t\tclosestEntityRealm = state.blueprint.parent! // The parent-less case is handled above. Hence the assertion.\n\t\t\tplaceholderName = state.blueprint.marker.placeholderName\n\t\t} else {\n\t\t\treturn assertNever(state)\n\t\t}\n\n\t\tfor (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {\n\t\t\tconst child = realm.children.get(placeholderName)\n\t\t\tif (child === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (child.type === state.type) {\n\t\t\t\tyield child as S\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static *depthFirstAllNodes(root: StateNode): IterableIterator<StateNode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tswitch (childState.type) {\n\t\t\t\t\t\tcase 'field':\n\t\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tyield* this.depthFirstAllNodes(childState)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'entityRealmStub':\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(childState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'field':\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tyield root\n\t}\n\n\tpublic static *depthFirstINodes(\n\t\troot: StateINode,\n\t\tmatch?: (iNode: StateINode) => boolean,\n\t): IterableIterator<StateINode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tif (childState.type === 'entityRealm' || childState.type === 'entityList') {\n\t\t\t\t\t\tyield* this.depthFirstINodes(childState, match)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tif (match === undefined || match(root)) {\n\t\t\tyield root\n\t\t}\n\t}\n\n\tpublic static *eachRootState(treeStore: TreeStore): IterableIterator<[PlaceholderName, RootStateNode]> {\n\t\tfor (const rootStates of treeStore.subTreeStatesByRoot.values()) {\n\t\t\tyield* rootStates.entries()\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAUO,MAAM,cAAc;AAAA,EAC1B,QAAe,iBACd,OACA,qBACqC;AACrC,aAAS,CAAC,UAAU,KAAK,KAAK,MAAM,OAAO,QAAQ;AAC9C,UAAA,MAAM,SAAS,mBAAmB;AACjC,YAAA,wBAAwB,UAAa,gBAAgB,KAAK,EAAE,OAAO,aAAa,IAAI,mBAAmB,GAAG;AAC7G,gBAAM,YAAY;AAClB,kBAAQ,MAAM,OAAO,OAAO,IAAI,QAAQ;AAAA,QAAA,OAClC;AAEN;AAAA,QACD;AAAA,MACD;AACM,YAAA;AAAA,IACP;AAAA,EACD;AAAA,EAGA,QAAe,sBACd,WACA,OACsB;AACtB,QAAI,MAAM,SAAS,gBAAgB,MAAM,UAAU,WAAW,QAAW;AAExE,iBAAW,CAAG,EAAA,UAAU,KAAK,UAAU,qBAAqB;AAC3D,cAAM,WAAW,WAAW,IAAI,MAAM,UAAU,OAAO,eAAe;AAClE,YAAA,UAAU,SAAS,cAAc;AAC9B,gBAAA;AAAA,QACP;AAAA,MACD;AACA;AAAA,IACD;AAEI,QAAA;AACA,QAAA;AAEA,QAAA,MAAM,SAAS,SAAS;AAC3B,2BAAqB,MAAM;AAC3B,wBAAkB,MAAM;AAAA,IAAA,WACd,MAAM,SAAS,cAAc;AACvC,2BAAqB,MAAM,UAAU;AACnB,wBAAA,MAAM,UAAU,OAAO;AAAA,IAAA,OACnC;AACN,aAAO,YAAiB;AAAA,IACzB;AAEA,eAAW,SAAS,KAAK,iBAAiB,oBAAoB,eAAe,GAAG;AAC/E,YAAM,QAAQ,MAAM,SAAS,IAAI,eAAe;AAChD,UAAI,UAAU,QAAW;AACxB;AAAA,MACD;AACI,UAAA,MAAM,SAAS,MAAM,MAAM;AACxB,cAAA;AAAA,MACP;AAAA,IACD;AAAA,EACD;AAAA,EAEA,QAAe,mBAAmB,MAA8C;AAC/E,YAAQ,KAAK;AAAA,WACP;AAAA,WACA;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,kBAAQ,WAAW;AAAA,iBACb;AAAA,iBACA;AAAA,iBACA;AACG,qBAAA,KAAK,mBAAmB,UAAU;AACzC;AAAA,iBACI;AACJ;AAAA;AAEA,qBAAO,YAAsB;AAAA;AAAA,QAEhC;AACA;AAAA,WACI;AACJ;AAAA;AAEA,eAAO,YAAgB;AAAA;AAEnB,UAAA;AAAA,EACP;AAAA,EAEA,QAAe,iBACd,MACA,OAC+B;AAC/B,YAAQ,KAAK;AAAA,WACP;AAAA,WACA;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,cAAI,WAAW,SAAS,iBAAiB,WAAW,SAAS,cAAc;AACnE,mBAAA,KAAK,iBAAiB,YAAY,KAAK;AAAA,UAC/C;AAAA,QACD;AACA;AAAA;AAEA,eAAO,YAAgB;AAAA;AAEzB,QAAI,UAAU,UAAa,MAAM,IAAI,GAAG;AACjC,YAAA;AAAA,IACP;AAAA,EACD;AAAA,EAEA,QAAe,cAAc,WAA0E;AACtG,eAAW,cAAc,UAAU,oBAAoB,OAAA,GAAU;AAChE,aAAO,WAAW;IACnB;AAAA,EACD;AACD;"}
@@ -1,3 +1,5 @@
1
1
  const getEntityMarker = (realm) => realm.blueprint.type === "listEntity" ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker;
2
- export { getEntityMarker };
2
+ export {
3
+ getEntityMarker
4
+ };
3
5
  //# sourceMappingURL=getEntityMarker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getEntityMarker.js","sources":["../../../../src/core/state/getEntityMarker.ts"],"sourcesContent":["import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\n\nexport const getEntityMarker = (realm: EntityRealmState | EntityRealmStateStub) =>\n\trealm.blueprint.type === 'listEntity' ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,CAAC,UAC/B,MAAM,UAAU,SAAS,eAAe,MAAM,UAAU,OAAO,UAAU,SAAS,MAAM,UAAU;;"}
1
+ {"version":3,"file":"getEntityMarker.js","sources":["../../../../src/core/state/getEntityMarker.ts"],"sourcesContent":["import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\n\nexport const getEntityMarker = (realm: EntityRealmState | EntityRealmStateStub) =>\n\trealm.blueprint.type === 'listEntity' ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,CAAC,UAC/B,MAAM,UAAU,SAAS,eAAe,MAAM,UAAU,OAAO,UAAU,SAAS,MAAM,UAAU;"}
@@ -27,5 +27,7 @@ const getCombinedSignal = (components) => {
27
27
  refresh();
28
28
  return controller.signal;
29
29
  };
30
- export { getCombinedSignal };
30
+ export {
31
+ getCombinedSignal
32
+ };
31
33
  //# sourceMappingURL=getCombinedSignal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCombinedSignal.js","sources":["../../../../src/core/utils/getCombinedSignal.ts"],"sourcesContent":["// Returns a signal that aborts when all present signals are aborted.\nexport const getCombinedSignal = (components: Iterable<AbortSignal | undefined>): AbortSignal => {\n\tlet abortedCount = 0\n\tlet signalCount = 0\n\n\tconst controller = new AbortController()\n\tconst refresh = () => {\n\t\tif (signalCount === 0) {\n\t\t\treturn\n\t\t}\n\t\tif (abortedCount >= signalCount) {\n\t\t\tcontroller.abort()\n\t\t}\n\t}\n\n\tfor (const component of components) {\n\t\tif (!component) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsignalCount++\n\n\t\tif (component.aborted) {\n\t\t\tabortedCount++\n\t\t} else {\n\t\t\tcomponent.addEventListener('abort', () => {\n\t\t\t\tabortedCount++\n\t\t\t\trefresh()\n\t\t\t})\n\t\t}\n\t}\n\n\trefresh()\n\n\treturn controller.signal\n}\n"],"names":[],"mappings":"AACa,MAAA,oBAAoB,CAAC,eAA+D;AAChG,MAAI,eAAe;AACnB,MAAI,cAAc;AAEZ,QAAA,aAAa,IAAI;AACvB,QAAM,UAAU,MAAM;AACrB,QAAI,gBAAgB,GAAG;AACtB;AAAA,IACD;AACA,QAAI,gBAAgB,aAAa;AAChC,iBAAW,MAAM;AAAA,IAClB;AAAA,EAAA;AAGD,aAAW,aAAa,YAAY;AACnC,QAAI,CAAC,WAAW;AACf;AAAA,IACD;AAEA;AAEA,QAAI,UAAU,SAAS;AACtB;AAAA,IAAA,OACM;AACI,gBAAA,iBAAiB,SAAS,MAAM;AACzC;AACQ;MAAA,CACR;AAAA,IACF;AAAA,EACD;AAEQ;AAER,SAAO,WAAW;AACnB;;"}
1
+ {"version":3,"file":"getCombinedSignal.js","sources":["../../../../src/core/utils/getCombinedSignal.ts"],"sourcesContent":["// Returns a signal that aborts when all present signals are aborted.\nexport const getCombinedSignal = (components: Iterable<AbortSignal | undefined>): AbortSignal => {\n\tlet abortedCount = 0\n\tlet signalCount = 0\n\n\tconst controller = new AbortController()\n\tconst refresh = () => {\n\t\tif (signalCount === 0) {\n\t\t\treturn\n\t\t}\n\t\tif (abortedCount >= signalCount) {\n\t\t\tcontroller.abort()\n\t\t}\n\t}\n\n\tfor (const component of components) {\n\t\tif (!component) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsignalCount++\n\n\t\tif (component.aborted) {\n\t\t\tabortedCount++\n\t\t} else {\n\t\t\tcomponent.addEventListener('abort', () => {\n\t\t\t\tabortedCount++\n\t\t\t\trefresh()\n\t\t\t})\n\t\t}\n\t}\n\n\trefresh()\n\n\treturn controller.signal\n}\n"],"names":[],"mappings":"AACa,MAAA,oBAAoB,CAAC,eAA+D;AAChG,MAAI,eAAe;AACnB,MAAI,cAAc;AAEZ,QAAA,aAAa,IAAI;AACvB,QAAM,UAAU,MAAM;AACrB,QAAI,gBAAgB,GAAG;AACtB;AAAA,IACD;AACA,QAAI,gBAAgB,aAAa;AAChC,iBAAW,MAAM;AAAA,IAClB;AAAA,EAAA;AAGD,aAAW,aAAa,YAAY;AACnC,QAAI,CAAC,WAAW;AACf;AAAA,IACD;AAEA;AAEA,QAAI,UAAU,SAAS;AACtB;AAAA,IAAA,OACM;AACI,gBAAA,iBAAiB,SAAS,MAAM;AACzC;AACQ;MAAA,CACR;AAAA,IACF;AAAA,EACD;AAEQ;AAER,SAAO,WAAW;AACnB;"}
@@ -27,5 +27,7 @@ function Component(render, decider, displayName) {
27
27
  }
28
28
  assertNever();
29
29
  }
30
- export { Component };
30
+ export {
31
+ Component
32
+ };
31
33
  //# sourceMappingURL=Component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Component.js","sources":["../../../src/coreComponents/Component.tsx"],"sourcesContent":["import { memo, NamedExoticComponent, PropsWithChildren, ReactElement } from 'react'\nimport { useEnvironment } from '../accessorPropagation/useEnvironment'\nimport type { Environment } from '../dao'\nimport { assertNever } from '../utils'\nimport type { MarkerProvider, StaticRenderProvider, StaticRenderProviderProps } from './MarkerProvider'\n\ninterface EnvironmentAwareFunctionComponent<P> {\n\t(props: PropsWithChildren<P>, environment: Environment): ReactElement<any, any> | null;\n\tdisplayName?: string | undefined;\n}\n\nfunction Component<Props extends {}>(\n\tstatelessRender: EnvironmentAwareFunctionComponent<Props>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: EnvironmentAwareFunctionComponent<Props>,\n\tstaticRender: (\n\t\tprops: StaticRenderProviderProps<Props, NonStaticPropNames>,\n\t\tenvironment: Environment,\n\t) => ReactElement | null,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: EnvironmentAwareFunctionComponent<Props>,\n\tmarkerProvisions: MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\trender: EnvironmentAwareFunctionComponent<Props>,\n\tdecider?:\n\t\t| string\n\t\t| ((props: StaticRenderProviderProps<Props, NonStaticPropNames>, environment: Environment) => ReactElement | null)\n\t\t| MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n) {\n\tconst RenderWithEnv = (props: Props) => render(props, useEnvironment())\n\tconst renderWithEnv = typeof render !== 'function' || render.length < 2 ? render : RenderWithEnv\n\n\tif (decider === undefined || typeof decider === 'string') {\n\t\trender.displayName = decider\n\t\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props> = memo<Props>(renderWithEnv)\n\t\taugmentedRender.staticRender = render as StaticRenderProvider<Props>['staticRender']\n\t\taugmentedRender.displayName = decider\n\n\t\treturn augmentedRender\n\t}\n\n\trender.displayName = displayName\n\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props, NonStaticPropNames> = memo<Props>(renderWithEnv)\n\taugmentedRender.displayName = displayName\n\n\tif (typeof decider === 'function') {\n\t\taugmentedRender.staticRender = decider\n\n\t\treturn augmentedRender\n\t}\n\tif (typeof decider === 'object') {\n\t\tfor (const provisionName in decider) {\n\t\t\tconst methodName = provisionName as keyof MarkerProvider<Props, NonStaticPropNames>\n\t\t\t;(augmentedRender[methodName] as MarkerProvider<Props, NonStaticPropNames>[typeof methodName]) =\n\t\t\t\tdecider[methodName]\n\t\t}\n\n\t\treturn augmentedRender\n\t}\n\tassertNever(decider)\n}\n\nexport type { EnvironmentAwareFunctionComponent }\nexport { Component }\n"],"names":[],"mappings":";;;AA+BA,mBACC,QACA,SAIA,aACC;AACD,QAAM,gBAAgB,CAAC,UAAiB,OAAO,OAAO,gBAAgB;AACtE,QAAM,gBAAgB,OAAO,WAAW,cAAc,OAAO,SAAS,IAAI,SAAS;AAEnF,MAAI,YAAY,UAAa,OAAO,YAAY,UAAU;AACzD,WAAO,cAAc;AACf,UAAA,mBAAuE,KAAY,aAAa;AACtG,qBAAgB,eAAe;AAC/B,qBAAgB,cAAc;AAEvB,WAAA;AAAA,EACR;AAEA,SAAO,cAAc;AACf,QAAA,kBAA2F,KAAY,aAAa;AAC1H,kBAAgB,cAAc;AAE1B,MAAA,OAAO,YAAY,YAAY;AAClC,oBAAgB,eAAe;AAExB,WAAA;AAAA,EACR;AACI,MAAA,OAAO,YAAY,UAAU;AAChC,eAAW,iBAAiB,SAAS;AACpC,YAAM,aAAa;AACjB,sBAAgB,cACjB,QAAQ;AAAA,IACV;AAEO,WAAA;AAAA,EACR;AACA,cAAmB;AACpB;;"}
1
+ {"version":3,"file":"Component.js","sources":["../../../src/coreComponents/Component.tsx"],"sourcesContent":["import { memo, NamedExoticComponent, PropsWithChildren, ReactElement } from 'react'\nimport { useEnvironment } from '../accessorPropagation/useEnvironment'\nimport type { Environment } from '../dao'\nimport { assertNever } from '../utils'\nimport type { MarkerProvider, StaticRenderProvider, StaticRenderProviderProps } from './MarkerProvider'\n\ninterface EnvironmentAwareFunctionComponent<P> {\n\t(props: PropsWithChildren<P>, environment: Environment): ReactElement<any, any> | null;\n\tdisplayName?: string | undefined;\n}\n\nfunction Component<Props extends {}>(\n\tstatelessRender: EnvironmentAwareFunctionComponent<Props>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: EnvironmentAwareFunctionComponent<Props>,\n\tstaticRender: (\n\t\tprops: StaticRenderProviderProps<Props, NonStaticPropNames>,\n\t\tenvironment: Environment,\n\t) => ReactElement | null,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\tstatefulRender: EnvironmentAwareFunctionComponent<Props>,\n\tmarkerProvisions: MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n): NamedExoticComponent<Props>\n\nfunction Component<Props extends {}, NonStaticPropNames extends keyof Props = never>(\n\trender: EnvironmentAwareFunctionComponent<Props>,\n\tdecider?:\n\t\t| string\n\t\t| ((props: StaticRenderProviderProps<Props, NonStaticPropNames>, environment: Environment) => ReactElement | null)\n\t\t| MarkerProvider<Props, NonStaticPropNames>,\n\tdisplayName?: string,\n) {\n\tconst RenderWithEnv = (props: Props) => render(props, useEnvironment())\n\tconst renderWithEnv = typeof render !== 'function' || render.length < 2 ? render : RenderWithEnv\n\n\tif (decider === undefined || typeof decider === 'string') {\n\t\trender.displayName = decider\n\t\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props> = memo<Props>(renderWithEnv)\n\t\taugmentedRender.staticRender = render as StaticRenderProvider<Props>['staticRender']\n\t\taugmentedRender.displayName = decider\n\n\t\treturn augmentedRender\n\t}\n\n\trender.displayName = displayName\n\tconst augmentedRender: NamedExoticComponent<Props> & MarkerProvider<Props, NonStaticPropNames> = memo<Props>(renderWithEnv)\n\taugmentedRender.displayName = displayName\n\n\tif (typeof decider === 'function') {\n\t\taugmentedRender.staticRender = decider\n\n\t\treturn augmentedRender\n\t}\n\tif (typeof decider === 'object') {\n\t\tfor (const provisionName in decider) {\n\t\t\tconst methodName = provisionName as keyof MarkerProvider<Props, NonStaticPropNames>\n\t\t\t;(augmentedRender[methodName] as MarkerProvider<Props, NonStaticPropNames>[typeof methodName]) =\n\t\t\t\tdecider[methodName]\n\t\t}\n\n\t\treturn augmentedRender\n\t}\n\tassertNever(decider)\n}\n\nexport type { EnvironmentAwareFunctionComponent }\nexport { Component }\n"],"names":["Component","render","decider","displayName","RenderWithEnv","props","useEnvironment","renderWithEnv","length","undefined","augmentedRender","memo","staticRender","provisionName","methodName","assertNever"],"mappings":";;;AA+BA,SAASA,UACRC,QACAC,SAIAC,aACC;AACD,QAAMC,gBAAgB,CAACC,UAAiBJ,OAAOI,OAAOC,gBAAR;AAC9C,QAAMC,gBAAgB,OAAON,WAAW,cAAcA,OAAOO,SAAS,IAAIP,SAASG;AAEnF,MAAIF,YAAYO,UAAa,OAAOP,YAAY,UAAU;AACzDD,WAAOE,cAAcD;AACfQ,UAAAA,mBAAuEC,KAAYJ,aAAR;AACjFG,qBAAgBE,eAAeX;AAC/BS,qBAAgBP,cAAcD;AAEvBQ,WAAAA;AAAAA,EACP;AAEDT,SAAOE,cAAcA;AACfO,QAAAA,kBAA2FC,KAAYJ,aAAR;AACrGG,kBAAgBP,cAAcA;AAE1B,MAAA,OAAOD,YAAY,YAAY;AAClCQ,oBAAgBE,eAAeV;AAExBQ,WAAAA;AAAAA,EACP;AACG,MAAA,OAAOR,YAAY,UAAU;AAChC,eAAWW,iBAAiBX,SAAS;AACpC,YAAMY,aAAaD;AACjBH,sBAAgBI,cACjBZ,QAAQY;AAAAA,IACT;AAEMJ,WAAAA;AAAAA,EACP;AACDK,cAAW;AACX;"}
@@ -1,4 +1,5 @@
1
1
  import { memo, createElement } from "react";
2
+ import { jsx } from "react/jsx-runtime";
2
3
  import { useDataBinding } from "../accessorTree/useDataBinding.js";
3
4
  import { AccessorTree } from "../accessorTree/AccessorTree.js";
4
5
  const DataBindingProvider = memo(function DataBindingProvider2(props) {
@@ -10,9 +11,12 @@ const DataBindingProvider = memo(function DataBindingProvider2(props) {
10
11
  ...props.stateProps,
11
12
  accessorTreeState
12
13
  }, props.children) : props.children;
13
- return /* @__PURE__ */ createElement(AccessorTree, {
14
- state: accessorTreeState
15
- }, children);
14
+ return /* @__PURE__ */ jsx(AccessorTree, {
15
+ state: accessorTreeState,
16
+ children
17
+ });
16
18
  });
17
- export { DataBindingProvider };
19
+ export {
20
+ DataBindingProvider
21
+ };
18
22
  //# sourceMappingURL=DataBindingProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataBindingProvider.js","sources":["../../../src/coreComponents/DataBindingProvider.tsx"],"sourcesContent":["import { ComponentType, createElement, memo, ReactElement, ReactNode } from 'react'\nimport { AccessorTree, AccessorTreeState, useDataBinding } from '../accessorTree'\n\nexport interface DataBindingProviderBaseProps {\n\tchildren?: ReactNode\n\trefreshOnPersist?: boolean\n}\n\nexport interface DataBindingStateComponentProps {\n\taccessorTreeState: AccessorTreeState\n\tchildren?: ReactNode\n}\n\nexport type DataBindingProviderProps<StateProps> = DataBindingProviderBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tstateComponent: ComponentType<StateProps & DataBindingStateComponentProps>\n\t\t\t\tstateProps?: StateProps\n\t\t }\n\t)\n\nexport const DataBindingProvider = memo(function DataBindingProvider<StateProps extends DataBindingStateComponentProps>(\n\tprops: DataBindingProviderProps<StateProps>,\n) {\n\tconst accessorTreeState = useDataBinding({\n\t\tnodeTree: props.children,\n\t\trefreshOnPersist: props.refreshOnPersist ?? false,\n\t})\n\n\tconst children =\n\t\t'stateComponent' in props && props.stateComponent\n\t\t\t? createElement(\n\t\t\t\t\tprops.stateComponent,\n\t\t\t\t\t{\n\t\t\t\t\t\t...props.stateProps!,\n\t\t\t\t\t\taccessorTreeState: accessorTreeState,\n\t\t\t\t\t},\n\t\t\t\t\tprops.children,\n\t\t\t )\n\t\t\t: props.children\n\treturn <AccessorTree state={accessorTreeState}>{children}</AccessorTree>\n}) as <StateProps>(props: DataBindingProviderProps<StateProps>) => ReactElement\n"],"names":["_jsx"],"mappings":";;;AAsBa,MAAA,sBAAsB,KAAK,8BACvC,OACC;AACD,QAAM,oBAAoB,eAAe;AAAA,IACxC,UAAU,MAAM;AAAA,IAChB,kBAAkB,MAAM,oBAAoB;AAAA,EAAA,CAC5C;AAED,QAAM,WACL,oBAAoB,SAAS,MAAM,iBAChC,cACA,MAAM,gBACN;AAAA,OACI,MAAM;AAAA,IACT;AAAA,EAED,GAAA,MAAM,QACN,IACA,MAAM;AACV,SAAQA,8BAAA,cAAA;AAAA,IAAa,OAAO;AAAA,EAAA,GAAoB,QAAS;AAC1D,CAAC;;"}
1
+ {"version":3,"file":"DataBindingProvider.js","sources":["../../../src/coreComponents/DataBindingProvider.tsx"],"sourcesContent":["import { ComponentType, createElement, memo, ReactElement, ReactNode } from 'react'\nimport { AccessorTree, AccessorTreeState, useDataBinding } from '../accessorTree'\n\nexport interface DataBindingProviderBaseProps {\n\tchildren?: ReactNode\n\trefreshOnPersist?: boolean\n}\n\nexport interface DataBindingStateComponentProps {\n\taccessorTreeState: AccessorTreeState\n\tchildren?: ReactNode\n}\n\nexport type DataBindingProviderProps<StateProps> = DataBindingProviderBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tstateComponent: ComponentType<StateProps & DataBindingStateComponentProps>\n\t\t\t\tstateProps?: StateProps\n\t\t }\n\t)\n\nexport const DataBindingProvider = memo(function DataBindingProvider<StateProps extends DataBindingStateComponentProps>(\n\tprops: DataBindingProviderProps<StateProps>,\n) {\n\tconst accessorTreeState = useDataBinding({\n\t\tnodeTree: props.children,\n\t\trefreshOnPersist: props.refreshOnPersist ?? false,\n\t})\n\n\tconst children =\n\t\t'stateComponent' in props && props.stateComponent\n\t\t\t? createElement(\n\t\t\t\t\tprops.stateComponent,\n\t\t\t\t\t{\n\t\t\t\t\t\t...props.stateProps!,\n\t\t\t\t\t\taccessorTreeState: accessorTreeState,\n\t\t\t\t\t},\n\t\t\t\t\tprops.children,\n\t\t\t )\n\t\t\t: props.children\n\treturn <AccessorTree state={accessorTreeState}>{children}</AccessorTree>\n}) as <StateProps>(props: DataBindingProviderProps<StateProps>) => ReactElement\n"],"names":["DataBindingProvider","memo","props","accessorTreeState","useDataBinding","nodeTree","children","refreshOnPersist","stateComponent","createElement","stateProps"],"mappings":";;;;AAsBO,MAAMA,sBAAsBC,KAAK,SAASD,qBAChDE,OACC;AACD,QAAMC,oBAAoBC,eAAe;AAAA,IACxCC,UAAUH,MAAMI;AAAAA,IAChBC,kBAAkBL,MAAMK,oBAAoB;AAAA,EAAA,CAFL;AAKxC,QAAMD,WACL,oBAAoBJ,SAASA,MAAMM,iBAChCC,cACAP,MAAMM,gBACN;AAAA,IACC,GAAGN,MAAMQ;AAAAA,IACTP;AAAAA,EAEDD,GAAAA,MAAMI,QANO,IAQbJ,MAAMI;AACV,6BAAQ,cAAD;AAAA,IAAc,OAAOH;AAAAA,IAArB;AAAA,EAAA,CAAP;AACA,CApBsC;"}
@@ -1,11 +1,16 @@
1
- import { createElement } from "react";
2
1
  import { Component } from "./Component.js";
2
+ import { jsx } from "react/jsx-runtime";
3
3
  import { AccessorProvider } from "../accessorPropagation/AccessorProvider.js";
4
- const Entity = Component(({ children, accessor }) => {
5
- return /* @__PURE__ */ createElement(AccessorProvider, {
4
+ const Entity = Component(({
5
+ children,
6
+ accessor
7
+ }) => {
8
+ return /* @__PURE__ */ jsx(AccessorProvider, {
6
9
  accessor,
7
- key: accessor?.key
8
- }, children);
10
+ children
11
+ }, accessor?.key);
9
12
  }, "Entity");
10
- export { Entity };
13
+ export {
14
+ Entity
15
+ };
11
16
  //# sourceMappingURL=Entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Entity.js","sources":["../../../src/coreComponents/Entity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { AccessorProvider } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport { Component } from './Component'\n\nexport interface EntityBaseProps {\n\taccessor: EntityAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityProps = EntityBaseProps\n\nexport const Entity = Component(\n\t({ children, accessor }: EntityProps) => {\n\treturn (\n\t\t// HACK: the ?. is actually important, despite the typings.\n\t\t<AccessorProvider accessor={accessor} key={accessor?.key}>\n\t\t\t{children}\n\t\t</AccessorProvider>\n\t)\n\t},\n\t'Entity',\n)\n"],"names":["_jsx"],"mappings":";;;AAYO,MAAM,SAAS,UACrB,CAAC,EAAE,UAAU,eAA4B;AACzC,SAEEA,8BAAA,kBAAA;AAAA,IAAiB;AAAA,IAAoB,KAAK,UAAU;AAAA,EAAA,GACnD,QACF;AAED,GACA,QACD;;"}
1
+ {"version":3,"file":"Entity.js","sources":["../../../src/coreComponents/Entity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { AccessorProvider } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport { Component } from './Component'\n\nexport interface EntityBaseProps {\n\taccessor: EntityAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityProps = EntityBaseProps\n\nexport const Entity = Component(\n\t({ children, accessor }: EntityProps) => {\n\treturn (\n\t\t// HACK: the ?. is actually important, despite the typings.\n\t\t<AccessorProvider accessor={accessor} key={accessor?.key}>\n\t\t\t{children}\n\t\t</AccessorProvider>\n\t)\n\t},\n\t'Entity',\n)\n"],"names":["Entity","Component","children","accessor","key"],"mappings":";;;AAYaA,MAAAA,SAASC,UACrB,CAAC;AAAA,EAAEC;AAAAA,EAAUC;AAAZ,MAAwC;AACzC,6BAEE,kBAAD;AAAA,IAAkB;AAAA,IAAlB;AAAA,EAAA,GAA2CA,UAAUC,GAArD;AAIA,GACD,QAT8B;"}
@@ -1,6 +1,7 @@
1
- import { createElement, Fragment } from "react";
1
+ import { createElement } from "react";
2
2
  import { Component } from "./Component.js";
3
3
  import { Entity } from "./Entity.js";
4
+ import { jsx, Fragment } from "react/jsx-runtime";
4
5
  const EntityList = Component((props) => {
5
6
  if ("listComponent" in props && props.listComponent) {
6
7
  return createElement(props.listComponent, {
@@ -9,12 +10,14 @@ const EntityList = Component((props) => {
9
10
  children: props.children
10
11
  });
11
12
  }
12
- return /* @__PURE__ */ createElement(Fragment, null, Array.from(props.accessor, (entity) => {
13
- return /* @__PURE__ */ createElement(Entity, {
14
- key: entity.key,
15
- accessor: entity
16
- }, props.children);
17
- }));
13
+ return /* @__PURE__ */ jsx(Fragment, {
14
+ children: Array.from(props.accessor, (entity) => {
15
+ return /* @__PURE__ */ jsx(Entity, {
16
+ accessor: entity,
17
+ children: props.children
18
+ }, entity.key);
19
+ })
20
+ });
18
21
  }, (props) => {
19
22
  if ("listComponent" in props && props.listComponent) {
20
23
  return createElement(props.listComponent, {
@@ -23,7 +26,11 @@ const EntityList = Component((props) => {
23
26
  children: props.children
24
27
  });
25
28
  }
26
- return /* @__PURE__ */ createElement(Fragment, null, props.children);
29
+ return /* @__PURE__ */ jsx(Fragment, {
30
+ children: props.children
31
+ });
27
32
  }, "EntityList");
28
- export { EntityList };
33
+ export {
34
+ EntityList
35
+ };
29
36
  //# sourceMappingURL=EntityList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityList.js","sources":["../../../src/coreComponents/EntityList.tsx"],"sourcesContent":["import { ComponentType, createElement, ReactElement, ReactNode } from 'react'\nimport type { EntityListAccessor } from '../accessors'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\n\nexport interface EntityListBaseProps {\n\taccessor: EntityListAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityListProps<ListProps> = EntityListBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\nexport const EntityList = Component(\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: props.accessor,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{Array.from(props.accessor, entity => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Entity key={entity.key} accessor={entity}>\n\t\t\t\t\t\t\t{props.children}\n\t\t\t\t\t\t</Entity>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</>\n\t\t)\n\t},\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: undefined as any,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn <>{props.children}</>\n\t},\n\t'EntityList',\n) as <ListProps>(props: EntityListProps<ListProps>) => ReactElement\n"],"names":["_jsx","_jsxFragment"],"mappings":";;;AAmBa,MAAA,aAAa,UACzB,CAAuB,UAAsC;AACxD,MAAA,mBAAmB,SAAS,MAAM,eAAe;AAC7C,WAAA,cAAc,MAAM,eAAe;AAAA,SACtC,MAAM;AAAA,MACT,UAAU,MAAM;AAAA,MAChB,UAAU,MAAM;AAAA,IAAA,CAChB;AAAA,EACF;AACA,SAEGA,8BAAAC,UAAA,MAAA,MAAM,KAAK,MAAM,UAAU,CAAU,WAAA;AACrC,WACED,8BAAA,QAAA;AAAA,MAAO,KAAK,OAAO;AAAA,MAAK,UAAU;AAAA,IAAA,GACjC,MAAM,QACR;AAAA,EAED,CAAA,CACF;AAEF,GACA,CAAuB,UAAsC;AACxD,MAAA,mBAAmB,SAAS,MAAM,eAAe;AAC7C,WAAA,cAAc,MAAM,eAAe;AAAA,SACtC,MAAM;AAAA,MACT,UAAU;AAAA,MACV,UAAU,MAAM;AAAA,IAAA,CAChB;AAAA,EACF;AACO,SAAAA,8BAAAC,UAAA,MAAG,MAAM,QAAS;AAC1B,GACA,YACD;;"}
1
+ {"version":3,"file":"EntityList.js","sources":["../../../src/coreComponents/EntityList.tsx"],"sourcesContent":["import { ComponentType, createElement, ReactElement, ReactNode } from 'react'\nimport type { EntityListAccessor } from '../accessors'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\n\nexport interface EntityListBaseProps {\n\taccessor: EntityListAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityListProps<ListProps> = EntityListBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\nexport const EntityList = Component(\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: props.accessor,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{Array.from(props.accessor, entity => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Entity key={entity.key} accessor={entity}>\n\t\t\t\t\t\t\t{props.children}\n\t\t\t\t\t\t</Entity>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</>\n\t\t)\n\t},\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: undefined as any,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn <>{props.children}</>\n\t},\n\t'EntityList',\n) as <ListProps>(props: EntityListProps<ListProps>) => ReactElement\n"],"names":["EntityList","Component","props","listComponent","createElement","listProps","accessor","children","_Fragment","Array","from","entity","key","undefined"],"mappings":";;;;AAmBaA,MAAAA,aAAaC,UACzB,CAAuBC,UAAsC;AACxD,MAAA,mBAAmBA,SAASA,MAAMC,eAAe;AAC7CC,WAAAA,cAAcF,MAAMC,eAAe;AAAA,MACzC,GAAGD,MAAMG;AAAAA,MACTC,UAAUJ,MAAMI;AAAAA,MAChBC,UAAUL,MAAMK;AAAAA,IAAAA,CAHG;AAAA,EAKpB;AACD,6BACCC,UAAA;AAAA,IAAA,UACEC,MAAMC,KAAKR,MAAMI,UAAUK,CAAU,WAAA;AACrC,iCACE,QAAD;AAAA,QAAyB,UAAUA;AAAAA,QAAnC,UACET,MAAMK;AAAAA,MAAAA,GADKI,OAAOC,GAApB;AAAA,IAAA,CAFD;AAAA,EAAA,CAFH;AAWA,GACD,CAAuBV,UAAsC;AACxD,MAAA,mBAAmBA,SAASA,MAAMC,eAAe;AAC7CC,WAAAA,cAAcF,MAAMC,eAAe;AAAA,MACzC,GAAGD,MAAMG;AAAAA,MACTC,UAAUO;AAAAA,MACVN,UAAUL,MAAMK;AAAAA,IAAAA,CAHG;AAAA,EAKpB;AACD,6BAAOC,UAAA;AAAA,IAAA,UAAGN,MAAMK;AAAAA,EAAAA,CAAhB;AACA,GACD,YA/BkC;"}
@@ -1,10 +1,11 @@
1
- import { createElement, useCallback } from "react";
2
1
  import { useConstantValueInvariant } from "@contember/react-utils";
2
+ import { useCallback } from "react";
3
3
  import { PRIMARY_KEY_NAME } from "../bindingTypes.js";
4
4
  import { Component } from "./Component.js";
5
5
  import { EntityList } from "./EntityList.js";
6
6
  import { Field } from "./Field.js";
7
7
  import { TreeNodeEnvironmentFactory } from "../dao/TreeNodeEnvironmentFactory.js";
8
+ import { jsxs, jsx } from "react/jsx-runtime";
8
9
  import { useGetEntityListSubTree } from "../accessorPropagation/useGetEntityListSubTree.js";
9
10
  import { useEntityListSubTreeParameters } from "../accessorPropagation/useEntityListSubTreeParameters.js";
10
11
  import { useAccessorUpdateSubscription } from "../accessorPropagation/useAccessorUpdateSubscription.js";
@@ -15,7 +16,7 @@ const EntityListSubTree = Component((props) => {
15
16
  const parameters = useEntityListSubTreeParameters(props);
16
17
  const getAccessor = useCallback(() => getSubTree(parameters, props.treeRootId), [getSubTree, parameters, props.treeRootId]);
17
18
  const accessor = useAccessorUpdateSubscription(getAccessor);
18
- return /* @__PURE__ */ createElement(EntityList, {
19
+ return /* @__PURE__ */ jsx(EntityList, {
19
20
  ...props,
20
21
  accessor
21
22
  });
@@ -26,16 +27,19 @@ const EntityListSubTree = Component((props) => {
26
27
  }
27
28
  return MarkerFactory.createEntityListSubTreeMarker(props, fields, environment);
28
29
  },
29
- staticRender: (props) => /* @__PURE__ */ createElement(EntityList, {
30
+ staticRender: (props) => /* @__PURE__ */ jsxs(EntityList, {
30
31
  ...props,
31
- accessor: 0
32
- }, /* @__PURE__ */ createElement(Field, {
33
- field: PRIMARY_KEY_NAME
34
- }), props.children),
32
+ accessor: 0,
33
+ children: [/* @__PURE__ */ jsx(Field, {
34
+ field: PRIMARY_KEY_NAME
35
+ }), props.children]
36
+ }),
35
37
  generateEnvironment: (props, oldEnvironment) => {
36
38
  const environment = oldEnvironment.withVariables(props.variables);
37
39
  return TreeNodeEnvironmentFactory.createEnvironmentForEntityListSubtree(environment, props);
38
40
  }
39
41
  }, "EntityListSubTree");
40
- export { EntityListSubTree };
42
+ export {
43
+ EntityListSubTree
44
+ };
41
45
  //# sourceMappingURL=EntityListSubTree.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityListSubTree.js","sources":["../../../src/coreComponents/EntityListSubTree.tsx"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { ComponentType, ReactElement, ReactNode, useCallback } from 'react'\nimport {\n\tuseAccessorUpdateSubscription,\n\tuseEntityListSubTreeParameters,\n\tuseGetEntityListSubTree,\n} from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '../treeParameters'\nimport { Component } from './Component'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface EntityListSubTreeAdditionalProps {\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\nexport type EntityListSubTreeProps<ListProps, EntityProps> = {\n\ttreeRootId?: TreeRootId\n\tchildren?: ReactNode\n} & EntityListSubTreeAdditionalProps &\n\t(SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList) &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\nexport const EntityListSubTree = Component(\n\t<ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntityListSubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntityListSubTree()\n\t\tconst parameters = useEntityListSubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ?\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne\n\t\t// ) :\n\t\t// \tprops.children\n\t\t// )\n\t\treturn <EntityList {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntityListSubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntityListSubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={0 as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntityListSubtree(environment, props)\n\t\t},\n\t},\n\t'EntityListSubTree',\n) as <ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => ReactElement\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;AAiCa,MAAA,oBAAoB,UAChC,CAAyB,UAA0D;AACxD,4BAAA,MAAM,YAAY,6CAA6C;AAEzF,QAAM,aAAa;AACb,QAAA,aAAa,+BAA+B,KAAK;AACvD,QAAM,cAAc,YACnB,MAAM,WAAW,YAAY,MAAM,UAAU,GAC7C,CAAC,YAAY,YAAY,MAAM,UAAU,CAC1C;AACM,QAAA,WAAW,8BAA8B,WAAW;AAQ1D,SAAQA,8BAAA,YAAA;AAAA,OAAe;AAAA,IAAO;AAAA,EAAA,CAAoB;AACnD,GACA;AAAA,EACC,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACjD,QAAA,gBAAgB,SAAS,MAAM,YAAY;AAC9C,aAAO,cAAc,2CAA2C,OAAO,QAAQ,WAAW;AAAA,IAC3F;AACA,WAAO,cAAc,8BAA8B,OAAO,QAAQ,WAAW;AAAA,EAC9E;AAAA,EACA,cAAc,WACZA,8BAAA,YAAA;AAAA,OAAe;AAAA,IAAO,UAAU;AAAA,EAAA,GAC/BA,8BAAA,OAAA;AAAA,IAAM,OAAO;AAAA,EAAA,CAAkB,GAC/B,MAAM,QACR;AAAA,EAED,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,UAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,WAAA,2BAA2B,sCAAsC,aAAa,KAAK;AAAA,EAC3F;AACD,GACA,mBACD;;"}
1
+ {"version":3,"file":"EntityListSubTree.js","sources":["../../../src/coreComponents/EntityListSubTree.tsx"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { ComponentType, ReactElement, ReactNode, useCallback } from 'react'\nimport {\n\tuseAccessorUpdateSubscription,\n\tuseEntityListSubTreeParameters,\n\tuseGetEntityListSubTree,\n} from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '../treeParameters'\nimport { Component } from './Component'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface EntityListSubTreeAdditionalProps {\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\nexport type EntityListSubTreeProps<ListProps, EntityProps> = {\n\ttreeRootId?: TreeRootId\n\tchildren?: ReactNode\n} & EntityListSubTreeAdditionalProps &\n\t(SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList) &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\nexport const EntityListSubTree = Component(\n\t<ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntityListSubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntityListSubTree()\n\t\tconst parameters = useEntityListSubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ?\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne\n\t\t// ) :\n\t\t// \tprops.children\n\t\t// )\n\t\treturn <EntityList {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntityListSubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntityListSubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={0 as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntityListSubtree(environment, props)\n\t\t},\n\t},\n\t'EntityListSubTree',\n) as <ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => ReactElement\n"],"names":["EntityListSubTree","Component","props","isCreating","getSubTree","useGetEntityListSubTree","parameters","useEntityListSubTreeParameters","getAccessor","useCallback","treeRootId","accessor","useAccessorUpdateSubscription","generateBranchMarker","fields","environment","MarkerFactory","createUnconstrainedEntityListSubTreeMarker","createEntityListSubTreeMarker","staticRender","_jsxs","_jsx","PRIMARY_KEY_NAME","children","generateEnvironment","oldEnvironment","withVariables","variables","TreeNodeEnvironmentFactory","createEnvironmentForEntityListSubtree"],"mappings":";;;;;;;;;;;;AAiCaA,MAAAA,oBAAoBC,UAChC,CAAyBC,UAA0D;AACxDA,4BAAAA,MAAMC,YAAY,6CAAnB;AAEzB,QAAMC,aAAaC;AACbC,QAAAA,aAAaC,+BAA+BL,KAAD;AACjD,QAAMM,cAAcC,YACnB,MAAML,WAAWE,YAAYJ,MAAMQ,UAAnB,GAChB,CAACN,YAAYE,YAAYJ,MAAMQ,UAA/B,CAF8B;AAIzBC,QAAAA,WAAWC,8BAA8BJ,WAAD;AAQ9C,6BAAQ,YAAD;AAAA,IAAA,GAAgBN;AAAAA,IAAO;AAAA,EAAA,CAA9B;AACA,GACD;AAAA,EACCW,sBAAsB,CAACX,OAAOY,QAAQC,gBAAgB;AACjD,QAAA,gBAAgBb,SAASA,MAAMC,YAAY;AAC9C,aAAOa,cAAcC,2CAA2Cf,OAAOY,QAAQC,WAAxE;AAAA,IACP;AACD,WAAOC,cAAcE,8BAA8BhB,OAAOY,QAAQC,WAA3D;AAAA,EACP;AAAA,EACDI,cAAcjB,CACb,UAAAkB,qBAAC;OAAelB;AAAAA,IAAO,UAAU;AAAA,IAAjC,UAAA,CACCmB,oBAAC,OAAD;AAAA,MAAO,OAAOC;AAAAA,IAAAA,CADf,GAEEpB,MAAMqB,QAFR;AAAA,EAAA,CARF;AAAA,EAaCC,qBAAqB,CAACtB,OAAOuB,mBAAmB;AAC/C,UAAMV,cAAcU,eAAeC,cAAcxB,MAAMyB,SAAnC;AACbC,WAAAA,2BAA2BC,sCAAsCd,aAAab,KAA9E;AAAA,EACP;AAhBF,GAkBA,mBAtCyC;"}
@@ -1,10 +1,11 @@
1
- import { createElement, Fragment, useCallback } from "react";
2
1
  import { useConstantValueInvariant } from "@contember/react-utils";
2
+ import { useCallback } from "react";
3
3
  import { PRIMARY_KEY_NAME } from "../bindingTypes.js";
4
4
  import { Component } from "./Component.js";
5
5
  import { Entity } from "./Entity.js";
6
6
  import { Field } from "./Field.js";
7
7
  import { TreeNodeEnvironmentFactory } from "../dao/TreeNodeEnvironmentFactory.js";
8
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
8
9
  import { SetOrderFieldOnCreate } from "../accessorSorting/SetOrderFieldOnCreate.js";
9
10
  import { useGetEntitySubTree } from "../accessorPropagation/useGetEntitySubTree.js";
10
11
  import { useEntitySubTreeParameters } from "../accessorPropagation/useEntitySubTreeParameters.js";
@@ -16,7 +17,7 @@ const EntitySubTree = Component((props) => {
16
17
  const parameters = useEntitySubTreeParameters(props);
17
18
  const getAccessor = useCallback(() => getSubTree(parameters, props.treeRootId), [getSubTree, parameters, props.treeRootId]);
18
19
  const accessor = useAccessorUpdateSubscription(getAccessor);
19
- return /* @__PURE__ */ createElement(Entity, {
20
+ return /* @__PURE__ */ jsx(Entity, {
20
21
  ...props,
21
22
  accessor
22
23
  });
@@ -27,20 +28,25 @@ const EntitySubTree = Component((props) => {
27
28
  }
28
29
  return MarkerFactory.createEntitySubTreeMarker(props, fields, environment);
29
30
  },
30
- staticRender: (props) => /* @__PURE__ */ createElement(Fragment, null, /* @__PURE__ */ createElement(Entity, {
31
- ...props,
32
- accessor: 0
33
- }, /* @__PURE__ */ createElement(Field, {
34
- field: PRIMARY_KEY_NAME
35
- }), props.children), props.isCreating && "orderField" in props && /* @__PURE__ */ createElement(SetOrderFieldOnCreate, {
36
- orderField: props.orderField,
37
- newOrderFieldValue: props.newOrderFieldValue,
38
- entity: props.entity
39
- })),
31
+ staticRender: (props) => /* @__PURE__ */ jsxs(Fragment, {
32
+ children: [/* @__PURE__ */ jsxs(Entity, {
33
+ ...props,
34
+ accessor: 0,
35
+ children: [/* @__PURE__ */ jsx(Field, {
36
+ field: PRIMARY_KEY_NAME
37
+ }), props.children]
38
+ }), props.isCreating && "orderField" in props && /* @__PURE__ */ jsx(SetOrderFieldOnCreate, {
39
+ orderField: props.orderField,
40
+ newOrderFieldValue: props.newOrderFieldValue,
41
+ entity: props.entity
42
+ })]
43
+ }),
40
44
  generateEnvironment: (props, oldEnvironment) => {
41
45
  const environment = oldEnvironment.withVariables(props.variables);
42
46
  return TreeNodeEnvironmentFactory.createEnvironmentForEntitySubtree(environment, props);
43
47
  }
44
48
  }, "EntitySubTree");
45
- export { EntitySubTree };
49
+ export {
50
+ EntitySubTree
51
+ };
46
52
  //# sourceMappingURL=EntitySubTree.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntitySubTree.js","sources":["../../../src/coreComponents/EntitySubTree.tsx"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback } from 'react'\nimport { useAccessorUpdateSubscription, useEntitySubTreeParameters, useGetEntitySubTree } from '../accessorPropagation'\nimport { SetOrderFieldOnCreate, SetOrderFieldOnCreateOwnProps } from '../accessorSorting'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type {\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface EntitySubTreeAdditionalProps {\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\nexport type EntitySubTreeAdditionalCreationProps = {} | SetOrderFieldOnCreateOwnProps\n\nexport type EntitySubTreeProps<EntityProps> =\n\t& {\n\t\ttreeRootId?: TreeRootId\n\t\tchildren?: ReactNode\n\t}\n\t& EntitySubTreeAdditionalProps\n\t& (\n\t\t| SugaredQualifiedSingleEntity\n\t\t| (SugaredUnconstrainedQualifiedSingleEntity & EntitySubTreeAdditionalCreationProps)\n\t)\n\nexport const EntitySubTree = Component(\n\t<EntityProps extends {}>(props: EntitySubTreeProps<EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntitySubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntitySubTree()\n\t\tconst parameters = useEntitySubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top-level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ? (\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne>\n\t\t// ) : (\n\t\t// \tprops.children\n\t\t// )}\n\t\treturn <Entity {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntitySubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntitySubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t<Entity {...props} accessor={0 as any}>\n\t\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t\t{props.children}\n\t\t\t\t</Entity>\n\t\t\t\t{props.isCreating && 'orderField' in props && (\n\t\t\t\t\t<SetOrderFieldOnCreate\n\t\t\t\t\t\torderField={props.orderField}\n\t\t\t\t\t\tnewOrderFieldValue={props.newOrderFieldValue}\n\t\t\t\t\t\tentity={props.entity}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntitySubtree(environment, props)\n\t\t},\n\t},\n\t'EntitySubTree',\n) as <EntityProps>(pros: EntitySubTreeProps<EntityProps>) => ReactElement\n"],"names":["_jsx","_jsxFragment"],"mappings":";;;;;;;;;;;;AAkCa,MAAA,gBAAgB,UAC5B,CAAyB,UAA2C;AACzC,4BAAA,MAAM,YAAY,yCAAyC;AAErF,QAAM,aAAa;AACb,QAAA,aAAa,2BAA2B,KAAK;AACnD,QAAM,cAAc,YACnB,MAAM,WAAW,YAAY,MAAM,UAAU,GAC7C,CAAC,YAAY,YAAY,MAAM,UAAU,CAC1C;AACM,QAAA,WAAW,8BAA8B,WAAW;AAQ1D,SAAQA,8BAAA,QAAA;AAAA,OAAW;AAAA,IAAO;AAAA,EAAA,CAAoB;AAC/C,GACA;AAAA,EACC,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACjD,QAAA,gBAAgB,SAAS,MAAM,YAAY;AAC9C,aAAO,cAAc,uCAAuC,OAAO,QAAQ,WAAW;AAAA,IACvF;AACA,WAAO,cAAc,0BAA0B,OAAO,QAAQ,WAAW;AAAA,EAC1E;AAAA,EACA,cAAc,CACb,UAAAA,8BAAAC,UAAA,MACED,8BAAA,QAAA;AAAA,OAAW;AAAA,IAAO,UAAU;AAAA,EAAA,GAC3BA,8BAAA,OAAA;AAAA,IAAM,OAAO;AAAA,EAAA,CAAkB,GAC/B,MAAM,QACR,GACC,MAAM,cAAc,gBAAgB,SACnCA,8BAAA,uBAAA;AAAA,IACA,YAAY,MAAM;AAAA,IAClB,oBAAoB,MAAM;AAAA,IAC1B,QAAQ,MAAM;AAAA,EAAA,CACf,CAEF;AAAA,EAED,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,UAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,WAAA,2BAA2B,kCAAkC,aAAa,KAAK;AAAA,EACvF;AACD,GACA,eACD;;"}
1
+ {"version":3,"file":"EntitySubTree.js","sources":["../../../src/coreComponents/EntitySubTree.tsx"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback } from 'react'\nimport { useAccessorUpdateSubscription, useEntitySubTreeParameters, useGetEntitySubTree } from '../accessorPropagation'\nimport { SetOrderFieldOnCreate, SetOrderFieldOnCreateOwnProps } from '../accessorSorting'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type {\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface EntitySubTreeAdditionalProps {\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\nexport type EntitySubTreeAdditionalCreationProps = {} | SetOrderFieldOnCreateOwnProps\n\nexport type EntitySubTreeProps<EntityProps> =\n\t& {\n\t\ttreeRootId?: TreeRootId\n\t\tchildren?: ReactNode\n\t}\n\t& EntitySubTreeAdditionalProps\n\t& (\n\t\t| SugaredQualifiedSingleEntity\n\t\t| (SugaredUnconstrainedQualifiedSingleEntity & EntitySubTreeAdditionalCreationProps)\n\t)\n\nexport const EntitySubTree = Component(\n\t<EntityProps extends {}>(props: EntitySubTreeProps<EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntitySubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntitySubTree()\n\t\tconst parameters = useEntitySubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top-level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ? (\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne>\n\t\t// ) : (\n\t\t// \tprops.children\n\t\t// )}\n\t\treturn <Entity {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntitySubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntitySubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t<Entity {...props} accessor={0 as any}>\n\t\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t\t{props.children}\n\t\t\t\t</Entity>\n\t\t\t\t{props.isCreating && 'orderField' in props && (\n\t\t\t\t\t<SetOrderFieldOnCreate\n\t\t\t\t\t\torderField={props.orderField}\n\t\t\t\t\t\tnewOrderFieldValue={props.newOrderFieldValue}\n\t\t\t\t\t\tentity={props.entity}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntitySubtree(environment, props)\n\t\t},\n\t},\n\t'EntitySubTree',\n) as <EntityProps>(pros: EntitySubTreeProps<EntityProps>) => ReactElement\n"],"names":["EntitySubTree","Component","props","isCreating","getSubTree","useGetEntitySubTree","parameters","useEntitySubTreeParameters","getAccessor","useCallback","treeRootId","accessor","useAccessorUpdateSubscription","generateBranchMarker","fields","environment","MarkerFactory","createUnconstrainedEntitySubTreeMarker","createEntitySubTreeMarker","staticRender","_jsxs","_Fragment","_jsx","PRIMARY_KEY_NAME","children","orderField","newOrderFieldValue","entity","generateEnvironment","oldEnvironment","withVariables","variables","TreeNodeEnvironmentFactory","createEnvironmentForEntitySubtree"],"mappings":";;;;;;;;;;;;;AAkCaA,MAAAA,gBAAgBC,UAC5B,CAAyBC,UAA2C;AACzCA,4BAAAA,MAAMC,YAAY,yCAAnB;AAEzB,QAAMC,aAAaC;AACbC,QAAAA,aAAaC,2BAA2BL,KAAD;AAC7C,QAAMM,cAAcC,YACnB,MAAML,WAAWE,YAAYJ,MAAMQ,UAAnB,GAChB,CAACN,YAAYE,YAAYJ,MAAMQ,UAA/B,CAF8B;AAIzBC,QAAAA,WAAWC,8BAA8BJ,WAAD;AAQ9C,6BAAQ,QAAD;AAAA,IAAA,GAAYN;AAAAA,IAAO;AAAA,EAAA,CAA1B;AACA,GACD;AAAA,EACCW,sBAAsB,CAACX,OAAOY,QAAQC,gBAAgB;AACjD,QAAA,gBAAgBb,SAASA,MAAMC,YAAY;AAC9C,aAAOa,cAAcC,uCAAuCf,OAAOY,QAAQC,WAApE;AAAA,IACP;AACD,WAAOC,cAAcE,0BAA0BhB,OAAOY,QAAQC,WAAvD;AAAA,EACP;AAAA,EACDI,cAAcjB,CACb,UAAAkB,qBAAAC,UAAA;AAAA,IAAA,UACC,CAAAD,qBAAC,QAAD;AAAA,MAAA,GAAYlB;AAAAA,MAAO,UAAU;AAAA,MAA7B,UAAA,CACCoB,oBAAC,OAAD;AAAA,QAAO,OAAOC;AAAAA,MAAAA,CADf,GAEErB,MAAMsB,QAFR;AAAA,IAAA,CADD,GAKEtB,MAAMC,cAAc,gBAAgBD,6BACnC,uBAAD;AAAA,MACC,YAAYA,MAAMuB;AAAAA,MAClB,oBAAoBvB,MAAMwB;AAAAA,MAC1B,QAAQxB,MAAMyB;AAAAA,IAAAA,CATjB,CAAA;AAAA,EAAA,CARF;AAAA,EAsBCC,qBAAqB,CAAC1B,OAAO2B,mBAAmB;AAC/C,UAAMd,cAAcc,eAAeC,cAAc5B,MAAM6B,SAAnC;AACbC,WAAAA,2BAA2BC,kCAAkClB,aAAab,KAA1E;AAAA,EACP;AAzBF,GA2BA,eA/CqC;"}
@@ -1,23 +1,29 @@
1
- import { createElement, Fragment } from "react";
2
1
  import { GraphQlBuilder } from "@contember/client";
3
2
  import { Component } from "./Component.js";
4
3
  import { TreeNodeEnvironmentFactory } from "../dao/TreeNodeEnvironmentFactory.js";
4
+ import { jsx, Fragment } from "react/jsx-runtime";
5
5
  import { useField } from "../accessorPropagation/useField.js";
6
6
  import { MarkerFactory } from "../queryLanguage/MarkerFactory.js";
7
7
  const Field = Component((props) => {
8
8
  const field = useField(props);
9
9
  if (props.format !== void 0) {
10
- return /* @__PURE__ */ createElement(Fragment, null, props.format(field.value));
10
+ return /* @__PURE__ */ jsx(Fragment, {
11
+ children: props.format(field.value)
12
+ });
11
13
  }
12
14
  if (field.value instanceof GraphQlBuilder.GraphQlLiteral || field.value === null || typeof field.value === "boolean") {
13
15
  return null;
14
16
  }
15
- return /* @__PURE__ */ createElement(Fragment, null, field.value);
17
+ return /* @__PURE__ */ jsx(Fragment, {
18
+ children: field.value
19
+ });
16
20
  }, {
17
21
  generateLeafMarker: (props, environment) => MarkerFactory.createFieldMarker(props, environment),
18
22
  generateEnvironment: (props, environment) => {
19
23
  return TreeNodeEnvironmentFactory.createEnvironmentForField(environment, props);
20
24
  }
21
25
  }, "Field");
22
- export { Field };
26
+ export {
27
+ Field
28
+ };
23
29
  //# sourceMappingURL=Field.js.map