ballerina-core 1.0.245 → 1.0.246

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 (321) hide show
  1. package/bin/main.js +1 -1
  2. package/bin/src/api-response-handler/coroutines/runner.js +13 -20
  3. package/bin/src/api-response-handler/state.js +11 -13
  4. package/bin/src/apiResultStatus/state.d.ts +3 -10
  5. package/bin/src/apiResultStatus/state.js +5 -2
  6. package/bin/src/async/domains/mirroring/domains/collection/coroutines/synchronizers.js +196 -314
  7. package/bin/src/async/domains/mirroring/domains/collection/state.js +36 -126
  8. package/bin/src/async/domains/mirroring/domains/entity/domains/loaded-collection/state.js +11 -18
  9. package/bin/src/async/domains/mirroring/domains/entity/domains/loaded-collection-entity/state.js +19 -19
  10. package/bin/src/async/domains/mirroring/domains/entity/domains/loaded-entities/state.js +1 -1
  11. package/bin/src/async/domains/mirroring/domains/entity/domains/loaded-entity/state.js +18 -18
  12. package/bin/src/async/domains/mirroring/domains/entity/state.js +9 -18
  13. package/bin/src/async/domains/mirroring/domains/singleton/coroutines/synchronizers.js +83 -134
  14. package/bin/src/async/domains/mirroring/domains/singleton/state.js +8 -52
  15. package/bin/src/async/domains/mirroring/domains/synchronized-entities/state.js +4 -7
  16. package/bin/src/async/domains/promise/state.d.ts +4 -9
  17. package/bin/src/async/domains/promise/state.js +9 -20
  18. package/bin/src/async/domains/synchronized/coroutines/synchronize.js +28 -80
  19. package/bin/src/async/domains/synchronized/state.d.ts +7 -14
  20. package/bin/src/async/domains/synchronized/state.js +6 -16
  21. package/bin/src/async/state.d.ts +45 -56
  22. package/bin/src/async/state.js +97 -115
  23. package/bin/src/baseEntity/domains/identifiable/state.d.ts +11 -15
  24. package/bin/src/baseEntity/domains/identifiable/state.js +9 -9
  25. package/bin/src/collections/domains/array/state.d.ts +7 -7
  26. package/bin/src/collections/domains/array/state.js +5 -5
  27. package/bin/src/collections/domains/errors/state.d.ts +10 -10
  28. package/bin/src/collections/domains/errors/state.js +10 -10
  29. package/bin/src/collections/domains/immutable/domains/list/state.js +44 -46
  30. package/bin/src/collections/domains/immutable/domains/map/state.js +23 -41
  31. package/bin/src/collections/domains/immutable/domains/orderedMap/state.js +65 -84
  32. package/bin/src/collections/domains/immutable/domains/ordereredSet/state.d.ts +6 -6
  33. package/bin/src/collections/domains/immutable/domains/ordereredSet/state.js +6 -6
  34. package/bin/src/collections/domains/maybe/state.d.ts +9 -9
  35. package/bin/src/collections/domains/maybe/state.js +9 -12
  36. package/bin/src/collections/domains/product/state.d.ts +19 -25
  37. package/bin/src/collections/domains/product/state.js +10 -13
  38. package/bin/src/collections/domains/sum/state.d.ts +77 -101
  39. package/bin/src/collections/domains/sum/state.js +32 -49
  40. package/bin/src/collections/domains/valueOrErrors/state.js +56 -81
  41. package/bin/src/coroutines/builder.js +19 -40
  42. package/bin/src/coroutines/state.js +306 -381
  43. package/bin/src/coroutines/template.js +59 -97
  44. package/bin/src/debounced/coroutines/debounce.js +89 -115
  45. package/bin/src/debounced/state.js +25 -62
  46. package/bin/src/diagnostics/domains/message-box/state.d.ts +1 -1
  47. package/bin/src/diagnostics/domains/message-box/state.js +3 -3
  48. package/bin/src/foreignMutations/state.d.ts +3 -3
  49. package/bin/src/foreignMutations/state.js +1 -1
  50. package/bin/src/forms/domains/attachments/views/attachments-view.js +8 -30
  51. package/bin/src/forms/domains/collection/domains/reference/state.js +20 -26
  52. package/bin/src/forms/domains/collection/domains/selection/state.js +1 -1
  53. package/bin/src/forms/domains/dispatched-forms/built-ins/state.js +754 -2007
  54. package/bin/src/forms/domains/dispatched-forms/deserializer/coroutines/runner.js +44 -123
  55. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/apis/state.js +166 -339
  56. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/enum/state.js +27 -40
  57. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/list/state.js +40 -76
  58. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/lookup/state.js +59 -102
  59. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/map/state.js +29 -64
  60. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/nestedRenderer/state.js +30 -64
  61. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/one/state.js +33 -88
  62. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/primitive/state.js +13 -21
  63. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/readOnly/state.js +23 -52
  64. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/record/domains/recordFieldRenderer/state.js +18 -59
  65. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/record/state.js +55 -129
  66. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/stream/state.js +27 -43
  67. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/sum/state.js +23 -63
  68. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/sumUnitDate/state.js +22 -39
  69. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/table/domains/tableCellRenderer/state.js +11 -46
  70. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/table/state.d.ts +6 -1
  71. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/table/state.d.ts.map +1 -1
  72. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/table/state.js +50 -146
  73. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/table/state.js.map +1 -1
  74. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/tuple/state.js +29 -64
  75. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/union/state.js +33 -78
  76. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/state.js +62 -157
  77. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/types/state.js +569 -977
  78. package/bin/src/forms/domains/dispatched-forms/deserializer/domains/specification/state.js +94 -255
  79. package/bin/src/forms/domains/dispatched-forms/deserializer/state.js +90 -322
  80. package/bin/src/forms/domains/dispatched-forms/deserializer/template.js +2 -3
  81. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/base-64-file/state.js +3 -3
  82. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/base-64-file/template.js +23 -49
  83. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/boolean/state.js +3 -3
  84. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/boolean/template.js +24 -52
  85. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/date/state.js +6 -18
  86. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/date/template.js +30 -64
  87. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/enum/state.js +6 -9
  88. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/enum/template.js +60 -153
  89. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/enum-multiselect/state.js +1 -1
  90. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/enum-multiselect/template.js +50 -127
  91. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/injectables/state.js +22 -40
  92. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/list/state.js +13 -31
  93. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/list/template.d.ts +2 -2
  94. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/list/template.d.ts.map +1 -1
  95. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/list/template.js +142 -417
  96. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/list/template.js.map +1 -1
  97. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/lookup-type/state.js +1 -1
  98. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/lookup-type/template.js +8 -28
  99. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/map/state.js +18 -61
  100. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/map/template.js +90 -329
  101. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/number/state.js +3 -3
  102. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/number/template.js +23 -54
  103. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/coroutines/_debouncer.js +10 -22
  104. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/coroutines/_initializeOne.js +31 -49
  105. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/coroutines/_initializeStream.js +10 -29
  106. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/coroutines/builder.js +2 -2
  107. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/coroutines/runner.js +26 -47
  108. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/state.js +40 -88
  109. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/one/template.js +152 -386
  110. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/readOnly/state.js +10 -19
  111. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/readOnly/template.js +21 -78
  112. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/record/state.js +11 -32
  113. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/record/template.js +77 -222
  114. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/searchable-infinite-stream/state.js +13 -35
  115. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/searchable-infinite-stream/template.js +68 -195
  116. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/searchable-infinite-stream-multiselect/state.js +13 -36
  117. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/searchable-infinite-stream-multiselect/template.js +106 -246
  118. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/secret/state.js +3 -3
  119. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/secret/template.js +23 -54
  120. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/state.js +27 -40
  121. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/string/state.js +3 -3
  122. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/string/template.js +26 -58
  123. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/sum/state.js +7 -22
  124. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/sum/template.js +53 -188
  125. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/builder.js +2 -2
  126. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/infiniteLoader.js +24 -57
  127. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/initialiseFiltersAndSorting.js +20 -70
  128. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/initialiseTable.js +27 -61
  129. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/loadWithRetries.js +19 -38
  130. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/coroutines/runner.js +15 -43
  131. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/state.d.ts +4 -0
  132. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/state.d.ts.map +1 -1
  133. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/state.js +137 -301
  134. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/template.d.ts +6 -2
  135. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/template.d.ts.map +1 -1
  136. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/template.js +238 -622
  137. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/template.js.map +1 -1
  138. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/tuple/state.js +8 -20
  139. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/tuple/template.js +35 -132
  140. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/union/state.js +8 -21
  141. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/union/template.js +32 -103
  142. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/unit/state.js +9 -12
  143. package/bin/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/unit/template.js +20 -54
  144. package/bin/src/forms/domains/dispatched-forms/runner/domains/deltas/state.d.ts +8 -0
  145. package/bin/src/forms/domains/dispatched-forms/runner/domains/deltas/state.d.ts.map +1 -1
  146. package/bin/src/forms/domains/dispatched-forms/runner/domains/deltas/state.js +537 -676
  147. package/bin/src/forms/domains/dispatched-forms/runner/domains/deltas/state.js.map +1 -1
  148. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/list/state.js +18 -58
  149. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/lookup/state.js +14 -45
  150. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/map/state.js +18 -76
  151. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/multiSelection/state.js +24 -82
  152. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/nestedDispatcher/state.js +8 -37
  153. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/one/state.js +36 -120
  154. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/primitive/state.js +63 -145
  155. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/readOnly/state.js +12 -44
  156. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/record/recordField/state.js +4 -14
  157. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/record/state.js +25 -81
  158. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/singleSelectionDispatcher/state.js +24 -82
  159. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/sum/state.js +20 -63
  160. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/table/state.d.ts.map +1 -1
  161. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/table/state.js +74 -247
  162. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/table/state.js.map +1 -1
  163. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/tupleDispatcher/state.js +13 -61
  164. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/unionDispatcher/state.js +15 -64
  165. package/bin/src/forms/domains/dispatched-forms/runner/domains/dispatcher/state.js +45 -144
  166. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/_init.js +95 -203
  167. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/_sync.js +37 -79
  168. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/builder.js +2 -2
  169. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/runner.js +17 -19
  170. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/state.js +11 -58
  171. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/create/template.js +25 -73
  172. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/_init.js +95 -205
  173. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/_sync.js +37 -78
  174. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/builder.js +2 -2
  175. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/runner.js +17 -19
  176. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/state.js +11 -58
  177. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/edit/template.js +25 -71
  178. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/passthrough/coroutines/runner.js +85 -163
  179. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/passthrough/state.js +4 -10
  180. package/bin/src/forms/domains/dispatched-forms/runner/domains/kind/passthrough/template.js +27 -72
  181. package/bin/src/forms/domains/dispatched-forms/runner/domains/traversal/state.js +423 -773
  182. package/bin/src/forms/domains/dispatched-forms/runner/state.js +38 -62
  183. package/bin/src/forms/domains/dispatched-forms/runner/template.js +25 -78
  184. package/bin/src/forms/domains/launcher/coroutines/runner.js +45 -120
  185. package/bin/src/forms/domains/launcher/domains/create/coroutines/runner.js +101 -240
  186. package/bin/src/forms/domains/launcher/domains/create/state.js +17 -62
  187. package/bin/src/forms/domains/launcher/domains/create/template.js +42 -84
  188. package/bin/src/forms/domains/launcher/domains/edit/coroutines/runner.js +103 -242
  189. package/bin/src/forms/domains/launcher/domains/edit/state.js +17 -62
  190. package/bin/src/forms/domains/launcher/domains/edit/template.js +43 -86
  191. package/bin/src/forms/domains/launcher/domains/merger/state.d.ts +4 -4
  192. package/bin/src/forms/domains/launcher/domains/merger/state.js +26 -35
  193. package/bin/src/forms/domains/launcher/domains/passthrough/coroutines/runner.js +42 -88
  194. package/bin/src/forms/domains/launcher/domains/passthrough/state.js +19 -44
  195. package/bin/src/forms/domains/launcher/domains/passthrough/template.js +34 -56
  196. package/bin/src/forms/domains/launcher/state.js +6 -6
  197. package/bin/src/forms/domains/launcher/template.js +85 -169
  198. package/bin/src/forms/domains/parser/coroutines/runner.js +25 -87
  199. package/bin/src/forms/domains/parser/domains/built-ins/state.js +533 -944
  200. package/bin/src/forms/domains/parser/domains/deltas/state.js +318 -444
  201. package/bin/src/forms/domains/parser/domains/injectables/state.js +26 -29
  202. package/bin/src/forms/domains/parser/domains/layout/state.d.ts +1 -1
  203. package/bin/src/forms/domains/parser/domains/layout/state.d.ts.map +1 -1
  204. package/bin/src/forms/domains/parser/domains/layout/state.js +183 -265
  205. package/bin/src/forms/domains/parser/domains/layout/state.js.map +1 -1
  206. package/bin/src/forms/domains/parser/domains/predicates/domains/extractor/state.js +162 -324
  207. package/bin/src/forms/domains/parser/domains/predicates/state.js +979 -1509
  208. package/bin/src/forms/domains/parser/domains/renderer/state.js +480 -1137
  209. package/bin/src/forms/domains/parser/domains/types/state.js +170 -355
  210. package/bin/src/forms/domains/parser/domains/validator/state.js +280 -417
  211. package/bin/src/forms/domains/parser/state.js +373 -612
  212. package/bin/src/forms/domains/parser/template.js +1 -1
  213. package/bin/src/forms/domains/primitives/domains/base-64-file/state.js +5 -5
  214. package/bin/src/forms/domains/primitives/domains/base-64-file/template.js +19 -38
  215. package/bin/src/forms/domains/primitives/domains/boolean/state.js +5 -5
  216. package/bin/src/forms/domains/primitives/domains/boolean/template.js +19 -38
  217. package/bin/src/forms/domains/primitives/domains/date/state.js +9 -18
  218. package/bin/src/forms/domains/primitives/domains/date/template.js +25 -51
  219. package/bin/src/forms/domains/primitives/domains/enum/state.js +6 -6
  220. package/bin/src/forms/domains/primitives/domains/enum/template.js +48 -117
  221. package/bin/src/forms/domains/primitives/domains/enum-multiselect/state.js +1 -1
  222. package/bin/src/forms/domains/primitives/domains/enum-multiselect/template.js +40 -99
  223. package/bin/src/forms/domains/primitives/domains/list/state.js +14 -14
  224. package/bin/src/forms/domains/primitives/domains/list/template.js +71 -200
  225. package/bin/src/forms/domains/primitives/domains/map/state.js +14 -14
  226. package/bin/src/forms/domains/primitives/domains/map/template.js +103 -294
  227. package/bin/src/forms/domains/primitives/domains/number/state.js +5 -5
  228. package/bin/src/forms/domains/primitives/domains/number/template.js +19 -38
  229. package/bin/src/forms/domains/primitives/domains/searchable-infinite-stream/state.js +16 -33
  230. package/bin/src/forms/domains/primitives/domains/searchable-infinite-stream/template.js +62 -171
  231. package/bin/src/forms/domains/primitives/domains/searchable-infinite-stream-multiselect/state.js +1 -1
  232. package/bin/src/forms/domains/primitives/domains/searchable-infinite-stream-multiselect/template.js +69 -182
  233. package/bin/src/forms/domains/primitives/domains/secret/state.js +5 -5
  234. package/bin/src/forms/domains/primitives/domains/secret/template.js +19 -38
  235. package/bin/src/forms/domains/primitives/domains/string/state.js +5 -5
  236. package/bin/src/forms/domains/primitives/domains/string/template.js +22 -42
  237. package/bin/src/forms/domains/primitives/domains/sum/state.js +10 -10
  238. package/bin/src/forms/domains/primitives/domains/sum/template.js +50 -141
  239. package/bin/src/forms/domains/primitives/domains/tuple/state.js +9 -9
  240. package/bin/src/forms/domains/primitives/domains/tuple/template.js +33 -100
  241. package/bin/src/forms/domains/primitives/domains/unit/state.js +8 -8
  242. package/bin/src/forms/domains/primitives/domains/unit/template.js +9 -22
  243. package/bin/src/forms/domains/singleton/domains/form-label/state.d.ts +4 -4
  244. package/bin/src/forms/domains/singleton/domains/form-label/state.js +1 -1
  245. package/bin/src/forms/domains/singleton/state.js +10 -12
  246. package/bin/src/forms/domains/singleton/template.js +113 -288
  247. package/bin/src/fun/domains/curry/state.d.ts +2 -4
  248. package/bin/src/fun/domains/curry/state.js +1 -1
  249. package/bin/src/fun/domains/id/state.d.ts +1 -1
  250. package/bin/src/fun/domains/id/state.js +1 -1
  251. package/bin/src/fun/domains/predicate/domains/bool-expr.d.ts +41 -57
  252. package/bin/src/fun/domains/predicate/domains/bool-expr.js +67 -76
  253. package/bin/src/fun/domains/predicate/state.d.ts +7 -9
  254. package/bin/src/fun/domains/predicate/state.js +10 -14
  255. package/bin/src/fun/domains/simpleCallback/state.d.ts +1 -1
  256. package/bin/src/fun/domains/simpleCallback/state.js +1 -1
  257. package/bin/src/fun/domains/uncurry/state.d.ts +2 -4
  258. package/bin/src/fun/domains/uncurry/state.js +1 -1
  259. package/bin/src/fun/domains/unit/state.d.ts +1 -1
  260. package/bin/src/fun/domains/unit/state.js +1 -1
  261. package/bin/src/fun/domains/updater/domains/caseUpdater/state.d.ts +7 -22
  262. package/bin/src/fun/domains/updater/domains/caseUpdater/state.js +10 -18
  263. package/bin/src/fun/domains/updater/domains/mapUpdater/state.d.ts +13 -24
  264. package/bin/src/fun/domains/updater/domains/mapUpdater/state.js +10 -40
  265. package/bin/src/fun/domains/updater/domains/maybeUpdater/state.d.ts +13 -19
  266. package/bin/src/fun/domains/updater/domains/maybeUpdater/state.js +9 -20
  267. package/bin/src/fun/domains/updater/domains/orderedMapUpdater/state.d.ts +13 -24
  268. package/bin/src/fun/domains/updater/domains/orderedMapUpdater/state.js +11 -47
  269. package/bin/src/fun/domains/updater/domains/orderedSetUpdater/state.d.ts +8 -20
  270. package/bin/src/fun/domains/updater/domains/orderedSetUpdater/state.js +5 -17
  271. package/bin/src/fun/domains/updater/domains/replaceWith/state.d.ts +1 -1
  272. package/bin/src/fun/domains/updater/domains/replaceWith/state.js +1 -1
  273. package/bin/src/fun/domains/updater/domains/simpleUpdater/domains/baseSimpleUpdater/state.d.ts +4 -13
  274. package/bin/src/fun/domains/updater/domains/simpleUpdater/domains/baseSimpleUpdater/state.js +4 -6
  275. package/bin/src/fun/domains/updater/domains/simpleUpdater/state.d.ts +22 -60
  276. package/bin/src/fun/domains/updater/domains/simpleUpdater/state.js +31 -42
  277. package/bin/src/fun/domains/updater/state.d.ts +4 -4
  278. package/bin/src/fun/domains/updater/state.js +10 -12
  279. package/bin/src/fun/state.d.ts +3 -3
  280. package/bin/src/fun/state.js +7 -9
  281. package/bin/src/infinite-data-stream/coroutines/builder.js +1 -1
  282. package/bin/src/infinite-data-stream/coroutines/infiniteLoader.js +20 -47
  283. package/bin/src/infinite-data-stream/coroutines/runner.js +7 -7
  284. package/bin/src/infinite-data-stream/state.d.ts +51 -84
  285. package/bin/src/infinite-data-stream/state.js +61 -125
  286. package/bin/src/infinite-data-stream/template.js +2 -3
  287. package/bin/src/math/domains/DOMRect/state.d.ts +4 -4
  288. package/bin/src/math/domains/DOMRect/state.js +8 -10
  289. package/bin/src/math/domains/number/state.d.ts +5 -5
  290. package/bin/src/math/domains/number/state.js +5 -5
  291. package/bin/src/math/domains/rect/state.d.ts +8 -8
  292. package/bin/src/math/domains/rect/state.js +15 -16
  293. package/bin/src/math/domains/rgba/state.d.ts +17 -17
  294. package/bin/src/math/domains/rgba/state.js +81 -77
  295. package/bin/src/math/domains/size2/state.d.ts +8 -8
  296. package/bin/src/math/domains/size2/state.js +6 -6
  297. package/bin/src/math/domains/vector2/state.d.ts +10 -10
  298. package/bin/src/math/domains/vector2/state.js +8 -8
  299. package/bin/src/queue/state.d.ts +2 -2
  300. package/bin/src/queue/state.d.ts.map +1 -1
  301. package/bin/src/queue/state.js +2 -2
  302. package/bin/src/queue/state.js.map +1 -1
  303. package/bin/src/state/domains/repository/state.d.ts +9 -15
  304. package/bin/src/state/domains/repository/state.js +1 -1
  305. package/bin/src/template/state.js +115 -163
  306. package/bin/src/validation/state.js +45 -38
  307. package/bin/src/value/domains/mutable-value/state.js +2 -3
  308. package/bin/src/value/state.d.ts +9 -9
  309. package/bin/src/value/state.js +8 -11
  310. package/bin/src/value-infinite-data-stream/coroutines/builder.js +1 -1
  311. package/bin/src/value-infinite-data-stream/coroutines/infiniteLoader.js +20 -55
  312. package/bin/src/value-infinite-data-stream/coroutines/runner.js +4 -6
  313. package/bin/src/value-infinite-data-stream/state.js +77 -199
  314. package/bin/src/value-infinite-data-stream/template.js +2 -4
  315. package/bin/src/visibility/state.d.ts +2 -5
  316. package/bin/src/visibility/state.js +1 -1
  317. package/package.json +1 -1
  318. package/src/forms/domains/dispatched-forms/deserializer/domains/specification/domains/forms/domains/renderer/domains/table/state.ts +32 -15
  319. package/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/template.tsx +16 -3
  320. package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/table/state.ts +1 -0
  321. package/src/forms/domains/parser/domains/layout/state.ts +11 -4
