@contember/binding 1.1.0-rc.4 → 1.1.0

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 (349) hide show
  1. package/dist/development/accessorPropagation/AccessorProvider.js +7 -14
  2. package/dist/development/accessorPropagation/AccessorProvider.js.map +1 -1
  3. package/dist/development/accessorPropagation/BindingOperationsProvider.js +3 -7
  4. package/dist/development/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  5. package/dist/development/accessorPropagation/EntityKeyProvider.js +3 -7
  6. package/dist/development/accessorPropagation/EntityKeyProvider.js.map +1 -1
  7. package/dist/development/accessorPropagation/EnvironmentContext.js +39 -56
  8. package/dist/development/accessorPropagation/EnvironmentContext.js.map +1 -1
  9. package/dist/development/accessorPropagation/TreeRootIdProvider.js +3 -7
  10. package/dist/development/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  11. package/dist/development/accessorSorting/SetOrderFieldOnCreate.js +104 -89
  12. package/dist/development/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  13. package/dist/development/accessorSorting/errors.js.map +1 -1
  14. package/dist/development/accessorSorting/useSortedEntities.js +15 -18
  15. package/dist/development/accessorSorting/useSortedEntities.js.map +1 -1
  16. package/dist/development/accessorTree/AccessorTree.js +20 -39
  17. package/dist/development/accessorTree/AccessorTree.js.map +1 -1
  18. package/dist/development/accessorTree/RuntimeId.js +1 -1
  19. package/dist/development/accessorTree/RuntimeId.js.map +1 -1
  20. package/dist/development/accessorTree/accessorTreeStateReducer.js.map +1 -1
  21. package/dist/development/core/AccessorErrorManager.js +6 -6
  22. package/dist/development/core/AccessorErrorManager.js.map +1 -1
  23. package/dist/development/core/Config.js.map +1 -1
  24. package/dist/development/core/DataBinding.js +16 -16
  25. package/dist/development/core/DataBinding.js.map +1 -1
  26. package/dist/development/core/DirtinessTracker.js.map +1 -1
  27. package/dist/development/core/EventManager.js +11 -11
  28. package/dist/development/core/EventManager.js.map +1 -1
  29. package/dist/development/core/IncrementalMarkerBuilder.js +5 -5
  30. package/dist/development/core/IncrementalMarkerBuilder.js.map +1 -1
  31. package/dist/development/core/MarkerTreeGenerator.js +6 -6
  32. package/dist/development/core/MarkerTreeGenerator.js.map +1 -1
  33. package/dist/development/core/MutationGenerator.js +18 -12
  34. package/dist/development/core/MutationGenerator.js.map +1 -1
  35. package/dist/development/core/RealmKeyGenerator.js +2 -2
  36. package/dist/development/core/RealmKeyGenerator.js.map +1 -1
  37. package/dist/development/core/StateInitializer.js +8 -8
  38. package/dist/development/core/StateInitializer.js.map +1 -1
  39. package/dist/development/core/TreeAugmenter.js.map +1 -1
  40. package/dist/development/core/TreeStore.js +7 -7
  41. package/dist/development/core/TreeStore.js.map +1 -1
  42. package/dist/development/core/exceptions/ErrorLocator.js +3 -3
  43. package/dist/development/core/exceptions/ErrorLocator.js.map +1 -1
  44. package/dist/development/core/schema/SchemaLoader.js +2 -2
  45. package/dist/development/core/schema/SchemaLoader.js.map +1 -1
  46. package/dist/development/core/state/StateIterator.js.map +1 -1
  47. package/dist/development/coreComponents/Component.js.map +1 -1
  48. package/dist/development/coreComponents/DataBindingProvider.js +11 -11
  49. package/dist/development/coreComponents/DataBindingProvider.js.map +1 -1
  50. package/dist/development/coreComponents/Entity.js +11 -15
  51. package/dist/development/coreComponents/Entity.js.map +1 -1
  52. package/dist/development/coreComponents/EntityList.js +35 -31
  53. package/dist/development/coreComponents/EntityList.js.map +1 -1
  54. package/dist/development/coreComponents/EntityListSubTree.js +41 -41
  55. package/dist/development/coreComponents/EntityListSubTree.js.map +1 -1
  56. package/dist/development/coreComponents/EntitySubTree.js +63 -51
  57. package/dist/development/coreComponents/EntitySubTree.js.map +1 -1
  58. package/dist/development/coreComponents/Field.js +28 -20
  59. package/dist/development/coreComponents/Field.js.map +1 -1
  60. package/dist/development/coreComponents/HasMany.js +30 -33
  61. package/dist/development/coreComponents/HasMany.js.map +1 -1
  62. package/dist/development/coreComponents/HasOne.js +30 -33
  63. package/dist/development/coreComponents/HasOne.js.map +1 -1
  64. package/dist/development/coreComponents/ParentEntity.js +12 -6
  65. package/dist/development/coreComponents/ParentEntity.js.map +1 -1
  66. package/dist/development/fieldHelpers/helpers/FieldHelper.js +1 -1
  67. package/dist/development/fieldHelpers/helpers/FieldHelper.js.map +1 -1
  68. package/dist/development/helperComponents/DeferredSubTrees.js +83 -86
  69. package/dist/development/helperComponents/DeferredSubTrees.js.map +1 -1
  70. package/dist/development/helperComponents/EntityView.js +5 -3
  71. package/dist/development/helperComponents/EntityView.js.map +1 -1
  72. package/dist/development/helperComponents/FieldView.js +50 -36
  73. package/dist/development/helperComponents/FieldView.js.map +1 -1
  74. package/dist/development/helperComponents/If.js +70 -63
  75. package/dist/development/helperComponents/If.js.map +1 -1
  76. package/dist/development/helperComponents/StaticRender.js +9 -5
  77. package/dist/development/helperComponents/StaticRender.js.map +1 -1
  78. package/dist/development/helperComponents/SugaredField.js +6 -13
  79. package/dist/development/helperComponents/SugaredField.js.map +1 -1
  80. package/dist/development/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  81. package/dist/development/markers/EntityListSubTreeMarker.js +2 -2
  82. package/dist/development/markers/EntityListSubTreeMarker.js.map +1 -1
  83. package/dist/development/markers/EntitySubTreeMarker.js +2 -2
  84. package/dist/development/markers/EntitySubTreeMarker.js.map +1 -1
  85. package/dist/development/markers/FieldMarker.js +2 -2
  86. package/dist/development/markers/FieldMarker.js.map +1 -1
  87. package/dist/development/markers/HasManyRelationMarker.js +3 -3
  88. package/dist/development/markers/HasManyRelationMarker.js.map +1 -1
  89. package/dist/development/markers/HasOneRelationMarker.js +2 -2
  90. package/dist/development/markers/HasOneRelationMarker.js.map +1 -1
  91. package/dist/development/queryLanguage/CacheStore.js +1 -1
  92. package/dist/development/queryLanguage/CacheStore.js.map +1 -1
  93. package/dist/development/queryLanguage/Parser.js +7 -7
  94. package/dist/development/queryLanguage/Parser.js.map +1 -1
  95. package/dist/development/queryLanguage/QueryLanguage.js +6 -6
  96. package/dist/development/queryLanguage/QueryLanguage.js.map +1 -1
  97. package/dist/development/structures/BijectiveIndexedMap.js +1 -1
  98. package/dist/development/structures/BijectiveIndexedMap.js.map +1 -1
  99. package/dist/development/structures/LRUCache.js +1 -1
  100. package/dist/development/structures/LRUCache.js.map +1 -1
  101. package/dist/development/structures/WeakIdCache.js.map +1 -1
  102. package/dist/production/accessorPropagation/AccessorProvider.js +2 -8
  103. package/dist/production/accessorPropagation/AccessorProvider.js.map +1 -1
  104. package/dist/production/accessorPropagation/BindingOperationsProvider.js +2 -5
  105. package/dist/production/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  106. package/dist/production/accessorPropagation/EntityKeyProvider.js +2 -5
  107. package/dist/production/accessorPropagation/EntityKeyProvider.js.map +1 -1
  108. package/dist/production/accessorPropagation/EnvironmentContext.js +23 -43
  109. package/dist/production/accessorPropagation/EnvironmentContext.js.map +1 -1
  110. package/dist/production/accessorPropagation/TreeRootIdProvider.js +2 -5
  111. package/dist/production/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  112. package/dist/production/accessorSorting/SetOrderFieldOnCreate.js +62 -62
  113. package/dist/production/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  114. package/dist/production/accessorSorting/errors.js.map +1 -1
  115. package/dist/production/accessorSorting/useSortedEntities.js +15 -18
  116. package/dist/production/accessorSorting/useSortedEntities.js.map +1 -1
  117. package/dist/production/accessorTree/AccessorTree.js +3 -21
  118. package/dist/production/accessorTree/AccessorTree.js.map +1 -1
  119. package/dist/production/accessorTree/RuntimeId.js +1 -1
  120. package/dist/production/accessorTree/RuntimeId.js.map +1 -1
  121. package/dist/production/accessorTree/accessorTreeStateReducer.js.map +1 -1
  122. package/dist/production/core/AccessorErrorManager.js +6 -6
  123. package/dist/production/core/AccessorErrorManager.js.map +1 -1
  124. package/dist/production/core/Config.js.map +1 -1
  125. package/dist/production/core/DataBinding.js +16 -16
  126. package/dist/production/core/DataBinding.js.map +1 -1
  127. package/dist/production/core/DirtinessTracker.js.map +1 -1
  128. package/dist/production/core/EventManager.js +11 -11
  129. package/dist/production/core/EventManager.js.map +1 -1
  130. package/dist/production/core/IncrementalMarkerBuilder.js +5 -5
  131. package/dist/production/core/IncrementalMarkerBuilder.js.map +1 -1
  132. package/dist/production/core/MarkerTreeGenerator.js +6 -6
  133. package/dist/production/core/MarkerTreeGenerator.js.map +1 -1
  134. package/dist/production/core/MutationGenerator.js +18 -12
  135. package/dist/production/core/MutationGenerator.js.map +1 -1
  136. package/dist/production/core/RealmKeyGenerator.js +2 -2
  137. package/dist/production/core/RealmKeyGenerator.js.map +1 -1
  138. package/dist/production/core/StateInitializer.js +8 -8
  139. package/dist/production/core/StateInitializer.js.map +1 -1
  140. package/dist/production/core/TreeAugmenter.js.map +1 -1
  141. package/dist/production/core/TreeStore.js +7 -7
  142. package/dist/production/core/TreeStore.js.map +1 -1
  143. package/dist/production/core/exceptions/ErrorLocator.js +3 -3
  144. package/dist/production/core/exceptions/ErrorLocator.js.map +1 -1
  145. package/dist/production/core/schema/SchemaLoader.js +2 -2
  146. package/dist/production/core/schema/SchemaLoader.js.map +1 -1
  147. package/dist/production/core/state/StateIterator.js.map +1 -1
  148. package/dist/production/coreComponents/Component.js.map +1 -1
  149. package/dist/production/coreComponents/DataBindingProvider.js +10 -9
  150. package/dist/production/coreComponents/DataBindingProvider.js.map +1 -1
  151. package/dist/production/coreComponents/Entity.js +7 -10
  152. package/dist/production/coreComponents/Entity.js.map +1 -1
  153. package/dist/production/coreComponents/EntityList.js +25 -28
  154. package/dist/production/coreComponents/EntityList.js.map +1 -1
  155. package/dist/production/coreComponents/EntityListSubTree.js +29 -28
  156. package/dist/production/coreComponents/EntityListSubTree.js.map +1 -1
  157. package/dist/production/coreComponents/EntitySubTree.js +39 -34
  158. package/dist/production/coreComponents/EntitySubTree.js.map +1 -1
  159. package/dist/production/coreComponents/Field.js +20 -20
  160. package/dist/production/coreComponents/Field.js.map +1 -1
  161. package/dist/production/coreComponents/HasMany.js +18 -20
  162. package/dist/production/coreComponents/HasMany.js.map +1 -1
  163. package/dist/production/coreComponents/HasOne.js +18 -20
  164. package/dist/production/coreComponents/HasOne.js.map +1 -1
  165. package/dist/production/coreComponents/ParentEntity.js +8 -6
  166. package/dist/production/coreComponents/ParentEntity.js.map +1 -1
  167. package/dist/production/fieldHelpers/helpers/FieldHelper.js +1 -1
  168. package/dist/production/fieldHelpers/helpers/FieldHelper.js.map +1 -1
  169. package/dist/production/helperComponents/DeferredSubTrees.js +67 -77
  170. package/dist/production/helperComponents/DeferredSubTrees.js.map +1 -1
  171. package/dist/production/helperComponents/EntityView.js +1 -3
  172. package/dist/production/helperComponents/EntityView.js.map +1 -1
  173. package/dist/production/helperComponents/FieldView.js +38 -31
  174. package/dist/production/helperComponents/FieldView.js.map +1 -1
  175. package/dist/production/helperComponents/If.js +40 -52
  176. package/dist/production/helperComponents/If.js.map +1 -1
  177. package/dist/production/helperComponents/StaticRender.js +5 -5
  178. package/dist/production/helperComponents/StaticRender.js.map +1 -1
  179. package/dist/production/helperComponents/SugaredField.js +2 -8
  180. package/dist/production/helperComponents/SugaredField.js.map +1 -1
  181. package/dist/production/helperComponents/helpers/FilterEvaluator.js.map +1 -1
  182. package/dist/production/markers/EntityListSubTreeMarker.js +2 -2
  183. package/dist/production/markers/EntityListSubTreeMarker.js.map +1 -1
  184. package/dist/production/markers/EntitySubTreeMarker.js +2 -2
  185. package/dist/production/markers/EntitySubTreeMarker.js.map +1 -1
  186. package/dist/production/markers/FieldMarker.js +2 -2
  187. package/dist/production/markers/FieldMarker.js.map +1 -1
  188. package/dist/production/markers/HasManyRelationMarker.js +2 -2
  189. package/dist/production/markers/HasManyRelationMarker.js.map +1 -1
  190. package/dist/production/markers/HasOneRelationMarker.js +2 -2
  191. package/dist/production/markers/HasOneRelationMarker.js.map +1 -1
  192. package/dist/production/queryLanguage/CacheStore.js +1 -1
  193. package/dist/production/queryLanguage/CacheStore.js.map +1 -1
  194. package/dist/production/queryLanguage/Parser.js +7 -7
  195. package/dist/production/queryLanguage/Parser.js.map +1 -1
  196. package/dist/production/queryLanguage/QueryLanguage.js +6 -6
  197. package/dist/production/queryLanguage/QueryLanguage.js.map +1 -1
  198. package/dist/production/structures/BijectiveIndexedMap.js +1 -1
  199. package/dist/production/structures/BijectiveIndexedMap.js.map +1 -1
  200. package/dist/production/structures/LRUCache.js +1 -1
  201. package/dist/production/structures/LRUCache.js.map +1 -1
  202. package/dist/production/structures/WeakIdCache.js.map +1 -1
  203. package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts +1 -1
  204. package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts.map +1 -1
  205. package/dist/types/accessorSorting/SortedEntities.d.ts +1 -1
  206. package/dist/types/accessorSorting/SortedEntities.d.ts.map +1 -1
  207. package/dist/types/accessorSorting/errors.d.ts +0 -3
  208. package/dist/types/accessorSorting/errors.d.ts.map +1 -1
  209. package/dist/types/accessorSorting/useSortedEntities.d.ts.map +1 -1
  210. package/dist/types/accessorTree/AccessorTreeState.d.ts +1 -1
  211. package/dist/types/accessorTree/AccessorTreeState.d.ts.map +1 -1
  212. package/dist/types/accessorTree/AccessorTreeStateAction.d.ts +1 -1
  213. package/dist/types/accessorTree/AccessorTreeStateAction.d.ts.map +1 -1
  214. package/dist/types/accessorTree/MutationRequestResponse.d.ts +3 -3
  215. package/dist/types/accessorTree/MutationRequestResponse.d.ts.map +1 -1
  216. package/dist/types/accessorTree/NormalizedPersistedData.d.ts +5 -5
  217. package/dist/types/accessorTree/NormalizedPersistedData.d.ts.map +1 -1
  218. package/dist/types/accessorTree/PersistResult.d.ts +2 -2
  219. package/dist/types/accessorTree/PersistResult.d.ts.map +1 -1
  220. package/dist/types/accessorTree/QueryRequestResponse.d.ts +3 -3
  221. package/dist/types/accessorTree/QueryRequestResponse.d.ts.map +1 -1
  222. package/dist/types/accessorTree/RequestError.d.ts +1 -1
  223. package/dist/types/accessorTree/RequestError.d.ts.map +1 -1
  224. package/dist/types/accessorTree/RuntimeId.d.ts +2 -2
  225. package/dist/types/accessorTree/RuntimeId.d.ts.map +1 -1
  226. package/dist/types/accessors/ExtendTree.d.ts +1 -1
  227. package/dist/types/accessors/ExtendTree.d.ts.map +1 -1
  228. package/dist/types/accessors/GetEntityByKey.d.ts +1 -1
  229. package/dist/types/accessors/GetEntityByKey.d.ts.map +1 -1
  230. package/dist/types/accessors/GetEntityListSubTree.d.ts +1 -1
  231. package/dist/types/accessors/GetEntityListSubTree.d.ts.map +1 -1
  232. package/dist/types/accessors/GetEntitySubTree.d.ts +1 -1
  233. package/dist/types/accessors/GetEntitySubTree.d.ts.map +1 -1
  234. package/dist/types/accessors/Persist.d.ts +1 -1
  235. package/dist/types/accessors/Persist.d.ts.map +1 -1
  236. package/dist/types/accessors/PersistErrorOptions.d.ts +1 -1
  237. package/dist/types/accessors/PersistErrorOptions.d.ts.map +1 -1
  238. package/dist/types/core/MutationGenerator.d.ts +3 -2
  239. package/dist/types/core/MutationGenerator.d.ts.map +1 -1
  240. package/dist/types/core/QueryGenerator.d.ts +1 -1
  241. package/dist/types/core/QueryGenerator.d.ts.map +1 -1
  242. package/dist/types/core/exceptions/RawMarkerPath.d.ts +1 -1
  243. package/dist/types/core/exceptions/RawMarkerPath.d.ts.map +1 -1
  244. package/dist/types/core/schema/RawSchemaEntity.d.ts +1 -1
  245. package/dist/types/core/schema/RawSchemaEntity.d.ts.map +1 -1
  246. package/dist/types/core/schema/SchemaColumnType.d.ts +2 -2
  247. package/dist/types/core/schema/SchemaColumnType.d.ts.map +1 -1
  248. package/dist/types/core/schema/SchemaEntities.d.ts +1 -1
  249. package/dist/types/core/schema/SchemaEntities.d.ts.map +1 -1
  250. package/dist/types/core/schema/SchemaEnums.d.ts +3 -3
  251. package/dist/types/core/schema/SchemaEnums.d.ts.map +1 -1
  252. package/dist/types/core/schema/SchemaField.d.ts +1 -1
  253. package/dist/types/core/schema/SchemaField.d.ts.map +1 -1
  254. package/dist/types/core/schema/SchemaFields.d.ts +1 -1
  255. package/dist/types/core/schema/SchemaFields.d.ts.map +1 -1
  256. package/dist/types/core/schema/SchemaRelation.d.ts +1 -1
  257. package/dist/types/core/schema/SchemaRelation.d.ts.map +1 -1
  258. package/dist/types/core/state/EntityListState.d.ts +1 -1
  259. package/dist/types/core/state/EntityListState.d.ts.map +1 -1
  260. package/dist/types/core/state/EntityRealmState.d.ts +1 -1
  261. package/dist/types/core/state/EntityRealmState.d.ts.map +1 -1
  262. package/dist/types/core/state/StateNode.d.ts +3 -3
  263. package/dist/types/core/state/StateNode.d.ts.map +1 -1
  264. package/dist/types/coreComponents/DataBindingProvider.d.ts +2 -2
  265. package/dist/types/coreComponents/DataBindingProvider.d.ts.map +1 -1
  266. package/dist/types/coreComponents/Entity.d.ts +1 -1
  267. package/dist/types/coreComponents/Entity.d.ts.map +1 -1
  268. package/dist/types/coreComponents/EntityList.d.ts +1 -1
  269. package/dist/types/coreComponents/EntityList.d.ts.map +1 -1
  270. package/dist/types/coreComponents/EntityListSubTree.d.ts +1 -1
  271. package/dist/types/coreComponents/EntityListSubTree.d.ts.map +1 -1
  272. package/dist/types/coreComponents/EntitySubTree.d.ts +2 -2
  273. package/dist/types/coreComponents/EntitySubTree.d.ts.map +1 -1
  274. package/dist/types/coreComponents/HasMany.d.ts +1 -1
  275. package/dist/types/coreComponents/HasMany.d.ts.map +1 -1
  276. package/dist/types/coreComponents/HasOne.d.ts +1 -1
  277. package/dist/types/coreComponents/HasOne.d.ts.map +1 -1
  278. package/dist/types/coreComponents/MarkerProvider.d.ts +3 -3
  279. package/dist/types/coreComponents/MarkerProvider.d.ts.map +1 -1
  280. package/dist/types/helperComponents/FieldView.d.ts +5 -5
  281. package/dist/types/helperComponents/FieldView.d.ts.map +1 -1
  282. package/dist/types/helperComponents/If.d.ts +1 -1
  283. package/dist/types/helperComponents/If.d.ts.map +1 -1
  284. package/dist/types/markers/EntityFieldMarkers.d.ts +2 -2
  285. package/dist/types/markers/EntityFieldMarkers.d.ts.map +1 -1
  286. package/dist/types/markers/EntityFieldPlaceholders.d.ts +1 -1
  287. package/dist/types/markers/EntityFieldPlaceholders.d.ts.map +1 -1
  288. package/dist/types/markers/MeaningfulMarker.d.ts +1 -1
  289. package/dist/types/markers/MeaningfulMarker.d.ts.map +1 -1
  290. package/dist/types/markers/SubTreeMarkers.d.ts +1 -1
  291. package/dist/types/markers/SubTreeMarkers.d.ts.map +1 -1
  292. package/dist/types/queryLanguage/QueryLanguage.d.ts +2 -3
  293. package/dist/types/queryLanguage/QueryLanguage.d.ts.map +1 -1
  294. package/dist/types/treeParameters/EntityListEventListeners.d.ts +4 -4
  295. package/dist/types/treeParameters/EntityListEventListeners.d.ts.map +1 -1
  296. package/dist/types/treeParameters/EventListenersStore.d.ts +1 -1
  297. package/dist/types/treeParameters/EventListenersStore.d.ts.map +1 -1
  298. package/dist/types/treeParameters/FieldEventListeners.d.ts +3 -3
  299. package/dist/types/treeParameters/FieldEventListeners.d.ts.map +1 -1
  300. package/dist/types/treeParameters/SetOnCreate.d.ts +2 -2
  301. package/dist/types/treeParameters/SetOnCreate.d.ts.map +1 -1
  302. package/dist/types/treeParameters/SingleEntityEventListeners.d.ts +3 -3
  303. package/dist/types/treeParameters/SingleEntityEventListeners.d.ts.map +1 -1
  304. package/dist/types/treeParameters/primitives/Alias.d.ts +1 -1
  305. package/dist/types/treeParameters/primitives/Alias.d.ts.map +1 -1
  306. package/dist/types/treeParameters/primitives/EntityId.d.ts +1 -1
  307. package/dist/types/treeParameters/primitives/EntityId.d.ts.map +1 -1
  308. package/dist/types/treeParameters/primitives/EntityName.d.ts +1 -1
  309. package/dist/types/treeParameters/primitives/EntityName.d.ts.map +1 -1
  310. package/dist/types/treeParameters/primitives/EntityRealmKey.d.ts +1 -1
  311. package/dist/types/treeParameters/primitives/EntityRealmKey.d.ts.map +1 -1
  312. package/dist/types/treeParameters/primitives/ExpectedEntityCount.d.ts +1 -1
  313. package/dist/types/treeParameters/primitives/ExpectedEntityCount.d.ts.map +1 -1
  314. package/dist/types/treeParameters/primitives/ExpectedQualifiedEntityMutation.d.ts +1 -1
  315. package/dist/types/treeParameters/primitives/ExpectedQualifiedEntityMutation.d.ts.map +1 -1
  316. package/dist/types/treeParameters/primitives/ExpectedRelationMutation.d.ts +1 -1
  317. package/dist/types/treeParameters/primitives/ExpectedRelationMutation.d.ts.map +1 -1
  318. package/dist/types/treeParameters/primitives/FieldName.d.ts +1 -1
  319. package/dist/types/treeParameters/primitives/FieldName.d.ts.map +1 -1
  320. package/dist/types/treeParameters/primitives/FieldValue.d.ts +2 -2
  321. package/dist/types/treeParameters/primitives/FieldValue.d.ts.map +1 -1
  322. package/dist/types/treeParameters/primitives/Filter.d.ts +2 -2
  323. package/dist/types/treeParameters/primitives/Filter.d.ts.map +1 -1
  324. package/dist/types/treeParameters/primitives/Json.d.ts +1 -1
  325. package/dist/types/treeParameters/primitives/Json.d.ts.map +1 -1
  326. package/dist/types/treeParameters/primitives/Limit.d.ts +1 -1
  327. package/dist/types/treeParameters/primitives/Limit.d.ts.map +1 -1
  328. package/dist/types/treeParameters/primitives/Offset.d.ts +1 -1
  329. package/dist/types/treeParameters/primitives/Offset.d.ts.map +1 -1
  330. package/dist/types/treeParameters/primitives/OrderBy.d.ts +2 -2
  331. package/dist/types/treeParameters/primitives/OrderBy.d.ts.map +1 -1
  332. package/dist/types/treeParameters/primitives/PlaceholderName.d.ts +1 -1
  333. package/dist/types/treeParameters/primitives/PlaceholderName.d.ts.map +1 -1
  334. package/dist/types/treeParameters/primitives/RemovalType.d.ts +1 -1
  335. package/dist/types/treeParameters/primitives/RemovalType.d.ts.map +1 -1
  336. package/dist/types/treeParameters/primitives/Scalar.d.ts +1 -1
  337. package/dist/types/treeParameters/primitives/Scalar.d.ts.map +1 -1
  338. package/dist/types/treeParameters/primitives/TreeRootId.d.ts +1 -1
  339. package/dist/types/treeParameters/primitives/TreeRootId.d.ts.map +1 -1
  340. package/dist/types/treeParameters/primitives/UniqueWhere.d.ts +2 -2
  341. package/dist/types/treeParameters/primitives/UniqueWhere.d.ts.map +1 -1
  342. package/dist/types/tsconfig.tsbuildinfo +1 -1
  343. package/package.json +13 -13
  344. package/src/accessorSorting/SortedEntities.ts +1 -1
  345. package/src/accessorSorting/errors.ts +0 -7
  346. package/src/accessorSorting/useSortedEntities.ts +15 -18
  347. package/src/accessorTree/MutationRequestResponse.ts +1 -1
  348. package/src/core/MutationGenerator.ts +16 -5
  349. package/LICENSE +0 -186
