@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":"ListOperations.js","sources":["../../../../src/core/operations/ListOperations.ts"],"sourcesContent":["import { validate as uuidValidate } from 'uuid'\nimport type { BatchUpdatesOptions, EntityAccessor, EntityListAccessor, ErrorAccessor } from '../../accessors'\nimport { RuntimeId, UnpersistedEntityDummyId } from '../../accessorTree'\nimport { BindingError } from '../../BindingError'\nimport type { AccessorErrorManager } from '../AccessorErrorManager'\nimport { EventManager } from '../EventManager'\nimport { ErrorLocator, LocalizedBindingError } from '../exceptions'\nimport { MarkerComparator } from '../MarkerComparator'\nimport { RealmKeyGenerator } from '../RealmKeyGenerator'\nimport { EntityListState, getEntityMarker, StateIterator } from '../state'\nimport type { StateInitializer } from '../StateInitializer'\nimport type { TreeStore } from '../TreeStore'\nimport { OperationsHelpers } from './OperationsHelpers'\nimport { EntityId, EventListenersStore } from '../../treeParameters'\n\nexport class ListOperations {\n\tpublic constructor(\n\t\tprivate readonly accessorErrorManager: AccessorErrorManager,\n\t\tprivate readonly batchUpdatesOptions: BatchUpdatesOptions,\n\t\tprivate readonly eventManager: EventManager,\n\t\tprivate readonly stateInitializer: StateInitializer,\n\t\tprivate readonly treeStore: TreeStore,\n\t) {}\n\n\tpublic addError(listState: EntityListState, error: ErrorAccessor.Error): () => void {\n\t\treturn this.accessorErrorManager.addError(listState, error)\n\t}\n\n\tpublic addEventListener<Type extends keyof EntityListAccessor.RuntimeEntityListEventListenerMap>(\n\t\tstate: EntityListState,\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: EntityListAccessor.RuntimeEntityListEventListenerMap[Type],\n\t) {\n\t\tif (state.eventListeners === undefined) {\n\t\t\tstate.eventListeners = new EventListenersStore()\n\t\t}\n\t\treturn state.eventListeners.add(event, listener)\n\t}\n\n\tpublic addChildEventListener<Type extends keyof EntityAccessor.EntityEventListenerMap>(\n\t\tstate: EntityListState,\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: EntityAccessor.EntityEventListenerMap[Type],\n\t) {\n\t\tif (state.childEventListeners === undefined) {\n\t\t\tstate.childEventListeners = new EventListenersStore()\n\t\t}\n\t\treturn state.childEventListeners.add(event, listener)\n\t}\n\n\tpublic batchUpdates(state: EntityListState, performUpdates: EntityListAccessor.BatchUpdatesHandler) {\n\t\tthis.eventManager.syncOperation(() => {\n\t\t\tperformUpdates(state.getAccessor, this.batchUpdatesOptions)\n\t\t})\n\t}\n\n\tpublic connectEntity(outerState: EntityListState, entityToConnect: EntityAccessor) {\n\t\tthis.eventManager.syncOperation(() => {\n\t\t\tconst persistedEntityIds = this.treeStore.getEntityListPersistedIds(outerState)\n\t\t\tconst stateToConnect = OperationsHelpers.resolveAndPrepareEntityToConnect(this.treeStore, entityToConnect)\n\t\t\tconst idToConnect = stateToConnect.entity.id\n\n\t\t\t// TODO disable this at the top-level.\n\t\t\tfor (const state of StateIterator.eachSiblingRealmChild(this.treeStore, outerState)) {\n\t\t\t\tif (state.entityName !== stateToConnect.entity.entityName) {\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`EntityListAccessor.connectEntity: Attempting to connect at an entity of type ` +\n\t\t\t\t\t\t\t`'${stateToConnect.entity.entityName}' but '${state.entityName}' is expected.\\n\\n` +\n\t\t\t\t\t\t\t`Entity located at: ${ErrorLocator.locateInternalState(outerState)}.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tMarkerComparator.assertEntityMarkersSubsetOf(\n\t\t\t\t\t\tstate.blueprint.marker.fields,\n\t\t\t\t\t\tgetEntityMarker(stateToConnect).fields,\n\t\t\t\t\t)\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (error instanceof LocalizedBindingError) {\n\t\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t\t`Entity list: cannot connect entity with key '${entityToConnect.key}' because its fields are ` +\n\t\t\t\t\t\t\t\t`incompatible with entities found on this list. Make sure both trees are equivalent.\\n\\n` +\n\t\t\t\t\t\t\t\t`${error.message}\\n\\n` +\n\t\t\t\t\t\t\t\t(error.markerPath.length > 1\n\t\t\t\t\t\t\t\t\t? `Incompatibility found at: ${ErrorLocator.locateMarkerPath(error.markerPath)}.\\n\\n`\n\t\t\t\t\t\t\t\t\t: '') +\n\t\t\t\t\t\t\t\t`Entity list located at: ${ErrorLocator.locateInternalState(state)}.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t}\n\n\t\t\t\tif (state.children.has(idToConnect.value)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tthis.stateInitializer.initializeEntityRealm(idToConnect, state.entityName, {\n\t\t\t\t\ttype: 'listEntity',\n\t\t\t\t\tparent: state,\n\t\t\t\t}, stateToConnect)\n\n\t\t\t\tstate.plannedRemovals?.delete(idToConnect.value)\n\n\t\t\t\tlet changesDelta = 0\n\n\t\t\t\tif (persistedEntityIds.has(idToConnect.value)) {\n\t\t\t\t\t// It was removed from the list but now we're adding it back.\n\t\t\t\t\tchangesDelta--\n\t\t\t\t} else if (idToConnect.existsOnServer) {\n\t\t\t\t\t// ignoring unpersisted entities\n\t\t\t\t\tchangesDelta++\n\t\t\t\t}\n\t\t\t\tif (stateToConnect.type === 'entityRealm') {\n\t\t\t\t\tchangesDelta += stateToConnect.unpersistedChangesCount\n\t\t\t\t}\n\n\t\t\t\tthis.eventManager.registerJustUpdated(state, changesDelta)\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic disconnectEntity(listState: EntityListState, childEntity: EntityAccessor, options: {noPersist?: boolean}) {\n\t\tthis.eventManager.syncOperation(() => {\n\t\t\t// TODO disable this at the top-level.\n\t\t\tconst persistedEntityIds = this.treeStore.getEntityListPersistedIds(listState)\n\t\t\tfor (const state of StateIterator.eachSiblingRealmChild(this.treeStore, listState)) {\n\t\t\t\tconst disconnectedChildIdValue = childEntity.id\n\t\t\t\tconst disconnectedChildRealm = state.children.get(disconnectedChildIdValue)\n\n\t\t\t\tif (disconnectedChildRealm === undefined) {\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`Entity list doesn't include an entity with id '${disconnectedChildIdValue}' and so it cannot remove it.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\tthis.treeStore.disposeOfRealm(disconnectedChildRealm)\n\t\t\t\tlistState.children.delete(disconnectedChildIdValue)\n\n\t\t\t\tlet changesDelta = 0\n\n\t\t\t\tif (persistedEntityIds.has(disconnectedChildIdValue)) {\n\t\t\t\t\tchangesDelta++\n\n\t\t\t\t\tif (state.plannedRemovals === undefined) {\n\t\t\t\t\t\tstate.plannedRemovals = new Map()\n\t\t\t\t\t}\n\t\t\t\t\tif (!options.noPersist) {\n\t\t\t\t\t\tstate.plannedRemovals.set(disconnectedChildIdValue, 'disconnect')\n\t\t\t\t\t}\n\t\t\t\t} else if (disconnectedChildRealm.entity.id.existsOnServer) {\n\t\t\t\t\t// Disconnecting unpersisted entities doesn't constitute a change.\n\n\t\t\t\t\t// It wasn't on the list, then it was, and now we're removing it again.\n\t\t\t\t\tchangesDelta--\n\t\t\t\t}\n\n\t\t\t\tif (disconnectedChildRealm.type === 'entityRealm') {\n\t\t\t\t\t// Undoing whatever changes this child had caused.\n\t\t\t\t\tchangesDelta -= disconnectedChildRealm.unpersistedChangesCount\n\t\t\t\t}\n\n\t\t\t\tthis.eventManager.registerJustUpdated(state, changesDelta)\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic createNewEntity(outerState: EntityListState, initialize: EntityAccessor.BatchUpdatesHandler | undefined): RuntimeId {\n\t\treturn this.eventManager.syncOperation((): RuntimeId => {\n\t\t\t// All siblings need to have the same id.\n\t\t\tconst id = new UnpersistedEntityDummyId()\n\n\t\t\tfor (const state of StateIterator.eachSiblingRealmChild(this.treeStore, outerState)) {\n\t\t\t\tconst newEntity = this.stateInitializer.initializeEntityRealm(id, state.entityName, {\n\t\t\t\t\ttype: 'listEntity',\n\t\t\t\t\tparent: state,\n\t\t\t\t})\n\n\t\t\t\tthis.stateInitializer.runImmediateUserInitialization(newEntity, initialize)\n\n\t\t\t\t// The act of creating the entity doesn't constitute a change unless there's something inside to persist.\n\t\t\t\t// TODO forceCreate\n\t\t\t\t// TODO defaultValue\n\t\t\t\tthis.eventManager.registerJustUpdated(state, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t}\n\t\t\treturn id\n\t\t})\n\t}\n\n\tpublic getChildEntityById(state: EntityListState, id: EntityId) {\n\t\tconst realm = state.children.get(id)\n\t\tif (realm === undefined) {\n\t\t\tconst isRuntimeId = typeof id === 'number' || uuidValidate(id) || UnpersistedEntityDummyId.matchesDummyId(id)\n\t\t\tif (isRuntimeId) {\n\t\t\t\tthrow new BindingError(`EntityList: cannot retrieve an entity with id '${id}' as it is not on the list.`)\n\t\t\t}\n\t\t\tconst looksLikeKey = typeof id === 'string' && (this.treeStore.entityRealmStore.has(id) || RealmKeyGenerator.vaguelyAppearsToBeAKey(id))\n\t\t\tthrow new BindingError(\n\t\t\t\t`EntityList: cannot retrieve an entity with id '${id}' because it's not a valid id.` +\n\t\t\t\t\t(looksLikeKey\n\t\t\t\t\t\t? `\\nThe supplied value appears to be an entity *key*, not an *id*. List accessors are indexed by ids ` +\n\t\t\t\t\t\t `and you can use \\`EntityAccessor.id\\` to obtain one. Keys, on the other hand, are globally unique and ` +\n\t\t\t\t\t\t `you can use \\`getEntityByKey\\` to get its EntityAccessor.`\n\t\t\t\t\t\t: ''),\n\t\t\t)\n\t\t}\n\t\treturn realm.getAccessor()\n\t}\n}\n"],"names":["uuidValidate"],"mappings":";;;;;;;;;;;;AAeO,MAAM,eAAe;AAAA,EACpB,YACW,sBACA,qBACA,cACA,kBACA,WAChB;AALgB,SAAA,uBAAA;AACA,SAAA,sBAAA;AACA,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,YAAA;AAAA,EACf;AAAA,EAEI,SAAS,WAA4B,OAAwC;AACnF,WAAO,KAAK,qBAAqB,SAAS,WAAW,KAAK;AAAA,EAC3D;AAAA,EAEO,iBACN,OACA,OACA,UACC;AACG,QAAA,MAAM,mBAAmB,QAAW;AACjC,YAAA,iBAAiB,IAAI;IAC5B;AACA,WAAO,MAAM,eAAe,IAAI,OAAO,QAAQ;AAAA,EAChD;AAAA,EAEO,sBACN,OACA,OACA,UACC;AACG,QAAA,MAAM,wBAAwB,QAAW;AACtC,YAAA,sBAAsB,IAAI;IACjC;AACA,WAAO,MAAM,oBAAoB,IAAI,OAAO,QAAQ;AAAA,EACrD;AAAA,EAEO,aAAa,OAAwB,gBAAwD;AAC9F,SAAA,aAAa,cAAc,MAAM;AACtB,qBAAA,MAAM,aAAa,KAAK,mBAAmB;AAAA,IAAA,CAC1D;AAAA,EACF;AAAA,EAEO,cAAc,YAA6B,iBAAiC;AAC7E,SAAA,aAAa,cAAc,MAAM;AACrC,YAAM,qBAAqB,KAAK,UAAU,0BAA0B,UAAU;AAC9E,YAAM,iBAAiB,kBAAkB,iCAAiC,KAAK,WAAW,eAAe;AACnG,YAAA,cAAc,eAAe,OAAO;AAG1C,iBAAW,SAAS,cAAc,sBAAsB,KAAK,WAAW,UAAU,GAAG;AACpF,YAAI,MAAM,eAAe,eAAe,OAAO,YAAY;AAC1D,gBAAM,IAAI,aACT,iFACK,eAAe,OAAO,oBAAoB,MAAM;AAAA;AAAA,qBAC9B,aAAa,oBAAoB,UAAU,IACnE;AAAA,QACD;AAEI,YAAA;AACc,2BAAA,4BAChB,MAAM,UAAU,OAAO,QACvB,gBAAgB,cAAc,EAAE,MACjC;AAAA,iBACQ;AACR,cAAI,iBAAiB,uBAAuB;AACrC,kBAAA,IAAI,aACT,gDAAgD,gBAAgB;AAAA;AAAA,EAE5D,MAAM;AAAA;AAAA,IACR,OAAM,WAAW,SAAS,IACxB,6BAA6B,aAAa,iBAAiB,MAAM,UAAU;AAAA;AAAA,IAC3E,MACH,2BAA2B,aAAa,oBAAoB,KAAK,IACnE;AAAA,UACD;AACM,gBAAA;AAAA,QACP;AAEA,YAAI,MAAM,SAAS,IAAI,YAAY,KAAK,GAAG;AAC1C;AAAA,QACD;AAEA,aAAK,iBAAiB,sBAAsB,aAAa,MAAM,YAAY;AAAA,UAC1E,MAAM;AAAA,UACN,QAAQ;AAAA,WACN,cAAc;AAEX,cAAA,iBAAiB,OAAO,YAAY,KAAK;AAE/C,YAAI,eAAe;AAEnB,YAAI,mBAAmB,IAAI,YAAY,KAAK,GAAG;AAE9C;AAAA,QAAA,WACU,YAAY,gBAAgB;AAEtC;AAAA,QACD;AACI,YAAA,eAAe,SAAS,eAAe;AAC1C,0BAAgB,eAAe;AAAA,QAChC;AAEK,aAAA,aAAa,oBAAoB,OAAO,YAAY;AAAA,MAC1D;AAAA,IAAA,CACA;AAAA,EACF;AAAA,EAEO,iBAAiB,WAA4B,aAA6B,SAAgC;AAC3G,SAAA,aAAa,cAAc,MAAM;AAErC,YAAM,qBAAqB,KAAK,UAAU,0BAA0B,SAAS;AAC7E,iBAAW,SAAS,cAAc,sBAAsB,KAAK,WAAW,SAAS,GAAG;AACnF,cAAM,2BAA2B,YAAY;AAC7C,cAAM,yBAAyB,MAAM,SAAS,IAAI,wBAAwB;AAE1E,YAAI,2BAA2B,QAAW;AACnC,gBAAA,IAAI,aACT,kDAAkD,uDACnD;AAAA,QACD;AAEK,aAAA,UAAU,eAAe,sBAAsB;AAC1C,kBAAA,SAAS,OAAO,wBAAwB;AAElD,YAAI,eAAe;AAEf,YAAA,mBAAmB,IAAI,wBAAwB,GAAG;AACrD;AAEI,cAAA,MAAM,oBAAoB,QAAW;AAClC,kBAAA,sCAAsB;UAC7B;AACI,cAAA,CAAC,QAAQ,WAAW;AACjB,kBAAA,gBAAgB,IAAI,0BAA0B,YAAY;AAAA,UACjE;AAAA,QACU,WAAA,uBAAuB,OAAO,GAAG,gBAAgB;AAI3D;AAAA,QACD;AAEI,YAAA,uBAAuB,SAAS,eAAe;AAElD,0BAAgB,uBAAuB;AAAA,QACxC;AAEK,aAAA,aAAa,oBAAoB,OAAO,YAAY;AAAA,MAC1D;AAAA,IAAA,CACA;AAAA,EACF;AAAA,EAEO,gBAAgB,YAA6B,YAAuE;AACnH,WAAA,KAAK,aAAa,cAAc,MAAiB;AAEjD,YAAA,KAAK,IAAI;AAEf,iBAAW,SAAS,cAAc,sBAAsB,KAAK,WAAW,UAAU,GAAG;AACpF,cAAM,YAAY,KAAK,iBAAiB,sBAAsB,IAAI,MAAM,YAAY;AAAA,UACnF,MAAM;AAAA,UACN,QAAQ;AAAA,QAAA,CACR;AAEI,aAAA,iBAAiB,+BAA+B,WAAW,UAAU;AAK1E,aAAK,aAAa,oBAAoB,OAAO,aAAa,qBAAqB;AAAA,MAChF;AACO,aAAA;AAAA,IAAA,CACP;AAAA,EACF;AAAA,EAEO,mBAAmB,OAAwB,IAAc;AAC/D,UAAM,QAAQ,MAAM,SAAS,IAAI,EAAE;AACnC,QAAI,UAAU,QAAW;AAClB,YAAA,cAAc,OAAO,OAAO,YAAYA,SAAa,EAAE,KAAK,yBAAyB,eAAe,EAAE;AAC5G,UAAI,aAAa;AACV,cAAA,IAAI,aAAa,kDAAkD,+BAA+B;AAAA,MACzG;AACA,YAAM,eAAe,OAAO,OAAO,YAAkB,MAAA,UAAU,iBAAiB,IAAI,EAAE,KAAK,kBAAkB,uBAAuB,EAAE;AACtI,YAAM,IAAI,aACT,kDAAkD,qCAE9C,gBAAA;AAAA,oQAGA,GACL;AAAA,IACD;AACA,WAAO,MAAM;EACd;AACD;;"}
1
+ {"version":3,"file":"ListOperations.js","sources":["../../../../src/core/operations/ListOperations.ts"],"sourcesContent":["import { validate as uuidValidate } from 'uuid'\nimport type { BatchUpdatesOptions, EntityAccessor, EntityListAccessor, ErrorAccessor } from '../../accessors'\nimport { RuntimeId, UnpersistedEntityDummyId } from '../../accessorTree'\nimport { BindingError } from '../../BindingError'\nimport type { AccessorErrorManager } from '../AccessorErrorManager'\nimport { EventManager } from '../EventManager'\nimport { ErrorLocator, LocalizedBindingError } from '../exceptions'\nimport { MarkerComparator } from '../MarkerComparator'\nimport { RealmKeyGenerator } from '../RealmKeyGenerator'\nimport { EntityListState, getEntityMarker, StateIterator } from '../state'\nimport type { StateInitializer } from '../StateInitializer'\nimport type { TreeStore } from '../TreeStore'\nimport { OperationsHelpers } from './OperationsHelpers'\nimport { EntityId, EventListenersStore } from '../../treeParameters'\n\nexport class ListOperations {\n\tpublic constructor(\n\t\tprivate readonly accessorErrorManager: AccessorErrorManager,\n\t\tprivate readonly batchUpdatesOptions: BatchUpdatesOptions,\n\t\tprivate readonly eventManager: EventManager,\n\t\tprivate readonly stateInitializer: StateInitializer,\n\t\tprivate readonly treeStore: TreeStore,\n\t) {}\n\n\tpublic addError(listState: EntityListState, error: ErrorAccessor.Error): () => void {\n\t\treturn this.accessorErrorManager.addError(listState, error)\n\t}\n\n\tpublic addEventListener<Type extends keyof EntityListAccessor.RuntimeEntityListEventListenerMap>(\n\t\tstate: EntityListState,\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: EntityListAccessor.RuntimeEntityListEventListenerMap[Type],\n\t) {\n\t\tif (state.eventListeners === undefined) {\n\t\t\tstate.eventListeners = new EventListenersStore()\n\t\t}\n\t\treturn state.eventListeners.add(event, listener)\n\t}\n\n\tpublic addChildEventListener<Type extends keyof EntityAccessor.EntityEventListenerMap>(\n\t\tstate: EntityListState,\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: EntityAccessor.EntityEventListenerMap[Type],\n\t) {\n\t\tif (state.childEventListeners === undefined) {\n\t\t\tstate.childEventListeners = new EventListenersStore()\n\t\t}\n\t\treturn state.childEventListeners.add(event, listener)\n\t}\n\n\tpublic batchUpdates(state: EntityListState, performUpdates: EntityListAccessor.BatchUpdatesHandler) {\n\t\tthis.eventManager.syncOperation(() => {\n\t\t\tperformUpdates(state.getAccessor, this.batchUpdatesOptions)\n\t\t})\n\t}\n\n\tpublic connectEntity(outerState: EntityListState, entityToConnect: EntityAccessor) {\n\t\tthis.eventManager.syncOperation(() => {\n\t\t\tconst persistedEntityIds = this.treeStore.getEntityListPersistedIds(outerState)\n\t\t\tconst stateToConnect = OperationsHelpers.resolveAndPrepareEntityToConnect(this.treeStore, entityToConnect)\n\t\t\tconst idToConnect = stateToConnect.entity.id\n\n\t\t\t// TODO disable this at the top-level.\n\t\t\tfor (const state of StateIterator.eachSiblingRealmChild(this.treeStore, outerState)) {\n\t\t\t\tif (state.entityName !== stateToConnect.entity.entityName) {\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`EntityListAccessor.connectEntity: Attempting to connect at an entity of type ` +\n\t\t\t\t\t\t\t`'${stateToConnect.entity.entityName}' but '${state.entityName}' is expected.\\n\\n` +\n\t\t\t\t\t\t\t`Entity located at: ${ErrorLocator.locateInternalState(outerState)}.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tMarkerComparator.assertEntityMarkersSubsetOf(\n\t\t\t\t\t\tstate.blueprint.marker.fields,\n\t\t\t\t\t\tgetEntityMarker(stateToConnect).fields,\n\t\t\t\t\t)\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (error instanceof LocalizedBindingError) {\n\t\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t\t`Entity list: cannot connect entity with key '${entityToConnect.key}' because its fields are ` +\n\t\t\t\t\t\t\t\t`incompatible with entities found on this list. Make sure both trees are equivalent.\\n\\n` +\n\t\t\t\t\t\t\t\t`${error.message}\\n\\n` +\n\t\t\t\t\t\t\t\t(error.markerPath.length > 1\n\t\t\t\t\t\t\t\t\t? `Incompatibility found at: ${ErrorLocator.locateMarkerPath(error.markerPath)}.\\n\\n`\n\t\t\t\t\t\t\t\t\t: '') +\n\t\t\t\t\t\t\t\t`Entity list located at: ${ErrorLocator.locateInternalState(state)}.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t}\n\n\t\t\t\tif (state.children.has(idToConnect.value)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tthis.stateInitializer.initializeEntityRealm(idToConnect, state.entityName, {\n\t\t\t\t\ttype: 'listEntity',\n\t\t\t\t\tparent: state,\n\t\t\t\t}, stateToConnect)\n\n\t\t\t\tstate.plannedRemovals?.delete(idToConnect.value)\n\n\t\t\t\tlet changesDelta = 0\n\n\t\t\t\tif (persistedEntityIds.has(idToConnect.value)) {\n\t\t\t\t\t// It was removed from the list but now we're adding it back.\n\t\t\t\t\tchangesDelta--\n\t\t\t\t} else if (idToConnect.existsOnServer) {\n\t\t\t\t\t// ignoring unpersisted entities\n\t\t\t\t\tchangesDelta++\n\t\t\t\t}\n\t\t\t\tif (stateToConnect.type === 'entityRealm') {\n\t\t\t\t\tchangesDelta += stateToConnect.unpersistedChangesCount\n\t\t\t\t}\n\n\t\t\t\tthis.eventManager.registerJustUpdated(state, changesDelta)\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic disconnectEntity(listState: EntityListState, childEntity: EntityAccessor, options: {noPersist?: boolean}) {\n\t\tthis.eventManager.syncOperation(() => {\n\t\t\t// TODO disable this at the top-level.\n\t\t\tconst persistedEntityIds = this.treeStore.getEntityListPersistedIds(listState)\n\t\t\tfor (const state of StateIterator.eachSiblingRealmChild(this.treeStore, listState)) {\n\t\t\t\tconst disconnectedChildIdValue = childEntity.id\n\t\t\t\tconst disconnectedChildRealm = state.children.get(disconnectedChildIdValue)\n\n\t\t\t\tif (disconnectedChildRealm === undefined) {\n\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t`Entity list doesn't include an entity with id '${disconnectedChildIdValue}' and so it cannot remove it.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\tthis.treeStore.disposeOfRealm(disconnectedChildRealm)\n\t\t\t\tlistState.children.delete(disconnectedChildIdValue)\n\n\t\t\t\tlet changesDelta = 0\n\n\t\t\t\tif (persistedEntityIds.has(disconnectedChildIdValue)) {\n\t\t\t\t\tchangesDelta++\n\n\t\t\t\t\tif (state.plannedRemovals === undefined) {\n\t\t\t\t\t\tstate.plannedRemovals = new Map()\n\t\t\t\t\t}\n\t\t\t\t\tif (!options.noPersist) {\n\t\t\t\t\t\tstate.plannedRemovals.set(disconnectedChildIdValue, 'disconnect')\n\t\t\t\t\t}\n\t\t\t\t} else if (disconnectedChildRealm.entity.id.existsOnServer) {\n\t\t\t\t\t// Disconnecting unpersisted entities doesn't constitute a change.\n\n\t\t\t\t\t// It wasn't on the list, then it was, and now we're removing it again.\n\t\t\t\t\tchangesDelta--\n\t\t\t\t}\n\n\t\t\t\tif (disconnectedChildRealm.type === 'entityRealm') {\n\t\t\t\t\t// Undoing whatever changes this child had caused.\n\t\t\t\t\tchangesDelta -= disconnectedChildRealm.unpersistedChangesCount\n\t\t\t\t}\n\n\t\t\t\tthis.eventManager.registerJustUpdated(state, changesDelta)\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic createNewEntity(outerState: EntityListState, initialize: EntityAccessor.BatchUpdatesHandler | undefined): RuntimeId {\n\t\treturn this.eventManager.syncOperation((): RuntimeId => {\n\t\t\t// All siblings need to have the same id.\n\t\t\tconst id = new UnpersistedEntityDummyId()\n\n\t\t\tfor (const state of StateIterator.eachSiblingRealmChild(this.treeStore, outerState)) {\n\t\t\t\tconst newEntity = this.stateInitializer.initializeEntityRealm(id, state.entityName, {\n\t\t\t\t\ttype: 'listEntity',\n\t\t\t\t\tparent: state,\n\t\t\t\t})\n\n\t\t\t\tthis.stateInitializer.runImmediateUserInitialization(newEntity, initialize)\n\n\t\t\t\t// The act of creating the entity doesn't constitute a change unless there's something inside to persist.\n\t\t\t\t// TODO forceCreate\n\t\t\t\t// TODO defaultValue\n\t\t\t\tthis.eventManager.registerJustUpdated(state, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t}\n\t\t\treturn id\n\t\t})\n\t}\n\n\tpublic getChildEntityById(state: EntityListState, id: EntityId) {\n\t\tconst realm = state.children.get(id)\n\t\tif (realm === undefined) {\n\t\t\tconst isRuntimeId = typeof id === 'number' || uuidValidate(id) || UnpersistedEntityDummyId.matchesDummyId(id)\n\t\t\tif (isRuntimeId) {\n\t\t\t\tthrow new BindingError(`EntityList: cannot retrieve an entity with id '${id}' as it is not on the list.`)\n\t\t\t}\n\t\t\tconst looksLikeKey = typeof id === 'string' && (this.treeStore.entityRealmStore.has(id) || RealmKeyGenerator.vaguelyAppearsToBeAKey(id))\n\t\t\tthrow new BindingError(\n\t\t\t\t`EntityList: cannot retrieve an entity with id '${id}' because it's not a valid id.` +\n\t\t\t\t\t(looksLikeKey\n\t\t\t\t\t\t? `\\nThe supplied value appears to be an entity *key*, not an *id*. List accessors are indexed by ids ` +\n\t\t\t\t\t\t `and you can use \\`EntityAccessor.id\\` to obtain one. Keys, on the other hand, are globally unique and ` +\n\t\t\t\t\t\t `you can use \\`getEntityByKey\\` to get its EntityAccessor.`\n\t\t\t\t\t\t: ''),\n\t\t\t)\n\t\t}\n\t\treturn realm.getAccessor()\n\t}\n}\n"],"names":["uuidValidate"],"mappings":";;;;;;;;;;;;AAeO,MAAM,eAAe;AAAA,EACpB,YACW,sBACA,qBACA,cACA,kBACA,WAChB;AALgB,SAAA,uBAAA;AACA,SAAA,sBAAA;AACA,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,YAAA;AAAA,EACf;AAAA,EAEI,SAAS,WAA4B,OAAwC;AACnF,WAAO,KAAK,qBAAqB,SAAS,WAAW,KAAK;AAAA,EAC3D;AAAA,EAEO,iBACN,OACA,OACA,UACC;AACG,QAAA,MAAM,mBAAmB,QAAW;AACjC,YAAA,iBAAiB,IAAI;IAC5B;AACA,WAAO,MAAM,eAAe,IAAI,OAAO,QAAQ;AAAA,EAChD;AAAA,EAEO,sBACN,OACA,OACA,UACC;AACG,QAAA,MAAM,wBAAwB,QAAW;AACtC,YAAA,sBAAsB,IAAI;IACjC;AACA,WAAO,MAAM,oBAAoB,IAAI,OAAO,QAAQ;AAAA,EACrD;AAAA,EAEO,aAAa,OAAwB,gBAAwD;AAC9F,SAAA,aAAa,cAAc,MAAM;AACtB,qBAAA,MAAM,aAAa,KAAK,mBAAmB;AAAA,IAAA,CAC1D;AAAA,EACF;AAAA,EAEO,cAAc,YAA6B,iBAAiC;AAC7E,SAAA,aAAa,cAAc,MAAM;AACrC,YAAM,qBAAqB,KAAK,UAAU,0BAA0B,UAAU;AAC9E,YAAM,iBAAiB,kBAAkB,iCAAiC,KAAK,WAAW,eAAe;AACnG,YAAA,cAAc,eAAe,OAAO;AAG1C,iBAAW,SAAS,cAAc,sBAAsB,KAAK,WAAW,UAAU,GAAG;AACpF,YAAI,MAAM,eAAe,eAAe,OAAO,YAAY;AAC1D,gBAAM,IAAI;AAAA,YACT,iFACK,eAAe,OAAO,oBAAoB,MAAM;AAAA;AAAA,qBAC9B,aAAa,oBAAoB,UAAU;AAAA,UAAA;AAAA,QAEpE;AAEI,YAAA;AACc,2BAAA;AAAA,YAChB,MAAM,UAAU,OAAO;AAAA,YACvB,gBAAgB,cAAc,EAAE;AAAA,UAAA;AAAA,iBAEzB;AACR,cAAI,iBAAiB,uBAAuB;AAC3C,kBAAM,IAAI;AAAA,cACT,gDAAgD,gBAAgB;AAAA;AAAA,EAE5D,MAAM;AAAA;AAAA,KACR,MAAM,WAAW,SAAS,IACxB,6BAA6B,aAAa,iBAAiB,MAAM,UAAU;AAAA;AAAA,IAC3E,MACH,2BAA2B,aAAa,oBAAoB,KAAK;AAAA,YAAA;AAAA,UAEpE;AACM,gBAAA;AAAA,QACP;AAEA,YAAI,MAAM,SAAS,IAAI,YAAY,KAAK,GAAG;AAC1C;AAAA,QACD;AAEA,aAAK,iBAAiB,sBAAsB,aAAa,MAAM,YAAY;AAAA,UAC1E,MAAM;AAAA,UACN,QAAQ;AAAA,WACN,cAAc;AAEX,cAAA,iBAAiB,OAAO,YAAY,KAAK;AAE/C,YAAI,eAAe;AAEnB,YAAI,mBAAmB,IAAI,YAAY,KAAK,GAAG;AAE9C;AAAA,QAAA,WACU,YAAY,gBAAgB;AAEtC;AAAA,QACD;AACI,YAAA,eAAe,SAAS,eAAe;AAC1C,0BAAgB,eAAe;AAAA,QAChC;AAEK,aAAA,aAAa,oBAAoB,OAAO,YAAY;AAAA,MAC1D;AAAA,IAAA,CACA;AAAA,EACF;AAAA,EAEO,iBAAiB,WAA4B,aAA6B,SAAgC;AAC3G,SAAA,aAAa,cAAc,MAAM;AAErC,YAAM,qBAAqB,KAAK,UAAU,0BAA0B,SAAS;AAC7E,iBAAW,SAAS,cAAc,sBAAsB,KAAK,WAAW,SAAS,GAAG;AACnF,cAAM,2BAA2B,YAAY;AAC7C,cAAM,yBAAyB,MAAM,SAAS,IAAI,wBAAwB;AAE1E,YAAI,2BAA2B,QAAW;AACzC,gBAAM,IAAI;AAAA,YACT,kDAAkD;AAAA,UAAA;AAAA,QAEpD;AAEK,aAAA,UAAU,eAAe,sBAAsB;AAC1C,kBAAA,SAAS,OAAO,wBAAwB;AAElD,YAAI,eAAe;AAEf,YAAA,mBAAmB,IAAI,wBAAwB,GAAG;AACrD;AAEI,cAAA,MAAM,oBAAoB,QAAW;AAClC,kBAAA,sCAAsB;UAC7B;AACI,cAAA,CAAC,QAAQ,WAAW;AACjB,kBAAA,gBAAgB,IAAI,0BAA0B,YAAY;AAAA,UACjE;AAAA,QACU,WAAA,uBAAuB,OAAO,GAAG,gBAAgB;AAI3D;AAAA,QACD;AAEI,YAAA,uBAAuB,SAAS,eAAe;AAElD,0BAAgB,uBAAuB;AAAA,QACxC;AAEK,aAAA,aAAa,oBAAoB,OAAO,YAAY;AAAA,MAC1D;AAAA,IAAA,CACA;AAAA,EACF;AAAA,EAEO,gBAAgB,YAA6B,YAAuE;AACnH,WAAA,KAAK,aAAa,cAAc,MAAiB;AAEjD,YAAA,KAAK,IAAI;AAEf,iBAAW,SAAS,cAAc,sBAAsB,KAAK,WAAW,UAAU,GAAG;AACpF,cAAM,YAAY,KAAK,iBAAiB,sBAAsB,IAAI,MAAM,YAAY;AAAA,UACnF,MAAM;AAAA,UACN,QAAQ;AAAA,QAAA,CACR;AAEI,aAAA,iBAAiB,+BAA+B,WAAW,UAAU;AAK1E,aAAK,aAAa,oBAAoB,OAAO,aAAa,qBAAqB;AAAA,MAChF;AACO,aAAA;AAAA,IAAA,CACP;AAAA,EACF;AAAA,EAEO,mBAAmB,OAAwB,IAAc;AAC/D,UAAM,QAAQ,MAAM,SAAS,IAAI,EAAE;AACnC,QAAI,UAAU,QAAW;AAClB,YAAA,cAAc,OAAO,OAAO,YAAYA,SAAa,EAAE,KAAK,yBAAyB,eAAe,EAAE;AAC5G,UAAI,aAAa;AACV,cAAA,IAAI,aAAa,kDAAkD,+BAA+B;AAAA,MACzG;AACA,YAAM,eAAe,OAAO,OAAO,aAAa,KAAK,UAAU,iBAAiB,IAAI,EAAE,KAAK,kBAAkB,uBAAuB,EAAE;AACtI,YAAM,IAAI;AAAA,QACT,kDAAkD,sCAChD,eACE;AAAA,oQAGA;AAAA,MAAA;AAAA,IAEN;AACA,WAAO,MAAM;EACd;AACD;"}
@@ -4,7 +4,9 @@ import { EventManager } from "../EventManager.js";
4
4
  import { RealmKeyGenerator } from "../RealmKeyGenerator.js";
5
5
  class OperationsHelpers {
6
6
  static rejectInvalidAccessorTree() {
7
- throw new BindingError(`The accessor tree does not correspond to the MarkerTree. This should absolutely never happen.`);
7
+ throw new BindingError(
8
+ `The accessor tree does not correspond to the MarkerTree. This should absolutely never happen.`
9
+ );
8
10
  }
9
11
  static resolveAndPrepareEntityToConnect(treeStore, entityToConnect) {
10
12
  const entityToConnectKey = entityToConnect.key;
@@ -77,5 +79,7 @@ class OperationsHelpers {
77
79
  }
78
80
  }
79
81
  }
80
- export { OperationsHelpers };
82
+ export {
83
+ OperationsHelpers
84
+ };
81
85
  //# sourceMappingURL=OperationsHelpers.js.map
@@ -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,6 +1,8 @@
1
1
  import { memo, createElement } from "react";
2
+ import { jsxDEV } from "react/jsx-dev-runtime";
2
3
  import { useDataBinding } from "../accessorTree/useDataBinding.js";
3
4
  import { AccessorTree } from "../accessorTree/AccessorTree.js";
5
+ var _jsxFileName = "/__w/admin/admin/packages/binding/src/coreComponents/DataBindingProvider.tsx";
4
6
  const DataBindingProvider = memo(function DataBindingProvider2(props) {
5
7
  const accessorTreeState = useDataBinding({
6
8
  nodeTree: props.children,
@@ -10,9 +12,16 @@ const DataBindingProvider = memo(function DataBindingProvider2(props) {
10
12
  ...props.stateProps,
11
13
  accessorTreeState
12
14
  }, props.children) : props.children;
13
- return /* @__PURE__ */ createElement(AccessorTree, {
14
- state: accessorTreeState
15
- }, children);
15
+ return /* @__PURE__ */ jsxDEV(AccessorTree, {
16
+ state: accessorTreeState,
17
+ children
18
+ }, void 0, false, {
19
+ fileName: _jsxFileName,
20
+ lineNumber: 42,
21
+ columnNumber: 9
22
+ }, this);
16
23
  });
17
- export { DataBindingProvider };
24
+ export {
25
+ DataBindingProvider
26
+ };
18
27
  //# 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,gCAAQ,cAAD;AAAA,IAAc,OAAOH;AAAAA,IAArB;AAAA,EAAA,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,KAAP,IAAA;AACA,CApBsC;"}
@@ -1,11 +1,21 @@
1
- import { createElement } from "react";
2
1
  import { Component } from "./Component.js";
2
+ import { jsxDEV } from "react/jsx-dev-runtime";
3
3
  import { AccessorProvider } from "../accessorPropagation/AccessorProvider.js";
4
- const Entity = Component(({ children, accessor }) => {
5
- return /* @__PURE__ */ createElement(AccessorProvider, {
4
+ var _jsxFileName = "/__w/admin/admin/packages/binding/src/coreComponents/Entity.tsx";
5
+ const Entity = Component(({
6
+ children,
7
+ accessor
8
+ }) => {
9
+ return /* @__PURE__ */ jsxDEV(AccessorProvider, {
6
10
  accessor,
7
- key: accessor?.key
8
- }, children);
11
+ children
12
+ }, accessor?.key, false, {
13
+ fileName: _jsxFileName,
14
+ lineNumber: 17,
15
+ columnNumber: 3
16
+ }, void 0);
9
17
  }, "Entity");
10
- export { Entity };
18
+ export {
19
+ Entity
20
+ };
11
21
  //# 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,gCAEE,kBAAD;AAAA,IAAkB;AAAA,IAAlB;AAAA,EAAA,GAA2CA,UAAUC,KAArD,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,MAAA;AAIA,GACD,QAT8B;"}
@@ -1,6 +1,8 @@
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 { jsxDEV, Fragment } from "react/jsx-dev-runtime";
5
+ var _jsxFileName = "/__w/admin/admin/packages/binding/src/coreComponents/EntityList.tsx";
4
6
  const EntityList = Component((props) => {
5
7
  if ("listComponent" in props && props.listComponent) {
6
8
  return createElement(props.listComponent, {
@@ -9,12 +11,18 @@ const EntityList = Component((props) => {
9
11
  children: props.children
10
12
  });
11
13
  }
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
- }));
14
+ return /* @__PURE__ */ jsxDEV(Fragment, {
15
+ children: Array.from(props.accessor, (entity) => {
16
+ return /* @__PURE__ */ jsxDEV(Entity, {
17
+ accessor: entity,
18
+ children: props.children
19
+ }, entity.key, false, {
20
+ fileName: _jsxFileName,
21
+ lineNumber: 33,
22
+ columnNumber: 7
23
+ }, void 0);
24
+ })
25
+ }, void 0, false);
18
26
  }, (props) => {
19
27
  if ("listComponent" in props && props.listComponent) {
20
28
  return createElement(props.listComponent, {
@@ -23,7 +31,11 @@ const EntityList = Component((props) => {
23
31
  children: props.children
24
32
  });
25
33
  }
26
- return /* @__PURE__ */ createElement(Fragment, null, props.children);
34
+ return /* @__PURE__ */ jsxDEV(Fragment, {
35
+ children: props.children
36
+ }, void 0, false);
27
37
  }, "EntityList");
28
- export { EntityList };
38
+ export {
39
+ EntityList
40
+ };
29
41
  //# 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,gCACCC,UAAA;AAAA,IAAA,UACEC,MAAMC,KAAKR,MAAMI,UAAUK,CAAU,WAAA;AACrC,oCACE,QAAD;AAAA,QAAyB,UAAUA;AAAAA,QAAnC,UACET,MAAMK;AAAAA,MAAAA,GADKI,OAAOC,KAApB,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GADD,MAAA;AAAA,IAAA,CADA;AAAA,EAAA,GAFH,QAAA,KAAA;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,gCAAOC,UAAA;AAAA,IAAA,UAAGN,MAAMK;AAAAA,EAAAA,GAAhB,QAAA,KAAA;AACA,GACD,YA/BkC;"}
@@ -1,24 +1,30 @@
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 { jsxDEV } from "react/jsx-dev-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";
11
12
  import { MarkerFactory } from "../queryLanguage/MarkerFactory.js";
13
+ var _jsxFileName = "/__w/admin/admin/packages/binding/src/coreComponents/EntityListSubTree.tsx";
12
14
  const EntityListSubTree = Component((props) => {
13
15
  useConstantValueInvariant(props.isCreating, "EntityListSubTree: cannot update isCreating");
14
16
  const getSubTree = useGetEntityListSubTree();
15
17
  const parameters = useEntityListSubTreeParameters(props);
16
18
  const getAccessor = useCallback(() => getSubTree(parameters, props.treeRootId), [getSubTree, parameters, props.treeRootId]);
17
19
  const accessor = useAccessorUpdateSubscription(getAccessor);
18
- return /* @__PURE__ */ createElement(EntityList, {
20
+ return /* @__PURE__ */ jsxDEV(EntityList, {
19
21
  ...props,
20
22
  accessor
21
- });
23
+ }, void 0, false, {
24
+ fileName: _jsxFileName,
25
+ lineNumber: 52,
26
+ columnNumber: 10
27
+ }, void 0);
22
28
  }, {
23
29
  generateBranchMarker: (props, fields, environment) => {
24
30
  if ("isCreating" in props && props.isCreating) {
@@ -26,16 +32,27 @@ const EntityListSubTree = Component((props) => {
26
32
  }
27
33
  return MarkerFactory.createEntityListSubTreeMarker(props, fields, environment);
28
34
  },
29
- staticRender: (props) => /* @__PURE__ */ createElement(EntityList, {
35
+ staticRender: (props) => /* @__PURE__ */ jsxDEV(EntityList, {
30
36
  ...props,
31
- accessor: 0
32
- }, /* @__PURE__ */ createElement(Field, {
33
- field: PRIMARY_KEY_NAME
34
- }), props.children),
37
+ accessor: 0,
38
+ children: [/* @__PURE__ */ jsxDEV(Field, {
39
+ field: PRIMARY_KEY_NAME
40
+ }, void 0, false, {
41
+ fileName: _jsxFileName,
42
+ lineNumber: 63,
43
+ columnNumber: 5
44
+ }, void 0), props.children]
45
+ }, void 0, true, {
46
+ fileName: _jsxFileName,
47
+ lineNumber: 62,
48
+ columnNumber: 4
49
+ }, void 0),
35
50
  generateEnvironment: (props, oldEnvironment) => {
36
51
  const environment = oldEnvironment.withVariables(props.variables);
37
52
  return TreeNodeEnvironmentFactory.createEnvironmentForEntityListSubtree(environment, props);
38
53
  }
39
54
  }, "EntityListSubTree");
40
- export { EntityListSubTree };
55
+ export {
56
+ EntityListSubTree
57
+ };
41
58
  //# 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","_jsxDEV","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,gCAAQ,YAAD;AAAA,IAAA,GAAgBN;AAAAA,IAAO;AAAA,EAAA,GAAvB,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAP,MAAA;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,uBAAC;OAAelB;AAAAA,IAAO,UAAU;AAAA,IAAjC,UAAA,CACCkB,uBAAC,OAAD;AAAA,MAAO,OAAOC;AAAAA,IAAAA,GAAd,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IADD,GAAA,MAAA,GAEEnB,MAAMoB,QAFR;AAAA,EAAA,GAAA,QAAA,MAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,KARF,MAAA;AAAA,EAaCC,qBAAqB,CAACrB,OAAOsB,mBAAmB;AAC/C,UAAMT,cAAcS,eAAeC,cAAcvB,MAAMwB,SAAnC;AACbC,WAAAA,2BAA2BC,sCAAsCb,aAAab,KAA9E;AAAA,EACP;AAhBF,GAkBA,mBAtCyC;"}