package/bin/main.js CHANGED
@@ -263,4 +263,4 @@ export * from "./src/forms/domains/dispatched-forms/runner/domains/traversal/sta
263
263
  // console.log(personUpdater(Person.Default()))
264
264
  // const addressUpdater:Updater<Address> = Address.Updaters.Core.city.children.name(_ =>"The Great " + _)
265
265
  // console.log(addressUpdater(Address.Default()))
266
- //# sourceMappingURL=main.js.map
266
+ //# sourceMappingURL=main.js.map
@@ -1,24 +1,17 @@
1
1
  import { CoTypedFactory } from "../../coroutines/builder";
2
2
  import { AsyncState } from "../../../main";
3
3
  export const HandleApiResponse = (asyncAccessor, handlers) => {
4
- const CheckerCo = CoTypedFactory();
5
- return CheckerCo.GetState().then((_) => {
6
- const asyncState = asyncAccessor(_);
7
- return AsyncState.Operations.isLoading(asyncState)
8
- ? CheckerCo.Do(() => {})
9
- : CheckerCo.Do(() => {
10
- var _a, _b;
11
- return AsyncState.Operations.status(asyncState) === "error"
12
- ? (_a = handlers.handleError) === null || _a === void 0
13
- ? void 0
14
- : _a.call(
15
- handlers,
16
- asyncState.kind === "error" ? asyncState.error : undefined,
17
- )
18
- : (_b = handlers.handleSuccess) === null || _b === void 0
19
- ? void 0
20
- : _b.call(handlers, _);
21
- });
22
- });
4
+ const CheckerCo = CoTypedFactory();
5
+ return CheckerCo.GetState().then((_) => {
6
+ const asyncState = asyncAccessor(_);
7
+ return AsyncState.Operations.isLoading(asyncState)
8
+ ? CheckerCo.Do(() => { })
9
+ : CheckerCo.Do(() => {
10
+ var _a, _b;
11
+ return AsyncState.Operations.status(asyncState) === "error"
12
+ ? (_a = handlers.handleError) === null || _a === void 0 ? void 0 : _a.call(handlers, asyncState.kind === "error" ? asyncState.error : undefined)
13
+ : (_b = handlers.handleSuccess) === null || _b === void 0 ? void 0 : _b.call(handlers, _);
14
+ });
15
+ });
23
16
  };