@@ -1,12 +1,12 @@
1
+ import { MarkerSugarer } from "./MarkerSugarer.js";
2
+ import { TreeParameterSugarer } from "./TreeParameterSugarer.js";
3
+ import { assertNever } from "../../utils/assertNever.js";
1
4
  var __defProp = Object.defineProperty;
2
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
6
  var __publicField = (obj, key, value) => {
4
7
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
8
  return value;
6
9
  };
7
- import { MarkerSugarer } from "./MarkerSugarer.js";
8
- import { TreeParameterSugarer } from "./TreeParameterSugarer.js";
9
- import { assertNever } from "../../utils/assertNever.js";
10
10
  class ErrorLocator {
11
11
  static locateMarkerPath(path) {
12
12
  return path.map((marker) => MarkerSugarer.sugarMarker(marker)).join(this.GLUE);
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorLocator.js","sources":["../../../../src/core/exceptions/ErrorLocator.ts"],"sourcesContent":["import { assertNever } from '../../utils'\nimport type { StateNode } from '../state'\nimport { MarkerSugarer } from './MarkerSugarer'\nimport type { RawMarkerPath } from './RawMarkerPath'\nimport { TreeParameterSugarer } from './TreeParameterSugarer'\n\nexport class ErrorLocator {\n\tprivate static readonly GLUE = '.'\n\n\tpublic static locateMarkerPath(path: RawMarkerPath): string {\n\t\treturn path.map(marker => MarkerSugarer.sugarMarker(marker)).join(this.GLUE)\n\t}\n\n\tpublic static locateInternalState(state: StateNode): string {\n\t\tfunction stateToPath(state: StateNode | undefined): string[] {\n\t\t\tif (state === undefined) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tswitch (state.type) {\n\t\t\t\tcase 'field':\n\t\t\t\t\treturn [...stateToPath(state.parent), TreeParameterSugarer.sugarField(state.fieldMarker.fieldName)]\n\t\t\t\tcase 'entityRealm': {\n\t\t\t\t\tconst blueprint = state.blueprint\n\t\t\t\t\tif (blueprint.type === 'subTree') {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tTreeParameterSugarer.sugarRootEntity(\n\t\t\t\t\t\t\t\tstate.entity.entityName,\n\t\t\t\t\t\t\t\tblueprint.marker.parameters.isCreating ? undefined : blueprint.marker.parameters.where,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tif (blueprint.type === 'listEntity') {\n\t\t\t\t\t\treturn [...stateToPath(blueprint.parent)]\n\t\t\t\t\t}\n\t\t\t\t\tif (blueprint.type === 'hasOne') {\n\t\t\t\t\t\treturn [...stateToPath(blueprint.parent), MarkerSugarer.sugarHasOneRelationMarker(blueprint.marker)]\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(blueprint)\n\t\t\t\t}\n\t\t\t\tcase 'entityList': {\n\t\t\t\t\tconst blueprint = state.blueprint\n\n\t\t\t\t\tif (blueprint.parent === undefined) {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tTreeParameterSugarer.sugarRootEntityList(\n\t\t\t\t\t\t\t\tstate.entityName,\n\t\t\t\t\t\t\t\tblueprint.marker.parameters.isCreating ? undefined : blueprint.marker.parameters.filter,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tconst hasMany = blueprint.marker\n\t\t\t\t\treturn [...stateToPath(blueprint.parent), MarkerSugarer.sugarHasManyRelationMarker(hasMany)]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn stateToPath(state).join(this.GLUE)\n\t}\n}\n"],"names":["state"],"mappings":";;;;;;;;;AAMO,MAAM,aAAa;AAAA,EAGzB,OAAc,iBAAiB,MAA6B;AACpD,WAAA,KAAK,IAAI,CAAA,WAAU,cAAc,YAAY,MAAM,CAAC,EAAE,KAAK,KAAK,IAAI;AAAA,EAC5E;AAAA,EAEA,OAAc,oBAAoB,OAA0B;AAC3D,aAAS,YAAYA,QAAwC;AAC5D,UAAIA,WAAU,QAAW;AACxB,eAAO;MACR;AACA,cAAQA,OAAM;AAAA,aACR;AACG,iBAAA,CAAC,GAAG,YAAYA,OAAM,MAAM,GAAG,qBAAqB,WAAWA,OAAM,YAAY,SAAS,CAAC;AAAA,aAC9F,eAAe;AACnB,gBAAM,YAAYA,OAAM;AACpB,cAAA,UAAU,SAAS,WAAW;AAC1B,mBAAA;AAAA,cACN,qBAAqB;AAAA,gBACpBA,OAAM,OAAO;AAAA,gBACb,UAAU,OAAO,WAAW,aAAa,SAAY,UAAU,OAAO,WAAW;AAAA,cAClF;AAAA,YAAA;AAAA,UAEF;AACI,cAAA,UAAU,SAAS,cAAc;AACpC,mBAAO,CAAC,GAAG,YAAY,UAAU,MAAM,CAAC;AAAA,UACzC;AACI,cAAA,UAAU,SAAS,UAAU;AACzB,mBAAA,CAAC,GAAG,YAAY,UAAU,MAAM,GAAG,cAAc,0BAA0B,UAAU,MAAM,CAAC;AAAA,UACpG;AACA,iBAAO,YAAqB;AAAA,QAC7B;AAAA,aACK,cAAc;AAClB,gBAAM,YAAYA,OAAM;AAEpB,cAAA,UAAU,WAAW,QAAW;AAC5B,mBAAA;AAAA,cACN,qBAAqB;AAAA,gBACpBA,OAAM;AAAA,gBACN,UAAU,OAAO,WAAW,aAAa,SAAY,UAAU,OAAO,WAAW;AAAA,cAClF;AAAA,YAAA;AAAA,UAEF;AACA,gBAAM,UAAU,UAAU;AACnB,iBAAA,CAAC,GAAG,YAAY,UAAU,MAAM,GAAG,cAAc,2BAA2B,OAAO,CAAC;AAAA,QAC5F;AAAA;AAAA,IAEF;AACA,WAAO,YAAY,KAAK,EAAE,KAAK,KAAK,IAAI;AAAA,EACzC;AACD;AAlDC,cADY,cACY,QAAO;"}
1
+ {"version":3,"file":"ErrorLocator.js","sources":["../../../../src/core/exceptions/ErrorLocator.ts"],"sourcesContent":["import { assertNever } from '../../utils'\nimport type { StateNode } from '../state'\nimport { MarkerSugarer } from './MarkerSugarer'\nimport type { RawMarkerPath } from './RawMarkerPath'\nimport { TreeParameterSugarer } from './TreeParameterSugarer'\n\nexport class ErrorLocator {\n\tprivate static readonly GLUE = '.'\n\n\tpublic static locateMarkerPath(path: RawMarkerPath): string {\n\t\treturn path.map(marker => MarkerSugarer.sugarMarker(marker)).join(this.GLUE)\n\t}\n\n\tpublic static locateInternalState(state: StateNode): string {\n\t\tfunction stateToPath(state: StateNode | undefined): string[] {\n\t\t\tif (state === undefined) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tswitch (state.type) {\n\t\t\t\tcase 'field':\n\t\t\t\t\treturn [...stateToPath(state.parent), TreeParameterSugarer.sugarField(state.fieldMarker.fieldName)]\n\t\t\t\tcase 'entityRealm': {\n\t\t\t\t\tconst blueprint = state.blueprint\n\t\t\t\t\tif (blueprint.type === 'subTree') {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tTreeParameterSugarer.sugarRootEntity(\n\t\t\t\t\t\t\t\tstate.entity.entityName,\n\t\t\t\t\t\t\t\tblueprint.marker.parameters.isCreating ? undefined : blueprint.marker.parameters.where,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tif (blueprint.type === 'listEntity') {\n\t\t\t\t\t\treturn [...stateToPath(blueprint.parent)]\n\t\t\t\t\t}\n\t\t\t\t\tif (blueprint.type === 'hasOne') {\n\t\t\t\t\t\treturn [...stateToPath(blueprint.parent), MarkerSugarer.sugarHasOneRelationMarker(blueprint.marker)]\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(blueprint)\n\t\t\t\t}\n\t\t\t\tcase 'entityList': {\n\t\t\t\t\tconst blueprint = state.blueprint\n\n\t\t\t\t\tif (blueprint.parent === undefined) {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tTreeParameterSugarer.sugarRootEntityList(\n\t\t\t\t\t\t\t\tstate.entityName,\n\t\t\t\t\t\t\t\tblueprint.marker.parameters.isCreating ? undefined : blueprint.marker.parameters.filter,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tconst hasMany = blueprint.marker\n\t\t\t\t\treturn [...stateToPath(blueprint.parent), MarkerSugarer.sugarHasManyRelationMarker(hasMany)]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn stateToPath(state).join(this.GLUE)\n\t}\n}\n"],"names":["state"],"mappings":";;;;;;;;;AAMO,MAAM,aAAa;AAAA,EAGzB,OAAc,iBAAiB,MAA6B;AACpD,WAAA,KAAK,IAAI,CAAA,WAAU,cAAc,YAAY,MAAM,CAAC,EAAE,KAAK,KAAK,IAAI;AAAA,EAC5E;AAAA,EAEA,OAAc,oBAAoB,OAA0B;AAC3D,aAAS,YAAYA,QAAwC;AAC5D,UAAIA,WAAU,QAAW;AACxB,eAAO;MACR;AACA,cAAQA,OAAM,MAAM;AAAA,QACnB,KAAK;AACG,iBAAA,CAAC,GAAG,YAAYA,OAAM,MAAM,GAAG,qBAAqB,WAAWA,OAAM,YAAY,SAAS,CAAC;AAAA,QACnG,KAAK,eAAe;AACnB,gBAAM,YAAYA,OAAM;AACpB,cAAA,UAAU,SAAS,WAAW;AAC1B,mBAAA;AAAA,cACN,qBAAqB;AAAA,gBACpBA,OAAM,OAAO;AAAA,gBACb,UAAU,OAAO,WAAW,aAAa,SAAY,UAAU,OAAO,WAAW;AAAA,cAClF;AAAA,YAAA;AAAA,UAEF;AACI,cAAA,UAAU,SAAS,cAAc;AACpC,mBAAO,CAAC,GAAG,YAAY,UAAU,MAAM,CAAC;AAAA,UACzC;AACI,cAAA,UAAU,SAAS,UAAU;AACzB,mBAAA,CAAC,GAAG,YAAY,UAAU,MAAM,GAAG,cAAc,0BAA0B,UAAU,MAAM,CAAC;AAAA,UACpG;AACA,iBAAO,YAAqB;AAAA,QAC7B;AAAA,QACA,KAAK,cAAc;AAClB,gBAAM,YAAYA,OAAM;AAEpB,cAAA,UAAU,WAAW,QAAW;AAC5B,mBAAA;AAAA,cACN,qBAAqB;AAAA,gBACpBA,OAAM;AAAA,gBACN,UAAU,OAAO,WAAW,aAAa,SAAY,UAAU,OAAO,WAAW;AAAA,cAClF;AAAA,YAAA;AAAA,UAEF;AACA,gBAAM,UAAU,UAAU;AACnB,iBAAA,CAAC,GAAG,YAAY,UAAU,MAAM,GAAG,cAAc,2BAA2B,OAAO,CAAC;AAAA,QAC5F;AAAA,MACD;AAAA,IACD;AACA,WAAO,YAAY,KAAK,EAAE,KAAK,KAAK,IAAI;AAAA,EACzC;AACD;AAlDC,cADY,cACY,QAAO,GAAA;"}
@@ -1,11 +1,11 @@
1
+ import { Schema } from "./Schema.js";
2
+ import { SchemaPreprocessor } from "./SchemaPreprocessor.js";
1
3
  var __defProp = Object.defineProperty;
2
4
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
5
  var __publicField = (obj, key, value) => {
4
6
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
7
  return value;
6
8
  };
7
- import { Schema } from "./Schema.js";
8
- import { SchemaPreprocessor } from "./SchemaPreprocessor.js";
9
9
  class SchemaLoader {
10
10
  static async loadSchema(client, options) {
11
11
  const existing = this.schemaLoadCache.get(client.apiUrl);
@@ -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,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;"}
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,IAAI,CAAA;AAEhF,cAHY,cAGY,eACvB,+kBAAA;"}
@@ -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,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
+ {"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,MAAM;AAAA,MAClB,KAAK;AAAA,MACL,KAAK;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,kBAAQ,WAAW,MAAM;AAAA,YACxB,KAAK;AAAA,YACL,KAAK;AAAA,YACL,KAAK;AACG,qBAAA,KAAK,mBAAmB,UAAU;AACzC;AAAA,YACD,KAAK;AACJ;AAAA,YACD;AACC,qBAAO,YAAsB;AAAA,UAC/B;AAAA,QACD;AACA;AAAA,MACD,KAAK;AACJ;AAAA,MACD;AACC,eAAO,YAAgB;AAAA,IACzB;AACM,UAAA;AAAA,EACP;AAAA,EAEA,QAAe,iBACd,MACA,OAC+B;AAC/B,YAAQ,KAAK,MAAM;AAAA,MAClB,KAAK;AAAA,MACL,KAAK;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,MACD;AACC,eAAO,YAAgB;AAAA,IACzB;AACA,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 +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":["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,gBAAgB;AACtE,QAAMC,gBAAgB,OAAON,WAAW,cAAcA,OAAOO,SAAS,IAAIP,SAASG;AAEnF,MAAIF,YAAYO,UAAa,OAAOP,YAAY,UAAU;AACzDD,WAAOE,cAAcD;AACfQ,UAAAA,mBAAuEC,KAAYJ,aAAa;AACtGG,qBAAgBE,eAAeX;AAC/BS,qBAAgBP,cAAcD;AAEvBQ,WAAAA;AAAAA,EACR;AAEAT,SAAOE,cAAcA;AACfO,QAAAA,kBAA2FC,KAAYJ,aAAa;AAC1HG,kBAAgBP,cAAcA;AAE1B,MAAA,OAAOD,YAAY,YAAY;AAClCQ,oBAAgBE,eAAeV;AAExBQ,WAAAA;AAAAA,EACR;AACI,MAAA,OAAOR,YAAY,UAAU;AAChC,eAAWW,iBAAiBX,SAAS;AACpC,YAAMY,aAAaD;AACjBH,sBAAgBI,cACjBZ,QAAQY;AAAAA,IACV;AAEOJ,WAAAA;AAAAA,EACR;AACAK,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":["augmentedRender"],"mappings":";;;AA+BA,SAAS,UACR,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;AACfA,UAAAA,mBAAuE,KAAY,aAAa;AACtGA,qBAAgB,eAAe;AAC/BA,qBAAgB,cAAc;AAEvBA,WAAAA;AAAAA,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,17 +1,18 @@
1
- import { memo, createElement } from "react";
2
1
  import { jsx } from "react/jsx-runtime";
2
+ import { memo, createElement } from "react";
3
3
  import { useDataBinding } from "../accessorTree/useDataBinding.js";
4
4
  import { AccessorTree } from "../accessorTree/AccessorTree.js";
5
5
  const DataBindingProvider = memo(function DataBindingProvider2(props) {
6
6
  const accessorTreeState = useDataBinding(props);
7
- const children = "stateComponent" in props && props.stateComponent ? createElement(props.stateComponent, {
8
- ...props.stateProps,
9
- accessorTreeState
10
- }, props.children) : props.children;
11
- return /* @__PURE__ */ jsx(AccessorTree, {
12
- state: accessorTreeState,
13
- children
14
- });
7
+ const children = "stateComponent" in props && props.stateComponent ? createElement(
8
+ props.stateComponent,
9
+ {
10
+ ...props.stateProps,
11
+ accessorTreeState
12
+ },
13
+ props.children
14
+ ) : props.children;
15
+ return /* @__PURE__ */ jsx(AccessorTree, { state: accessorTreeState, children });
15
16
  });
16
17
  export {
17
18
  DataBindingProvider
@@ -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, AccessorTreeStateOptions, useDataBinding } from '../accessorTree'\n\nexport type DataBindingProviderBaseProps =\n\t& AccessorTreeStateOptions\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(props)\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","children","stateComponent","createElement","stateProps"],"mappings":";;;;AAoBO,MAAMA,sBAAsBC,KAAK,SAASD,qBAChDE,OACC;AACKC,QAAAA,oBAAoBC,eAAeF,KAAK;AAE9C,QAAMG,WACL,oBAAoBH,SAASA,MAAMI,iBAChCC,cACAL,MAAMI,gBACN;AAAA,IACC,GAAGJ,MAAMM;AAAAA,IACTL;AAAAA,EAEDD,GAAAA,MAAMG,QAAQ,IAEdH,MAAMG;AACV,6BAAQ,cAAY;AAAA,IAAC,OAAOF;AAAAA,IAAkB;AAAA,EAAA,CAA0B;AACzE,CAAC;"}
1
+ {"version":3,"file":"DataBindingProvider.js","sources":["../../../src/coreComponents/DataBindingProvider.tsx"],"sourcesContent":["import { ComponentType, createElement, memo, ReactElement, ReactNode } from 'react'\nimport { AccessorTree, AccessorTreeState, AccessorTreeStateOptions, useDataBinding } from '../accessorTree'\n\nexport type DataBindingProviderBaseProps =\n\t& AccessorTreeStateOptions\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(props)\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"],"mappings":";;;;AAoBO,MAAM,sBAAsB,KAAK,SAASA,qBAChD,OACC;AACK,QAAA,oBAAoB,eAAe,KAAK;AAE9C,QAAM,WACL,oBAAoB,SAAS,MAAM,iBAChC;AAAA,IACA,MAAM;AAAA,IACN;AAAA,MACC,GAAG,MAAM;AAAA,MACT;AAAA,IACD;AAAA,IACA,MAAM;AAAA,EAAA,IAEN,MAAM;AACV,SAAQ,oBAAA,cAAA,EAAa,OAAO,mBAAoB,SAAS,CAAA;AAC1D,CAAC;"}
@@ -1,15 +1,12 @@
1
- import { Component } from "./Component.js";
2
1
  import { jsx } from "react/jsx-runtime";
2
+ import { Component } from "./Component.js";
3
3
  import { AccessorProvider } from "../accessorPropagation/AccessorProvider.js";
4
- const Entity = Component(({
5
- children,
6
- accessor
7
- }) => {
8
- return /* @__PURE__ */ jsx(AccessorProvider, {
9
- accessor,
10
- children
11
- }, accessor?.key);
12
- }, "Entity");
4
+ const Entity = Component(
5
+ ({ children, accessor }) => {
6
+ return /* @__PURE__ */ jsx(AccessorProvider, { accessor, children }, accessor?.key);
7
+ },
8
+ "Entity"
9
+ );
13
10
  export {
14
11
  Entity
15
12
  };
@@ -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":["Entity","Component","children","accessor","key"],"mappings":";;;AAYaA,MAAAA,SAASC,UACrB,CAAC;AAAA,EAAEC;AAAAA,EAAUC;AAAsB,MAAM;AACzC,6BAEE,kBAAgB;AAAA,IAAC;AAAA,IAAmB;AAAA,EAAA,GAAMA,UAAUC,GAAG;AAIzD,GACA,QAAQ;"}
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":[],"mappings":";;;AAYO,MAAM,SAAS;AAAA,EACrB,CAAC,EAAE,UAAU,eAA4B;AACzC,WAEE,oBAAA,kBAAA,EAAiB,UAChB,YADyC,UAAU,GAErD;AAAA,EAED;AAAA,EACA;AACD;"}
@@ -1,35 +1,32 @@
1
+ import { jsx, Fragment } from "react/jsx-runtime";
1
2
  import { createElement } from "react";
2
3
  import { Component } from "./Component.js";
3
4
  import { Entity } from "./Entity.js";
4
- import { jsx, Fragment } from "react/jsx-runtime";
5
- const EntityList = Component((props) => {
6
- if ("listComponent" in props && props.listComponent) {
7
- return createElement(props.listComponent, {
8
- ...props.listProps,
9
- accessor: props.accessor,
10
- children: props.children
11
- });
12
- }
13
- return /* @__PURE__ */ jsx(Fragment, {
14
- children: Array.from(props.accessor, (entity) => {
15
- return /* @__PURE__ */ jsx(Entity, {
16
- accessor: entity,
5
+ const EntityList = Component(
6
+ (props) => {
7
+ if ("listComponent" in props && props.listComponent) {
8
+ return createElement(props.listComponent, {
9
+ ...props.listProps,
10
+ accessor: props.accessor,
11
+ children: props.children
12
+ });
13
+ }
14
+ return /* @__PURE__ */ jsx(Fragment, { children: Array.from(props.accessor, (entity) => {
15
+ return /* @__PURE__ */ jsx(Entity, { accessor: entity, children: props.children }, entity.key);
16
+ }) });
17
+ },
18
+ (props) => {
19
+ if ("listComponent" in props && props.listComponent) {
20
+ return createElement(props.listComponent, {
21
+ ...props.listProps,
22
+ accessor: void 0,
17
23
  children: props.children
18
- }, entity.key);
19
- })
20
- });
21
- }, (props) => {
22
- if ("listComponent" in props && props.listComponent) {
23
- return createElement(props.listComponent, {
24
- ...props.listProps,
25
- accessor: void 0,
26
- children: props.children
27
- });
28
- }
29
- return /* @__PURE__ */ jsx(Fragment, {
30
- children: props.children
31
- });
32
- }, "EntityList");
24
+ });
25
+ }
26
+ return /* @__PURE__ */ jsx(Fragment, { children: props.children });
27
+ },
28
+ "EntityList"
29
+ );
33
30
  export {
34
31
  EntityList
35
32
  };
@@ -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":["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,CAChB;AAAA,EACF;AACA,6BACCC,UAAA;AAAA,IAAA,UACEC,MAAMC,KAAKR,MAAMI,UAAUK,CAAU,WAAA;AACrC,iCACE,QAAM;AAAA,QAAkB,UAAUA;AAAAA,QAAO,UACxCT,MAAMK;AAAAA,MAAAA,GADKI,OAAOC,GAAG;AAAA,IAAA,CAIxB;AAAA,EAAA,CACC;AAEL,GACA,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,CAChB;AAAA,EACF;AACA,6BAAOC,UAAA;AAAA,IAAA,UAAGN,MAAMK;AAAAA,EAAAA,CAAY;AAC7B,GACA,YAAY;"}
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":[],"mappings":";;;;AAmBO,MAAM,aAAa;AAAA,EACzB,CAAuB,UAAsC;AACxD,QAAA,mBAAmB,SAAS,MAAM,eAAe;AAC7C,aAAA,cAAc,MAAM,eAAe;AAAA,QACzC,GAAG,MAAM;AAAA,QACT,UAAU,MAAM;AAAA,QAChB,UAAU,MAAM;AAAA,MAAA,CAChB;AAAA,IACF;AACA,WAEG,oBAAA,UAAA,EAAA,UAAA,MAAM,KAAK,MAAM,UAAU,CAAU,WAAA;AACrC,iCACE,QAAwB,EAAA,UAAU,QACjC,UAAM,MAAA,SAAA,GADK,OAAO,GAEpB;AAAA,IAED,CAAA,EACF,CAAA;AAAA,EAEF;AAAA,EACA,CAAuB,UAAsC;AACxD,QAAA,mBAAmB,SAAS,MAAM,eAAe;AAC7C,aAAA,cAAc,MAAM,eAAe;AAAA,QACzC,GAAG,MAAM;AAAA,QACT,UAAU;AAAA,QACV,UAAU,MAAM;AAAA,MAAA,CAChB;AAAA,IACF;AACO,WAAA,oBAAA,UAAA,EAAG,gBAAM,SAAS,CAAA;AAAA,EAC1B;AAAA,EACA;AACD;"}
@@ -1,3 +1,4 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
1
2
  import { useConstantValueInvariant } from "@contember/react-utils";
2
3
  import { useCallback } from "react";
3
4
  import { PRIMARY_KEY_NAME } from "../bindingTypes.js";
@@ -5,40 +6,40 @@ import { Component } from "./Component.js";
5
6
  import { EntityList } from "./EntityList.js";
6
7
  import { Field } from "./Field.js";
7
8
  import { TreeNodeEnvironmentFactory } from "../dao/TreeNodeEnvironmentFactory.js";
8
- import { jsxs, jsx } from "react/jsx-runtime";
9
9
  import { useGetEntityListSubTree } from "../accessorPropagation/useGetEntityListSubTree.js";
10
10
  import { useEntityListSubTreeParameters } from "../accessorPropagation/useEntityListSubTreeParameters.js";
11
11
  import { useAccessorUpdateSubscription } from "../accessorPropagation/useAccessorUpdateSubscription.js";
12
12
  import { MarkerFactory } from "../queryLanguage/MarkerFactory.js";
13
- const EntityListSubTree = Component((props) => {
14
- useConstantValueInvariant(props.isCreating, "EntityListSubTree: cannot update isCreating");
15
- const getSubTree = useGetEntityListSubTree();
16
- const parameters = useEntityListSubTreeParameters(props);
17
- const getAccessor = useCallback(() => getSubTree(parameters, props.treeRootId), [getSubTree, parameters, props.treeRootId]);
18
- const accessor = useAccessorUpdateSubscription(getAccessor);
19
- return /* @__PURE__ */ jsx(EntityList, {
20
- ...props,
21
- accessor
22
- });
23
- }, {
24
- generateBranchMarker: (props, fields, environment) => {
25
- if ("isCreating" in props && props.isCreating) {
26
- return MarkerFactory.createUnconstrainedEntityListSubTreeMarker(props, fields, environment);
13
+ const EntityListSubTree = Component(
14
+ (props) => {
15
+ useConstantValueInvariant(props.isCreating, "EntityListSubTree: cannot update isCreating");
16
+ const getSubTree = useGetEntityListSubTree();
17
+ const parameters = useEntityListSubTreeParameters(props);
18
+ const getAccessor = useCallback(
19
+ () => getSubTree(parameters, props.treeRootId),
20
+ [getSubTree, parameters, props.treeRootId]
21
+ );
22
+ const accessor = useAccessorUpdateSubscription(getAccessor);
23
+ return /* @__PURE__ */ jsx(EntityList, { ...props, accessor });
24
+ },
25
+ {
26
+ generateBranchMarker: (props, fields, environment) => {
27
+ if ("isCreating" in props && props.isCreating) {
28
+ return MarkerFactory.createUnconstrainedEntityListSubTreeMarker(props, fields, environment);
29
+ }
30
+ return MarkerFactory.createEntityListSubTreeMarker(props, fields, environment);
31
+ },
32
+ staticRender: (props) => /* @__PURE__ */ jsxs(EntityList, { ...props, accessor: 0, children: [
33
+ /* @__PURE__ */ jsx(Field, { field: PRIMARY_KEY_NAME }),
34
+ props.children
35
+ ] }),
36
+ generateEnvironment: (props, oldEnvironment) => {
37
+ const environment = oldEnvironment.withVariables(props.variables);
38
+ return TreeNodeEnvironmentFactory.createEnvironmentForEntityListSubtree(environment, props);
27
39
  }
28
- return MarkerFactory.createEntityListSubTreeMarker(props, fields, environment);
29
40
  },
30
- staticRender: (props) => /* @__PURE__ */ jsxs(EntityList, {
31
- ...props,
32
- accessor: 0,
33
- children: [/* @__PURE__ */ jsx(Field, {
34
- field: PRIMARY_KEY_NAME
35
- }), props.children]
36
- }),
37
- generateEnvironment: (props, oldEnvironment) => {
38
- const environment = oldEnvironment.withVariables(props.variables);
39
- return TreeNodeEnvironmentFactory.createEnvironmentForEntityListSubtree(environment, props);
40
- }
41
- }, "EntityListSubTree");
41
+ "EntityListSubTree"
42
+ );
42
43
  export {
43
44
  EntityListSubTree
44
45
  };
@@ -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":["EntityListSubTree","Component","props","isCreating","getSubTree","useGetEntityListSubTree","parameters","useEntityListSubTreeParameters","getAccessor","useCallback","treeRootId","accessor","useAccessorUpdateSubscription","generateBranchMarker","fields","environment","MarkerFactory","createUnconstrainedEntityListSubTreeMarker","createEntityListSubTreeMarker","staticRender","_jsxs","_jsx","PRIMARY_KEY_NAME","children","generateEnvironment","oldEnvironment","withVariables","variables","TreeNodeEnvironmentFactory","createEnvironmentForEntityListSubtree"],"mappings":";;;;;;;;;;;;AAiCaA,MAAAA,oBAAoBC,UAChC,CAAyBC,UAA0D;AACxDA,4BAAAA,MAAMC,YAAY,6CAA6C;AAEzF,QAAMC,aAAaC;AACbC,QAAAA,aAAaC,+BAA+BL,KAAK;AACvD,QAAMM,cAAcC,YACnB,MAAML,WAAWE,YAAYJ,MAAMQ,UAAU,GAC7C,CAACN,YAAYE,YAAYJ,MAAMQ,UAAU,CAAC;AAErCC,QAAAA,WAAWC,8BAA8BJ,WAAW;AAQ1D,6BAAQ,YAAU;AAAA,IAAA,GAAKN;AAAAA,IAAO;AAAA,EAAA,CAAsB;AACrD,GACA;AAAA,EACCW,sBAAsB,CAACX,OAAOY,QAAQC,gBAAgB;AACjD,QAAA,gBAAgBb,SAASA,MAAMC,YAAY;AAC9C,aAAOa,cAAcC,2CAA2Cf,OAAOY,QAAQC,WAAW;AAAA,IAC3F;AACA,WAAOC,cAAcE,8BAA8BhB,OAAOY,QAAQC,WAAW;AAAA,EAC9E;AAAA,EACAI,cAAcjB,CACb,UAAAkB,qBAAC,YAAU;AAAA,IAAA,GAAKlB;AAAAA,IAAO,UAAU;AAAA,IAAS,UAAA,CACzCmB,oBAAC,OAAK;AAAA,MAAC,OAAOC;AAAAA,IAAAA,CAAoB,GACjCpB,MAAMqB,QAAQ;AAAA,EAAA,CAEhB;AAAA,EACDC,qBAAqB,CAACtB,OAAOuB,mBAAmB;AAC/C,UAAMV,cAAcU,eAAeC,cAAcxB,MAAMyB,SAAS;AACzDC,WAAAA,2BAA2BC,sCAAsCd,aAAab,KAAK;AAAA,EAC3F;AACD,GACA,mBAAmB;"}
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":[],"mappings":";;;;;;;;;;;;AAiCO,MAAM,oBAAoB;AAAA,EAChC,CAAyB,UAA0D;AACxD,8BAAA,MAAM,YAAY,6CAA6C;AAEzF,UAAM,aAAa;AACb,UAAA,aAAa,+BAA+B,KAAK;AACvD,UAAM,cAAc;AAAA,MACnB,MAAM,WAAW,YAAY,MAAM,UAAU;AAAA,MAC7C,CAAC,YAAY,YAAY,MAAM,UAAU;AAAA,IAAA;AAEpC,UAAA,WAAW,8BAA8B,WAAW;AAQ1D,WAAQ,oBAAA,YAAA,EAAY,GAAG,OAAO,SAAoB,CAAA;AAAA,EACnD;AAAA,EACA;AAAA,IACC,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACjD,UAAA,gBAAgB,SAAS,MAAM,YAAY;AAC9C,eAAO,cAAc,2CAA2C,OAAO,QAAQ,WAAW;AAAA,MAC3F;AACA,aAAO,cAAc,8BAA8B,OAAO,QAAQ,WAAW;AAAA,IAC9E;AAAA,IACA,cAAc,CACb,UAAA,qBAAC,cAAY,GAAG,OAAO,UAAU,GAChC,UAAA;AAAA,MAAC,oBAAA,OAAA,EAAM,OAAO,iBAAkB,CAAA;AAAA,MAC/B,MAAM;AAAA,IAAA,GACR;AAAA,IAED,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,sCAAsC,aAAa,KAAK;AAAA,IAC3F;AAAA,EACD;AAAA,EACA;AACD;"}
@@ -1,3 +1,4 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
1
2
  import { useConstantValueInvariant } from "@contember/react-utils";
2
3
  import { useCallback } from "react";
3
4
  import { PRIMARY_KEY_NAME } from "../bindingTypes.js";
@@ -5,47 +6,51 @@ import { Component } from "./Component.js";
5
6
  import { Entity } from "./Entity.js";
6
7
  import { Field } from "./Field.js";
7
8
  import { TreeNodeEnvironmentFactory } from "../dao/TreeNodeEnvironmentFactory.js";
8
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
9
9
  import { SetOrderFieldOnCreate } from "../accessorSorting/SetOrderFieldOnCreate.js";
10
10
  import { useGetEntitySubTree } from "../accessorPropagation/useGetEntitySubTree.js";
11
11
  import { useEntitySubTreeParameters } from "../accessorPropagation/useEntitySubTreeParameters.js";
12
12
  import { MarkerFactory } from "../queryLanguage/MarkerFactory.js";
13
13
  import { useAccessorUpdateSubscription } from "../accessorPropagation/useAccessorUpdateSubscription.js";
14
- const EntitySubTree = Component((props) => {
15
- useConstantValueInvariant(props.isCreating, "EntitySubTree: cannot update isCreating");
16
- const getSubTree = useGetEntitySubTree();
17
- const parameters = useEntitySubTreeParameters(props);
18
- const getAccessor = useCallback(() => getSubTree(parameters, props.treeRootId), [getSubTree, parameters, props.treeRootId]);
19
- const accessor = useAccessorUpdateSubscription(getAccessor);
20
- return /* @__PURE__ */ jsx(Entity, {
21
- ...props,
22
- accessor
23
- });
24
- }, {
25
- generateBranchMarker: (props, fields, environment) => {
26
- if ("isCreating" in props && props.isCreating) {
27
- return MarkerFactory.createUnconstrainedEntitySubTreeMarker(props, fields, environment);
14
+ const EntitySubTree = Component(
15
+ (props) => {
16
+ useConstantValueInvariant(props.isCreating, "EntitySubTree: cannot update isCreating");
17
+ const getSubTree = useGetEntitySubTree();
18
+ const parameters = useEntitySubTreeParameters(props);
19
+ const getAccessor = useCallback(
20
+ () => getSubTree(parameters, props.treeRootId),
21
+ [getSubTree, parameters, props.treeRootId]
22
+ );
23
+ const accessor = useAccessorUpdateSubscription(getAccessor);
24
+ return /* @__PURE__ */ jsx(Entity, { ...props, accessor });
25
+ },
26
+ {
27
+ generateBranchMarker: (props, fields, environment) => {
28
+ if ("isCreating" in props && props.isCreating) {
29
+ return MarkerFactory.createUnconstrainedEntitySubTreeMarker(props, fields, environment);
30
+ }
31
+ return MarkerFactory.createEntitySubTreeMarker(props, fields, environment);
32
+ },
33
+ staticRender: (props) => /* @__PURE__ */ jsxs(Fragment, { children: [
34
+ /* @__PURE__ */ jsxs(Entity, { ...props, accessor: 0, children: [
35
+ /* @__PURE__ */ jsx(Field, { field: PRIMARY_KEY_NAME }),
36
+ props.children
37
+ ] }),
38
+ props.isCreating && "orderField" in props && /* @__PURE__ */ jsx(
39
+ SetOrderFieldOnCreate,
40
+ {
41
+ orderField: props.orderField,
42
+ newOrderFieldValue: props.newOrderFieldValue,
43
+ entity: props.entity
44
+ }
45
+ )
46
+ ] }),
47
+ generateEnvironment: (props, oldEnvironment) => {
48
+ const environment = oldEnvironment.withVariables(props.variables);
49
+ return TreeNodeEnvironmentFactory.createEnvironmentForEntitySubtree(environment, props);
28
50
  }
29
- return MarkerFactory.createEntitySubTreeMarker(props, fields, environment);
30
51
  },
31
- staticRender: (props) => /* @__PURE__ */ jsxs(Fragment, {
32
- children: [/* @__PURE__ */ jsxs(Entity, {
33
- ...props,
34
- accessor: 0,
35
- children: [/* @__PURE__ */ jsx(Field, {
36
- field: PRIMARY_KEY_NAME
37
- }), props.children]
38
- }), props.isCreating && "orderField" in props && /* @__PURE__ */ jsx(SetOrderFieldOnCreate, {
39
- orderField: props.orderField,
40
- newOrderFieldValue: props.newOrderFieldValue,
41
- entity: props.entity
42
- })]
43
- }),
44
- generateEnvironment: (props, oldEnvironment) => {
45
- const environment = oldEnvironment.withVariables(props.variables);
46
- return TreeNodeEnvironmentFactory.createEnvironmentForEntitySubtree(environment, props);
47
- }
48
- }, "EntitySubTree");
52
+ "EntitySubTree"
53
+ );
49
54
  export {
50
55
  EntitySubTree
51
56
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EntitySubTree.js","sources":["../../../src/coreComponents/EntitySubTree.tsx"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback } from 'react'\nimport { useAccessorUpdateSubscription, useEntitySubTreeParameters, useGetEntitySubTree } from '../accessorPropagation'\nimport { SetOrderFieldOnCreate, SetOrderFieldOnCreateOwnProps } from '../accessorSorting'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type {\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface EntitySubTreeAdditionalProps {\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\nexport type EntitySubTreeAdditionalCreationProps = {} | SetOrderFieldOnCreateOwnProps\n\nexport type EntitySubTreeProps<EntityProps> =\n\t& {\n\t\ttreeRootId?: TreeRootId\n\t\tchildren?: ReactNode\n\t}\n\t& EntitySubTreeAdditionalProps\n\t& (\n\t\t| SugaredQualifiedSingleEntity\n\t\t| (SugaredUnconstrainedQualifiedSingleEntity & EntitySubTreeAdditionalCreationProps)\n\t)\n\nexport const EntitySubTree = Component(\n\t<EntityProps extends {}>(props: EntitySubTreeProps<EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntitySubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntitySubTree()\n\t\tconst parameters = useEntitySubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top-level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ? (\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne>\n\t\t// ) : (\n\t\t// \tprops.children\n\t\t// )}\n\t\treturn <Entity {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntitySubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntitySubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t<Entity {...props} accessor={0 as any}>\n\t\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t\t{props.children}\n\t\t\t\t</Entity>\n\t\t\t\t{props.isCreating && 'orderField' in props && (\n\t\t\t\t\t<SetOrderFieldOnCreate\n\t\t\t\t\t\torderField={props.orderField}\n\t\t\t\t\t\tnewOrderFieldValue={props.newOrderFieldValue}\n\t\t\t\t\t\tentity={props.entity}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntitySubtree(environment, props)\n\t\t},\n\t},\n\t'EntitySubTree',\n) as <EntityProps>(pros: EntitySubTreeProps<EntityProps>) => ReactElement\n"],"names":["EntitySubTree","Component","props","isCreating","getSubTree","useGetEntitySubTree","parameters","useEntitySubTreeParameters","getAccessor","useCallback","treeRootId","accessor","useAccessorUpdateSubscription","generateBranchMarker","fields","environment","MarkerFactory","createUnconstrainedEntitySubTreeMarker","createEntitySubTreeMarker","staticRender","_jsxs","_Fragment","_jsx","PRIMARY_KEY_NAME","children","orderField","newOrderFieldValue","entity","generateEnvironment","oldEnvironment","withVariables","variables","TreeNodeEnvironmentFactory","createEnvironmentForEntitySubtree"],"mappings":";;;;;;;;;;;;;AAkCaA,MAAAA,gBAAgBC,UAC5B,CAAyBC,UAA2C;AACzCA,4BAAAA,MAAMC,YAAY,yCAAyC;AAErF,QAAMC,aAAaC;AACbC,QAAAA,aAAaC,2BAA2BL,KAAK;AACnD,QAAMM,cAAcC,YACnB,MAAML,WAAWE,YAAYJ,MAAMQ,UAAU,GAC7C,CAACN,YAAYE,YAAYJ,MAAMQ,UAAU,CAAC;AAErCC,QAAAA,WAAWC,8BAA8BJ,WAAW;AAQ1D,6BAAQ,QAAM;AAAA,IAAA,GAAKN;AAAAA,IAAO;AAAA,EAAA,CAAsB;AACjD,GACA;AAAA,EACCW,sBAAsB,CAACX,OAAOY,QAAQC,gBAAgB;AACjD,QAAA,gBAAgBb,SAASA,MAAMC,YAAY;AAC9C,aAAOa,cAAcC,uCAAuCf,OAAOY,QAAQC,WAAW;AAAA,IACvF;AACA,WAAOC,cAAcE,0BAA0BhB,OAAOY,QAAQC,WAAW;AAAA,EAC1E;AAAA,EACAI,cAAcjB,CACb,UAAAkB,qBAAAC,UAAA;AAAA,IAAA,UAAA,CACCD,qBAAC,QAAM;AAAA,MAAA,GAAKlB;AAAAA,MAAO,UAAU;AAAA,MAAS,UAAA,CACrCoB,oBAAC,OAAK;AAAA,QAAC,OAAOC;AAAAA,MAAAA,CAAoB,GACjCrB,MAAMsB,QAAQ;AAAA,IAAA,CACP,GACRtB,MAAMC,cAAc,gBAAgBD,6BACnC,uBAAqB;AAAA,MACrB,YAAYA,MAAMuB;AAAAA,MAClB,oBAAoBvB,MAAMwB;AAAAA,MAC1B,QAAQxB,MAAMyB;AAAAA,IAAAA,CAEf,CAAA;AAAA,EAAA,CAEF;AAAA,EACDC,qBAAqB,CAAC1B,OAAO2B,mBAAmB;AAC/C,UAAMd,cAAcc,eAAeC,cAAc5B,MAAM6B,SAAS;AACzDC,WAAAA,2BAA2BC,kCAAkClB,aAAab,KAAK;AAAA,EACvF;AACD,GACA,eAAe;"}
1
+ {"version":3,"file":"EntitySubTree.js","sources":["../../../src/coreComponents/EntitySubTree.tsx"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback } from 'react'\nimport { useAccessorUpdateSubscription, useEntitySubTreeParameters, useGetEntitySubTree } from '../accessorPropagation'\nimport { SetOrderFieldOnCreate, SetOrderFieldOnCreateOwnProps } from '../accessorSorting'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type {\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface EntitySubTreeAdditionalProps {\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\nexport type EntitySubTreeAdditionalCreationProps = {} | SetOrderFieldOnCreateOwnProps\n\nexport type EntitySubTreeProps<EntityProps> =\n\t& {\n\t\ttreeRootId?: TreeRootId\n\t\tchildren?: ReactNode\n\t}\n\t& EntitySubTreeAdditionalProps\n\t& (\n\t\t| SugaredQualifiedSingleEntity\n\t\t| (SugaredUnconstrainedQualifiedSingleEntity & EntitySubTreeAdditionalCreationProps)\n\t)\n\nexport const EntitySubTree = Component(\n\t<EntityProps extends {}>(props: EntitySubTreeProps<EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntitySubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntitySubTree()\n\t\tconst parameters = useEntitySubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top-level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ? (\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne>\n\t\t// ) : (\n\t\t// \tprops.children\n\t\t// )}\n\t\treturn <Entity {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntitySubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntitySubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t<Entity {...props} accessor={0 as any}>\n\t\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t\t{props.children}\n\t\t\t\t</Entity>\n\t\t\t\t{props.isCreating && 'orderField' in props && (\n\t\t\t\t\t<SetOrderFieldOnCreate\n\t\t\t\t\t\torderField={props.orderField}\n\t\t\t\t\t\tnewOrderFieldValue={props.newOrderFieldValue}\n\t\t\t\t\t\tentity={props.entity}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntitySubtree(environment, props)\n\t\t},\n\t},\n\t'EntitySubTree',\n) as <EntityProps>(pros: EntitySubTreeProps<EntityProps>) => ReactElement\n"],"names":[],"mappings":";;;;;;;;;;;;;AAkCO,MAAM,gBAAgB;AAAA,EAC5B,CAAyB,UAA2C;AACzC,8BAAA,MAAM,YAAY,yCAAyC;AAErF,UAAM,aAAa;AACb,UAAA,aAAa,2BAA2B,KAAK;AACnD,UAAM,cAAc;AAAA,MACnB,MAAM,WAAW,YAAY,MAAM,UAAU;AAAA,MAC7C,CAAC,YAAY,YAAY,MAAM,UAAU;AAAA,IAAA;AAEpC,UAAA,WAAW,8BAA8B,WAAW;AAQ1D,WAAQ,oBAAA,QAAA,EAAQ,GAAG,OAAO,SAAoB,CAAA;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACjD,UAAA,gBAAgB,SAAS,MAAM,YAAY;AAC9C,eAAO,cAAc,uCAAuC,OAAO,QAAQ,WAAW;AAAA,MACvF;AACA,aAAO,cAAc,0BAA0B,OAAO,QAAQ,WAAW;AAAA,IAC1E;AAAA,IACA,cAAc,WAEZ,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA,qBAAC,QAAQ,EAAA,GAAG,OAAO,UAAU,GAC5B,UAAA;AAAA,QAAC,oBAAA,OAAA,EAAM,OAAO,iBAAkB,CAAA;AAAA,QAC/B,MAAM;AAAA,MAAA,GACR;AAAA,MACC,MAAM,cAAc,gBAAgB,SACpC;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,YAAY,MAAM;AAAA,UAClB,oBAAoB,MAAM;AAAA,UAC1B,QAAQ,MAAM;AAAA,QAAA;AAAA,MACf;AAAA,IAAA,GAEF;AAAA,IAED,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,kCAAkC,aAAa,KAAK;AAAA,IACvF;AAAA,EACD;AAAA,EACA;AACD;"}
@@ -1,28 +1,28 @@
1
+ import { jsx, Fragment } from "react/jsx-runtime";
1
2
  import { GraphQlBuilder } from "@contember/client";
2
3
  import { Component } from "./Component.js";
3
4
  import { TreeNodeEnvironmentFactory } from "../dao/TreeNodeEnvironmentFactory.js";
4
- import { jsx, Fragment } from "react/jsx-runtime";
5
5
  import { useField } from "../accessorPropagation/useField.js";
6
6
  import { MarkerFactory } from "../queryLanguage/MarkerFactory.js";
7
- const Field = Component((props) => {
8
- const field = useField(props);
9
- if (props.format !== void 0) {
10
- return /* @__PURE__ */ jsx(Fragment, {
11
- children: props.format(field.value)
12
- });
13
- }
14
- if (field.value instanceof GraphQlBuilder.GraphQlLiteral || field.value === null || typeof field.value === "boolean") {
15
- return null;
16
- }
17
- return /* @__PURE__ */ jsx(Fragment, {
18
- children: field.value
19
- });
20
- }, {
21
- generateLeafMarker: (props, environment) => MarkerFactory.createFieldMarker(props, environment),
22
- generateEnvironment: (props, environment) => {
23
- return TreeNodeEnvironmentFactory.createEnvironmentForField(environment, props);
24
- }
25
- }, "Field");
7
+ const Field = Component(
8
+ (props) => {
9
+ const field = useField(props);
10
+ if (props.format !== void 0) {
11
+ return /* @__PURE__ */ jsx(Fragment, { children: props.format(field.value) });
12
+ }
13
+ if (field.value instanceof GraphQlBuilder.GraphQlLiteral || field.value === null || typeof field.value === "boolean") {
14
+ return null;
15
+ }
16
+ return /* @__PURE__ */ jsx(Fragment, { children: field.value });
17
+ },
18
+ {
19
+ generateLeafMarker: (props, environment) => MarkerFactory.createFieldMarker(props, environment),
20
+ generateEnvironment: (props, environment) => {
21
+ return TreeNodeEnvironmentFactory.createEnvironmentForField(environment, props);
22
+ }
23
+ },
24
+ "Field"
25
+ );
26
26
  export {
27
27
  Field
28
28
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sources":["../../../src/coreComponents/Field.tsx"],"sourcesContent":["import { GraphQlBuilder } from '@contember/client'\nimport type { ReactElement, ReactNode } from 'react'\nimport { useField } from '../accessorPropagation'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { FieldValue, SugaredRelativeSingleField } from '../treeParameters'\nimport { Component } from './Component'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface FieldBasicProps extends SugaredRelativeSingleField {}\n\nexport interface FieldRuntimeProps<Persisted extends FieldValue = FieldValue> {\n\tformat?: (value: Persisted | null) => ReactNode\n}\n\nexport interface FieldProps<Persisted extends FieldValue = FieldValue>\n\textends FieldBasicProps,\n\t\tFieldRuntimeProps<Persisted> {}\n\nexport const Field = Component(\n\t<Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => {\n\t\tconst field = useField<Persisted>(props)\n\n\t\tif (props.format !== undefined) {\n\t\t\treturn <>{props.format(field.value)}</>\n\t\t}\n\n\t\tif (\n\t\t\tfield.value instanceof GraphQlBuilder.GraphQlLiteral ||\n\t\t\tfield.value === null ||\n\t\t\ttypeof field.value === 'boolean'\n\t\t) {\n\t\t\treturn null\n\t\t}\n\t\treturn <>{field.value}</>\n\t},\n\t{\n\t\tgenerateLeafMarker: (props, environment) => MarkerFactory.createFieldMarker(props, environment),\n\t\tgenerateEnvironment: (props, environment) => {\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForField(environment, props)\n\t\t},\n\t},\n\t'Field',\n) as <Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => ReactElement\n"],"names":["Field","Component","props","field","useField","format","undefined","_Fragment","value","GraphQlBuilder","GraphQlLiteral","generateLeafMarker","environment","MarkerFactory","createFieldMarker","generateEnvironment","TreeNodeEnvironmentFactory","createEnvironmentForField"],"mappings":";;;;;;AAkBaA,MAAAA,QAAQC,UACpB,CAA4CC,UAAiC;AACtEC,QAAAA,QAAQC,SAAoBF,KAAK;AAEnCA,MAAAA,MAAMG,WAAWC,QAAW;AAC/B,+BAAOC,UAAA;AAAA,MAAA,UAAGL,MAAMG,OAAOF,MAAMK,KAAK;AAAA,IAAA,CAAK;AAAA,EACxC;AAGCL,MAAAA,MAAMK,iBAAiBC,eAAeC,kBACtCP,MAAMK,UAAU,QAChB,OAAOL,MAAMK,UAAU,WACtB;AACM,WAAA;AAAA,EACR;AACA,6BAAOD,UAAA;AAAA,IAAA,UAAGJ,MAAMK;AAAAA,EAAAA,CAAS;AAC1B,GACA;AAAA,EACCG,oBAAoB,CAACT,OAAOU,gBAAgBC,cAAcC,kBAAkBZ,OAAOU,WAAW;AAAA,EAC9FG,qBAAqB,CAACb,OAAOU,gBAAgB;AACrCI,WAAAA,2BAA2BC,0BAA0BL,aAAaV,KAAK;AAAA,EAC/E;AACD,GACA,OAAO;"}
1
+ {"version":3,"file":"Field.js","sources":["../../../src/coreComponents/Field.tsx"],"sourcesContent":["import { GraphQlBuilder } from '@contember/client'\nimport type { ReactElement, ReactNode } from 'react'\nimport { useField } from '../accessorPropagation'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { FieldValue, SugaredRelativeSingleField } from '../treeParameters'\nimport { Component } from './Component'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface FieldBasicProps extends SugaredRelativeSingleField {}\n\nexport interface FieldRuntimeProps<Persisted extends FieldValue = FieldValue> {\n\tformat?: (value: Persisted | null) => ReactNode\n}\n\nexport interface FieldProps<Persisted extends FieldValue = FieldValue>\n\textends FieldBasicProps,\n\t\tFieldRuntimeProps<Persisted> {}\n\nexport const Field = Component(\n\t<Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => {\n\t\tconst field = useField<Persisted>(props)\n\n\t\tif (props.format !== undefined) {\n\t\t\treturn <>{props.format(field.value)}</>\n\t\t}\n\n\t\tif (\n\t\t\tfield.value instanceof GraphQlBuilder.GraphQlLiteral ||\n\t\t\tfield.value === null ||\n\t\t\ttypeof field.value === 'boolean'\n\t\t) {\n\t\t\treturn null\n\t\t}\n\t\treturn <>{field.value}</>\n\t},\n\t{\n\t\tgenerateLeafMarker: (props, environment) => MarkerFactory.createFieldMarker(props, environment),\n\t\tgenerateEnvironment: (props, environment) => {\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForField(environment, props)\n\t\t},\n\t},\n\t'Field',\n) as <Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => ReactElement\n"],"names":[],"mappings":";;;;;;AAkBO,MAAM,QAAQ;AAAA,EACpB,CAA4C,UAAiC;AACtE,UAAA,QAAQ,SAAoB,KAAK;AAEnC,QAAA,MAAM,WAAW,QAAW;AAC/B,aAAU,oBAAA,UAAA,EAAA,UAAA,MAAM,OAAO,MAAM,KAAK,EAAE,CAAA;AAAA,IACrC;AAGC,QAAA,MAAM,iBAAiB,eAAe,kBACtC,MAAM,UAAU,QAChB,OAAO,MAAM,UAAU,WACtB;AACM,aAAA;AAAA,IACR;AACO,WAAA,oBAAA,UAAA,EAAG,gBAAM,MAAM,CAAA;AAAA,EACvB;AAAA,EACA;AAAA,IACC,oBAAoB,CAAC,OAAO,gBAAgB,cAAc,kBAAkB,OAAO,WAAW;AAAA,IAC9F,qBAAqB,CAAC,OAAO,gBAAgB;AACrC,aAAA,2BAA2B,0BAA0B,aAAa,KAAK;AAAA,IAC/E;AAAA,EACD;AAAA,EACA;AACD;"}