24
- //# sourceMappingURL=runner.js.map
17
+ //# sourceMappingURL=runner.js.map
@@ -1,15 +1,13 @@
1
1
  export const ApiResponseChecker = {
2
- Default: (_) => ({
3
- apiResponseChecked: _ !== null && _ !== void 0 ? _ : false,
4
- }),
5
- Updaters: () => ({
6
- toChecked: () => (_) =>
7
- Object.assign(Object.assign({}, _), { apiResponseChecked: true }),
8
- toUnchecked: () => (_) =>
9
- Object.assign(Object.assign({}, _), { apiResponseChecked: false }),
10
- }),
11
- Operations: {
12
- checked: (_) => _.apiResponseChecked,
13
- },
2
+ Default: (_) => ({
3
+ apiResponseChecked: _ !== null && _ !== void 0 ? _ : false,
4
+ }),
5
+ Updaters: () => ({
6
+ toChecked: () => (_) => (Object.assign(Object.assign({}, _), { apiResponseChecked: true })),
7
+ toUnchecked: () => (_) => (Object.assign(Object.assign({}, _), { apiResponseChecked: false })),
8
+ }),
9
+ Operations: {
10
+ checked: (_) => _.apiResponseChecked,
11
+ },
14
12
  };
15
- //# sourceMappingURL=state.js.map
13
+ //# sourceMappingURL=state.js.map
@@ -1,12 +1,5 @@
1
- export declare const errorPermanenceStatus: readonly [
2
- "permanent failure",
3
- "transient failure",
4
- ];
1
+ export declare const errorPermanenceStatus: readonly ["permanent failure", "transient failure"];
5
2
  export type ErrorPermanenceStatus = (typeof errorPermanenceStatus)[number];
6
- export declare const apiResultStatuses: readonly [
7
- "success",
8
- "permanent failure",
9
- "transient failure",
10
- ];
3
+ export declare const apiResultStatuses: readonly ["success", "permanent failure", "transient failure"];
11
4
  export type ApiResultStatus = (typeof apiResultStatuses)[number];
12
- //# sourceMappingURL=state.d.ts.map
5
+ //# sourceMappingURL=state.d.ts.map
@@ -1,3 +1,6 @@
1
- export const errorPermanenceStatus = ["permanent failure", "transient failure"];
1
+ export const errorPermanenceStatus = [
2
+ "permanent failure",
3
+ "transient failure",
4
+ ];
2
5
  export const apiResultStatuses = ["success", ...errorPermanenceStatus];
3
- //# sourceMappingURL=state.js.map
6
+ //# sourceMappingURL=state.js.map
@@ -1,338 +1,220 @@
1
- import {
2
- CoTypedFactory,
3
- AsyncState,
4
- replaceWith,
5
- Entity,
6
- Debounced,
7
- } from "../../../../../../../main";
1
+ import { CoTypedFactory, AsyncState, replaceWith, Entity, Debounced, } from "../../../../../../../main";
8
2
  import { Fun } from "../../../../../../fun/state";
9
3
  import { insideEntitySynchronizedAndDebounced } from "../../singleton/coroutines/synchronizers";
10
4
  import { Collection, CollectionEntity } from "../state";
11
- export const collectionEntityLoader =
12
- (synchronizers) => (k, id, narrowing_k, widening_k, dependees) =>
13
- Object.assign(
14
- (mutation, mutationArg, entityId) => {
15
- const Co = CoTypedFactory();
16
- return Co.GetState().then((current) => {
17
- const entities = narrowing_k(current).entities;
18
- if (
19
- !AsyncState.Operations.hasValue(entities.sync) ||
20
- !entities.sync.value.get(entityId)
21
- )
5
+ export const collectionEntityLoader = (synchronizers) => (k, id, narrowing_k, widening_k, dependees) => Object.assign((mutation, mutationArg, entityId) => {
6
+ const Co = CoTypedFactory();
7
+ return Co.GetState().then((current) => {
8
+ const entities = narrowing_k(current).entities;
9
+ if (!AsyncState.Operations.hasValue(entities.sync) ||
10
+ !entities.sync.value.get(entityId))
22
11
  return Co.Return("completed");
23
- return synchronizers[k][mutation](mutationArg)
24
- .embed(
25
- (_) => {
26
- const entities = narrowing_k(_).entities;
27
- if (AsyncState.Operations.hasValue(entities.sync)) {
28
- const entity = entities.sync.value.get(entityId);
29
- if (entity != undefined)
12
+ return synchronizers[k][mutation](mutationArg)
13
+ .embed((_) => {
14
+ const entities = narrowing_k(_).entities;
15
+ if (AsyncState.Operations.hasValue(entities.sync)) {
16
+ const entity = entities.sync.value.get(entityId);
17
+ if (entity != undefined)
30
18
  return Object.assign(Object.assign({}, _), entity);
31
- }
32
- return undefined;
33
- },
34
- Fun(Collection().Updaters.Core.entity.set(entityId)).then(
35
- widening_k,
36
- ),
37
- )
38
- .then((syncResult) =>
39
- Co.All(dependees).then((syncResults) =>
40
- Co.Return(
41
- [syncResult, ...syncResults].some(
42
- (_) => _ == "should be enqueued again",
43
- )
44
- ? "should be enqueued again"
45
- : "completed",
46
- ),
47
- ),
48
- );
49
- });
50
- },
51
- {
52
- add: (entityId, entity, position) => {
53
- const Co = CoTypedFactory();
54
- const CoColl = CoTypedFactory();
55
- return CoColl.SetState((_) => {
19
+ }
20
+ return undefined;
21
+ }, Fun(Collection().Updaters.Core.entity.set(entityId)).then(widening_k))
22
+ .then((syncResult) => Co.All(dependees).then((syncResults) => Co.Return([syncResult, ...syncResults].some((_) => _ == "should be enqueued again")
23
+ ? "should be enqueued again"
24
+ : "completed")));
25
+ });
26
+ }, {
27
+ add: (entityId, entity, position) => {
28
+ const Co = CoTypedFactory();
29
+ const CoColl = CoTypedFactory();
30
+ return CoColl.SetState((_) => {
56
31
  // alert("state set?!?")
57
32
  // return Collection<Collections[k]>().Updaters.Core.entity.add([entityId, entity, position ?? { kind: "at the end" }])(_)
58
33
  return _;
59
- })
60
- .embed(
61
- (_) => Object.assign(Object.assign({}, _), narrowing_k(_)),
62
- widening_k,
63
- )
64
- .then(() =>
65
- synchronizers[k]
66
- .add(entity)
67
- .embed(
68
- (_) => {
69
- const entities = narrowing_k(_).entities;
70
- if (AsyncState.Operations.hasValue(entities.sync)) {
71
- const entity = entities.sync.value.get(entityId);
72
- if (entity != undefined)
73
- return Object.assign(Object.assign({}, _), entity);
74
- }
75
- return undefined;
76
- },
77
- Fun(Collection().Updaters.Core.entity.set(entityId)).then(
78
- widening_k,
79
- ),
80
- )
81
- // )
82
- // .then(_ =>
83
- // CoColl.GetState().then(current => {
84
- // if (!AsyncState.Operations.hasValue(current.entities.sync)) return CoColl.Return(unit)
85
- // const syncedEntity = current.entities.sync.value.get(entityId)
86
- // if (!syncedEntity || !AsyncState.Operations.hasValue(syncedEntity.value.value.sync)) return CoColl.Return(unit)
87
- // if (id(syncedEntity.value.value.sync.value) == entityId) return CoColl.Return(unit)
88
- // // otherwise, the id has changed (probably overridden by the API), let's save the new id
89
- // return CoColl.SetState(
90
- // Collection<Collections[k]>().Updaters.Core.entity.add([id(syncedEntity.value.value.sync.value), syncedEntity, position ?? { kind:"at the end" }]).then(
91
- // Collection<Collections[k]>().Updaters.Core.entity.remove(entityId)
92
- // )
93
- // )
94
- // }
95
- // )
96
- // .embed<Context & SynchronizedEntities, SynchronizedEntities>(_ => ({ ..._, ...(narrowing_k(_)) }), widening_k)
97
- .then((syncResult) =>
98
- Co.All(dependees).then((syncResults) =>
99
- Co.Return(
100
- [syncResult, ...syncResults].some(
101
- (_) => _ == "should be enqueued again",
102
- )
103
- ? "should be enqueued again"
104
- : "completed",
105
- ),
106
- ),
107
- ),
108
- );
109
- },
110
- remove: (entityId) => {
111
- const Co = CoTypedFactory();
112
- const CoColl = CoTypedFactory();
113
- return CoColl.SetState(
114
- // Collection<Collections[k]>().Updaters.Core.entity.remove(entityId)
115
- Collection().Updaters.Core.removed(entityId, replaceWith(true)),
116
- )
117
- .embed(
118
- (_) => Object.assign(Object.assign({}, _), narrowing_k(_)),
119
- widening_k,
120
- )
121
- .then(() =>
122
- synchronizers[k].remove(entityId).embed(
123
- (_) => {
124
- const entities = narrowing_k(_).entities;
125
- if (AsyncState.Operations.hasValue(entities.sync)) {
126
- const entity = entities.sync.value.get(entityId);
127
- if (entity != undefined)
128
- return Object.assign(Object.assign({}, _), entity);
129
- }
130
- return undefined;
131
- },
132
- Fun(Collection().Updaters.Core.entity.set(entityId)).then(
133
- widening_k,
134
- ),
135
- ),
136
- )
137
- .then((_) =>
138
- Co.GetState().then((current) => {
139
- const entities = narrowing_k(current).entities;
140
- if (!AsyncState.Operations.hasValue(entities.sync))
141
- return Co.Return("completed");
34
+ })
35
+ .embed((_) => (Object.assign(Object.assign({}, _), narrowing_k(_))), widening_k)
36
+ .then(() => synchronizers[k]
37
+ .add(entity)
38
+ .embed((_) => {
39
+ const entities = narrowing_k(_).entities;
40
+ if (AsyncState.Operations.hasValue(entities.sync)) {
142
41
  const entity = entities.sync.value.get(entityId);
143
- if (!entity || entity.value.sync.kind == "error")
144
- return Co.Return("completed");
145
- return Co.All(dependees).then((syncResults) =>
146
- Co.Return(
147
- syncResults.some((_) => _ == "should be enqueued again")
148
- ? "should be enqueued again"
149
- : "completed",
150
- ),
151
- );
152
- }),
153
- );
154
- },
155
- wholeMutations: (mutation, mutationArg) => {
156
- const Co = CoTypedFactory();
157
- const CoColl = CoTypedFactory();
158
- return CoColl.Seq([
159
- synchronizers[k]["wholeMutations"]
160
- [mutation](mutationArg)
161
- .embed(
162
- (_) => Object.assign(Object.assign({}, _), _.entities),
163
- Collection().Updaters.Core.entities,
164
- ),
165
- ])
166
- .embed(
167
- (_) => Object.assign(Object.assign({}, _), narrowing_k(_)),
168
- widening_k,
169
- )
170
- .then((syncResult) =>
171
- Co.All(dependees).then((syncResults) =>
172
- Co.Return(
173
- [syncResult, ...syncResults].some(
174
- (_) => _ == "should be enqueued again",
175
- )
176
- ? "should be enqueued again"
177
- : "completed",
178
- ),
179
- ),
180
- );
181
- },
182
- },
183
- );
184
- export const collectionDirtySetter =
185
- () => (k, narrowing_k, widening_k) => (entityId, dirtyStatus) => {
42
+ if (entity != undefined)
43
+ return Object.assign(Object.assign({}, _), entity);
44
+ }
45
+ return undefined;
46
+ }, Fun(Collection().Updaters.Core.entity.set(entityId)).then(widening_k))
47
+ // )
48
+ // .then(_ =>
49
+ // CoColl.GetState().then(current => {
50
+ // if (!AsyncState.Operations.hasValue(current.entities.sync)) return CoColl.Return(unit)
51
+ // const syncedEntity = current.entities.sync.value.get(entityId)
52
+ // if (!syncedEntity || !AsyncState.Operations.hasValue(syncedEntity.value.value.sync)) return CoColl.Return(unit)
53
+ // if (id(syncedEntity.value.value.sync.value) == entityId) return CoColl.Return(unit)
54
+ // // otherwise, the id has changed (probably overridden by the API), let's save the new id
55
+ // return CoColl.SetState(
56
+ // Collection<Collections[k]>().Updaters.Core.entity.add([id(syncedEntity.value.value.sync.value), syncedEntity, position ?? { kind:"at the end" }]).then(
57
+ // Collection<Collections[k]>().Updaters.Core.entity.remove(entityId)
58
+ // )
59
+ // )
60
+ // }
61
+ // )
62
+ // .embed<Context & SynchronizedEntities, SynchronizedEntities>(_ => ({ ..._, ...(narrowing_k(_)) }), widening_k)
63
+ .then((syncResult) => Co.All(dependees).then((syncResults) => Co.Return([syncResult, ...syncResults].some((_) => _ == "should be enqueued again")
64
+ ? "should be enqueued again"
65
+ : "completed"))));
66
+ },
67
+ remove: (entityId) => {
68
+ const Co = CoTypedFactory();
69
+ const CoColl = CoTypedFactory();
70
+ return CoColl.SetState(
71
+ // Collection<Collections[k]>().Updaters.Core.entity.remove(entityId)
72
+ Collection().Updaters.Core.removed(entityId, replaceWith(true)))
73
+ .embed((_) => (Object.assign(Object.assign({}, _), narrowing_k(_))), widening_k)
74
+ .then(() => synchronizers[k]
75
+ .remove(entityId)
76
+ .embed((_) => {
77
+ const entities = narrowing_k(_).entities;
78
+ if (AsyncState.Operations.hasValue(entities.sync)) {
79
+ const entity = entities.sync.value.get(entityId);
80
+ if (entity != undefined)
81
+ return Object.assign(Object.assign({}, _), entity);
82
+ }
83
+ return undefined;
84
+ }, Fun(Collection().Updaters.Core.entity.set(entityId)).then(widening_k)))
85
+ .then((_) => Co.GetState().then((current) => {
86
+ const entities = narrowing_k(current).entities;
87
+ if (!AsyncState.Operations.hasValue(entities.sync))
88
+ return Co.Return("completed");
89
+ const entity = entities.sync.value.get(entityId);
90
+ if (!entity || entity.value.sync.kind == "error")
91
+ return Co.Return("completed");
92
+ return Co.All(dependees).then((syncResults) => Co.Return(syncResults.some((_) => _ == "should be enqueued again")
93
+ ? "should be enqueued again"
94
+ : "completed"));
95
+ }));
96
+ },
97
+ wholeMutations: (mutation, mutationArg) => {
98
+ const Co = CoTypedFactory();
99
+ const CoColl = CoTypedFactory();
100
+ return CoColl.Seq([
101
+ synchronizers[k]["wholeMutations"][mutation](mutationArg)
102
+ .embed((_) => (Object.assign(Object.assign({}, _), _.entities)), Collection().Updaters.Core.entities),
103
+ ])
104
+ .embed((_) => (Object.assign(Object.assign({}, _), narrowing_k(_))), widening_k)
105
+ .then((syncResult) => Co.All(dependees).then((syncResults) => Co.Return([syncResult, ...syncResults].some((_) => _ == "should be enqueued again")
106
+ ? "should be enqueued again"
107
+ : "completed")));
108
+ },
109
+ });
110
+ export const collectionDirtySetter = () => (k, narrowing_k, widening_k) => (entityId, dirtyStatus) => {
186
111
  const CoEntity = CoTypedFactory();
187
112
  const Co = CoTypedFactory();
188
- return CoEntity.SetState(
189
- CollectionEntity().Updaters.Core.entity(
190
- Entity().Updaters.Core.value(
191
- Debounced.Updaters.Core.dirty(replaceWith(dirtyStatus)),
192
- ),
193
- ),
194
- ).embed(
195
- (_) => {
113
+ return CoEntity.SetState(CollectionEntity().Updaters.Core.entity(Entity().Updaters.Core.value(Debounced.Updaters.Core.dirty(replaceWith(dirtyStatus))))).embed((_) => {
196
114
  const _narrowed = narrowing_k(_);
197
115
  const entities = _narrowed.entities;
198
116
  if (AsyncState.Operations.hasValue(entities.sync)) {
199
- const entity = entities.sync.value.get(entityId);
200
- if (entity != undefined)
201
- return Object.assign(Object.assign({}, _), entity);
117
+ const entity = entities.sync.value.get(entityId);
118
+ if (entity != undefined)
119
+ return Object.assign(Object.assign({}, _), entity);
202
120
  }
203
121
  return undefined;
204
- },
205
- Fun(Collection().Updaters.Core.entity.set(entityId)).then(widening_k),
206
- );
207
- };
208
- export const collectionCheckNotDirty =
209
- () =>
210
- ([id, e]) => {
122
+ }, Fun(Collection().Updaters.Core.entity.set(entityId)).then(widening_k));
123
+ };
124
+ export const collectionCheckNotDirty = () => ([id, e]) => {
211
125
  var _a;
212
- return (
213
- AsyncState.Operations.hasValue(e.entities.sync) &&
214
- ((_a = e.entities.sync.value.get(id)) === null || _a === void 0
215
- ? void 0
216
- : _a.value.dirty) != "not dirty"
217
- );
218
- };
219
- export const collectionEntityUpdater = () => (widening_k) =>
220
- Fun(([id, u]) =>
221
- widening_k(Collection().Updaters.Template.entityValue(id, u)),
222
- );
126
+ return (AsyncState.Operations.hasValue(e.entities.sync) &&
127
+ ((_a = e.entities.sync.value.get(id)) === null || _a === void 0 ? void 0 : _a.value.dirty) != "not dirty");
128
+ };
129
+ export const collectionEntityUpdater = () => (widening_k) => Fun(([id, u]) => widening_k(Collection().Updaters.Template.entityValue(id, u)));
223
130
  export const withTrivialComparator = (_) => [_, (_) => "=="];
224
131
  export const collectionSynchronizationContext = (entityDescriptors) => {
225
- let synchronizers = {};
226
- Object.keys(entityDescriptors).forEach((k_s) => {
227
- const k = k_s;
228
- synchronizers[k] = {};
229
- Object.keys(entityDescriptors[k]).forEach((field) => {
230
- // only update the mutation fields of the entity descriptor
231
- if (
232
- field != "entityName" &&
233
- field != "narrowing" &&
234
- field != "widening" &&
235
- field != "dependees" &&
236
- field != "add" &&
237
- field != "remove" &&
238
- field != "default" &&
239
- field != "reload" &&
240
- field != "reloadElement"
241
- )
242
- synchronizers[k][field] = (mutationArg) => {
243
- return insideEntitySynchronizedAndDebounced(
244
- entityDescriptors[k][field](mutationArg),
245
- );
246
- };
132
+ let synchronizers = {};
133
+ Object.keys(entityDescriptors).forEach((k_s) => {
134
+ const k = k_s;
135
+ synchronizers[k] = {};
136
+ Object.keys(entityDescriptors[k]).forEach((field) => {
137
+ // only update the mutation fields of the entity descriptor
138
+ if (field != "entityName" &&
139
+ field != "narrowing" &&
140
+ field != "widening" &&
141
+ field != "dependees" &&
142
+ field != "add" &&
143
+ field != "remove" &&
144
+ field != "default" &&
145
+ field != "reload" &&
146
+ field != "reloadElement")
147
+ synchronizers[k][field] = (mutationArg) => {
148
+ return insideEntitySynchronizedAndDebounced(entityDescriptors[k][field](mutationArg));
149
+ };
150
+ });
151
+ synchronizers[k]["add"] = (entity, position) => insideEntitySynchronizedAndDebounced(entityDescriptors[k]["add"](entity, position));
152
+ synchronizers[k]["remove"] = (entityId) => insideEntitySynchronizedAndDebounced(entityDescriptors[k]["remove"](entityId));
153
+ synchronizers[k]["wholeMutations"] = {};
154
+ Object.keys(entityDescriptors[k]["wholeMutations"]).forEach((field) => {
155
+ synchronizers[k]["wholeMutations"][field] = (mutationArg) => entityDescriptors[k]["wholeMutations"][field](mutationArg);
156
+ });
247
157
  });
248
- synchronizers[k]["add"] = (entity, position) =>
249
- insideEntitySynchronizedAndDebounced(
250
- entityDescriptors[k]["add"](entity, position),
251
- );
252
- synchronizers[k]["remove"] = (entityId) =>
253
- insideEntitySynchronizedAndDebounced(
254
- entityDescriptors[k]["remove"](entityId),
255
- );
256
- synchronizers[k]["wholeMutations"] = {};
257
- Object.keys(entityDescriptors[k]["wholeMutations"]).forEach((field) => {
258
- synchronizers[k]["wholeMutations"][field] = (mutationArg) =>
259
- entityDescriptors[k]["wholeMutations"][field](mutationArg);
158
+ const loaders = {};
159
+ Object.keys(entityDescriptors).forEach((k_s) => {
160
+ const k = k_s;
161
+ loaders[k] = collectionEntityLoader(synchronizers)(k, entityDescriptors[k].id, entityDescriptors[k].narrowing, entityDescriptors[k].widening, entityDescriptors[k].dependees);
260
162
  });
261
- });
262
- const loaders = {};
263
- Object.keys(entityDescriptors).forEach((k_s) => {
264
- const k = k_s;
265
- loaders[k] = collectionEntityLoader(synchronizers)(
266
- k,
267
- entityDescriptors[k].id,
268
- entityDescriptors[k].narrowing,
269
- entityDescriptors[k].widening,
270
- entityDescriptors[k].dependees,
271
- );
272
- });
273
- const dirtyCheckers = {};
274
- Object.keys(entityDescriptors).forEach((k_s) => {
275
- const k = k_s;
276
- dirtyCheckers[k] = Fun(collectionCheckNotDirty());
277
- });
278
- const dirtySetters = {};
279
- Object.keys(entityDescriptors).forEach((k_s) => {
280
- const k = k_s;
281
- dirtySetters[k] = collectionDirtySetter()(
282
- k,
283
- entityDescriptors[k].narrowing,
284
- entityDescriptors[k].widening,
285
- );
286
- });
287
- const updaters = {};
288
- Object.keys(entityDescriptors).forEach((k_s) => {
289
- const k = k_s;
290
- updaters[k] = collectionEntityUpdater()(entityDescriptors[k].widening);
291
- });
292
- const mutationComparators = {};
293
- Object.keys(entityDescriptors).forEach((k_s) => {
294
- const k = k_s;
295
- mutationComparators[k] = {};
296
- Object.keys(entityDescriptors[k]).forEach((field) => {
297
- if (
298
- field != "entityName" &&
299
- field != "narrowing" &&
300
- field != "widening" &&
301
- field != "dependees" &&
302
- field != "add" &&
303
- field != "remove" &&
304
- field != "default" &&
305
- field != "reload"
306
- )
307
- mutationComparators[k][field] = entityDescriptors[k][field][1];
163
+ const dirtyCheckers = {};
164
+ Object.keys(entityDescriptors).forEach((k_s) => {
165
+ const k = k_s;
166
+ dirtyCheckers[k] = Fun(collectionCheckNotDirty());
308
167
  });
309
- });
310
- const wholeMutationComparators = {};
311
- Object.keys(entityDescriptors).forEach((k_s) => {
312
- const k = k_s;
313
- wholeMutationComparators[k] = {};
314
- Object.keys(entityDescriptors[k]).forEach((field) => {
315
- if (
316
- field != "entityName" &&
317
- field != "narrowing" &&
318
- field != "widening" &&
319
- field != "dependees" &&
320
- field != "add" &&
321
- field != "remove" &&
322
- field != "default" &&
323
- field != "reload"
324
- )
325
- wholeMutationComparators[k][field] = entityDescriptors[k][field][1];
168
+ const dirtySetters = {};
169
+ Object.keys(entityDescriptors).forEach((k_s) => {
170
+ const k = k_s;
171
+ dirtySetters[k] = collectionDirtySetter()(k, entityDescriptors[k].narrowing, entityDescriptors[k].widening);
172
+ });
173
+ const updaters = {};
174
+ Object.keys(entityDescriptors).forEach((k_s) => {
175
+ const k = k_s;
176
+ updaters[k] = collectionEntityUpdater()(entityDescriptors[k].widening);
177
+ });
178
+ const mutationComparators = {};
179
+ Object.keys(entityDescriptors).forEach((k_s) => {
180
+ const k = k_s;
181
+ mutationComparators[k] = {};
182
+ Object.keys(entityDescriptors[k]).forEach((field) => {
183
+ if (field != "entityName" &&
184
+ field != "narrowing" &&
185
+ field != "widening" &&
186
+ field != "dependees" &&
187
+ field != "add" &&
188
+ field != "remove" &&
189
+ field != "default" &&
190
+ field != "reload")
191
+ mutationComparators[k][field] = entityDescriptors[k][field][1];
192
+ });
193
+ });
194
+ const wholeMutationComparators = {};
195
+ Object.keys(entityDescriptors).forEach((k_s) => {
196
+ const k = k_s;
197
+ wholeMutationComparators[k] = {};
198
+ Object.keys(entityDescriptors[k]).forEach((field) => {
199
+ if (field != "entityName" &&
200
+ field != "narrowing" &&
201
+ field != "widening" &&
202
+ field != "dependees" &&
203
+ field != "add" &&
204
+ field != "remove" &&
205
+ field != "default" &&
206
+ field != "reload")
207
+ wholeMutationComparators[k][field] = entityDescriptors[k][field][1];
208
+ });
326
209
  });
327
- });
328
- return [
329
- loaders,
330
- dirtyCheckers,
331
- dirtySetters,
332
- updaters,
333
- entityDescriptors,
334
- mutationComparators,
335
- wholeMutationComparators,
336
- ];
210
+ return [
211
+ loaders,
212
+ dirtyCheckers,
213
+ dirtySetters,
214
+ updaters,
215
+ entityDescriptors,
216
+ mutationComparators,
217
+ wholeMutationComparators,
218
+ ];
337
219
  };
338
- //# sourceMappingURL=synchronizers.js.map
220
+ //# sourceMappingURL=synchronizers.js.map