@coolon/angular-ui-powerups 0.0.126 → 0.0.128

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 (350) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +3753 -3020
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  5. package/coolon-angular-ui-powerups.d.ts +17 -18
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/coolon-angular-ui-powerups.js +16 -17
  8. package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
  9. package/esm2015/coolon-angular-ui-powerups.metadata.json +1 -1
  10. package/esm2015/index.js +1 -1
  11. package/esm2015/index.js.map +1 -1
  12. package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  13. package/esm2015/lib/interaction/abstract-interaction-context.js +104 -0
  14. package/esm2015/lib/interaction/abstract-interaction-context.js.map +1 -0
  15. package/esm2015/lib/interaction/abstract-interaction-context.metadata.json +1 -0
  16. package/esm2015/lib/interaction/activity-ref.js +123 -0
  17. package/esm2015/lib/interaction/activity-ref.js.map +1 -0
  18. package/esm2015/lib/interaction/activity-ref.metadata.json +1 -0
  19. package/esm2015/lib/interaction/activity.js +21 -1
  20. package/esm2015/lib/interaction/activity.js.map +1 -1
  21. package/esm2015/lib/interaction/activity.metadata.json +1 -1
  22. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +199 -230
  23. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  24. package/esm2015/lib/interaction/components/activity-container/activity-container.component.metadata.json +1 -1
  25. package/esm2015/lib/interaction/components/{activity-outlet → activity-container/activity-outlet}/activity-outlet.component.js +24 -31
  26. package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -0
  27. package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.metadata.json +1 -0
  28. package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.ngfactory.js.map +1 -0
  29. package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.scss.shim.ngstyle.js.map +1 -0
  30. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +2 -3
  31. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js.map +1 -1
  32. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.metadata.json +1 -1
  33. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +4 -11
  34. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js.map +1 -1
  35. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.metadata.json +1 -1
  36. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +2 -3
  37. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js.map +1 -1
  38. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.metadata.json +1 -1
  39. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +113 -0
  40. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -0
  41. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.metadata.json +1 -0
  42. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.ngfactory.js.map +1 -0
  43. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
  44. package/esm2015/lib/interaction/index.js +7 -6
  45. package/esm2015/lib/interaction/index.js.map +1 -1
  46. package/esm2015/lib/interaction/index.metadata.json +1 -1
  47. package/esm2015/lib/interaction/interaction-context.js +12 -67
  48. package/esm2015/lib/interaction/interaction-context.js.map +1 -1
  49. package/esm2015/lib/interaction/interaction-context.metadata.json +1 -1
  50. package/esm2015/lib/interaction/interaction.module.js +4 -4
  51. package/esm2015/lib/interaction/interaction.module.js.map +1 -1
  52. package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
  53. package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  54. package/esm2015/lib/interaction/route-synchronisation-adapter.js +17 -0
  55. package/esm2015/lib/interaction/route-synchronisation-adapter.js.map +1 -0
  56. package/esm2015/lib/interaction/route-synchronisation-adapter.metadata.json +1 -0
  57. package/esm2015/lib/interaction/services/interaction-service-routing-adapter.js +72 -0
  58. package/esm2015/lib/interaction/services/interaction-service-routing-adapter.js.map +1 -0
  59. package/esm2015/lib/interaction/services/interaction-service-routing-adapter.metadata.json +1 -0
  60. package/esm2015/lib/interaction/services/interaction.service.js +174 -104
  61. package/esm2015/lib/interaction/services/interaction.service.js.map +1 -1
  62. package/esm2015/lib/interaction/services/interaction.service.metadata.json +1 -1
  63. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +4 -2
  64. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js.map +1 -1
  65. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.metadata.json +1 -1
  66. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +79 -87
  67. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js.map +1 -1
  68. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.metadata.json +1 -1
  69. package/esm2015/lib/interaction/services/modal-interaction-context.factory.js +3 -1
  70. package/esm2015/lib/interaction/services/modal-interaction-context.factory.js.map +1 -1
  71. package/esm2015/lib/place/components/abstract-place-navigation.component.js +27 -6
  72. package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  73. package/esm2015/lib/place/components/abstract-place-navigation.component.metadata.json +1 -1
  74. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +9 -3
  75. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
  76. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.metadata.json +1 -1
  77. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +98 -110
  78. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  79. package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
  80. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +9 -3
  81. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
  82. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.metadata.json +1 -1
  83. package/esm2015/lib/place/guards/place.guard.js +14 -13
  84. package/esm2015/lib/place/guards/place.guard.js.map +1 -1
  85. package/esm2015/lib/place/guards/place.guard.metadata.json +1 -1
  86. package/esm2015/lib/place/index.js +15 -2
  87. package/esm2015/lib/place/index.js.map +1 -1
  88. package/esm2015/lib/place/index.metadata.json +1 -1
  89. package/esm2015/lib/place/{guards → navigation}/place-component-deactivation-handler.js +28 -22
  90. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -0
  91. package/esm2015/lib/place/navigation/place-component-deactivation-handler.metadata.json +1 -0
  92. package/esm2015/lib/place/navigation/session/abstract-pop-state-navigation.js +37 -0
  93. package/esm2015/lib/place/navigation/session/abstract-pop-state-navigation.js.map +1 -0
  94. package/esm2015/lib/place/navigation/session/abstract-pop-state-navigation.metadata.json +1 -0
  95. package/esm2015/lib/place/navigation/session/event-cleanup/event-clean-up-session.js +19 -0
  96. package/esm2015/lib/place/navigation/session/event-cleanup/event-clean-up-session.js.map +1 -0
  97. package/esm2015/lib/place/navigation/session/event-cleanup/event-clean-up-session.metadata.json +1 -0
  98. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js +95 -0
  99. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js.map +1 -0
  100. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.metadata.json +1 -0
  101. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js +132 -0
  102. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js.map +1 -0
  103. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.metadata.json +1 -0
  104. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js +123 -0
  105. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js.map +1 -0
  106. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.metadata.json +1 -0
  107. package/esm2015/lib/place/navigation/session/interactions/navigating-during-interaction.js +62 -0
  108. package/esm2015/lib/place/navigation/session/interactions/navigating-during-interaction.js.map +1 -0
  109. package/esm2015/lib/place/navigation/session/interactions/navigating-during-interaction.metadata.json +1 -0
  110. package/esm2015/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js +48 -0
  111. package/esm2015/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js.map +1 -0
  112. package/esm2015/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.metadata.json +1 -0
  113. package/esm2015/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js +104 -0
  114. package/esm2015/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js.map +1 -0
  115. package/esm2015/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.metadata.json +1 -0
  116. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js +141 -0
  117. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -0
  118. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.metadata.json +1 -0
  119. package/esm2015/lib/place/navigation/session/navigating.js +54 -0
  120. package/esm2015/lib/place/navigation/session/navigating.js.map +1 -0
  121. package/esm2015/lib/place/navigation/session/navigating.metadata.json +1 -0
  122. package/esm2015/lib/place/navigation/session/navigation-context.js +38 -0
  123. package/esm2015/lib/place/navigation/session/navigation-context.js.map +1 -0
  124. package/esm2015/lib/place/navigation/session/navigation-context.metadata.json +1 -0
  125. package/esm2015/lib/place/navigation/session/navigation-session.js +326 -0
  126. package/esm2015/lib/place/navigation/session/navigation-session.js.map +1 -0
  127. package/esm2015/lib/place/navigation/session/navigation-session.metadata.json +1 -0
  128. package/esm2015/lib/place/navigation/session/pop-state-navigation.js +31 -0
  129. package/esm2015/lib/place/navigation/session/pop-state-navigation.js.map +1 -0
  130. package/esm2015/lib/place/navigation/session/pop-state-navigation.metadata.json +1 -0
  131. package/esm2015/lib/place/place-component.js +46 -15
  132. package/esm2015/lib/place/place-component.js.map +1 -1
  133. package/esm2015/lib/place/place-component.metadata.json +1 -1
  134. package/esm2015/lib/place/place-router.js +314 -309
  135. package/esm2015/lib/place/place-router.js.map +1 -1
  136. package/esm2015/lib/place/place-router.metadata.json +1 -1
  137. package/esm2015/lib/place/place.module.js.map +1 -1
  138. package/esm2015/lib/place/place.module.metadata.json +1 -1
  139. package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
  140. package/esm2015/lib/place/route/parameter-decorators.js +1 -0
  141. package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
  142. package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
  143. package/esm2015/lib/place/url-service.js +126 -0
  144. package/esm2015/lib/place/url-service.js.map +1 -0
  145. package/esm2015/lib/place/url-service.metadata.json +1 -0
  146. package/esm2015/lib/place/url-service.ngfactory.js.map +1 -0
  147. package/esm2015/lib/place/url-snapshot.js +15 -1
  148. package/esm2015/lib/place/url-snapshot.js.map +1 -1
  149. package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
  150. package/esm2015/lib/place/visit.js +10 -0
  151. package/esm2015/lib/place/visit.js.map +1 -1
  152. package/esm2015/lib/place/visit.metadata.json +1 -1
  153. package/esm2015/public_api.js +2 -2
  154. package/esm2015/public_api.js.map +1 -1
  155. package/esm5/coolon-angular-ui-powerups.js +16 -17
  156. package/esm5/coolon-angular-ui-powerups.js.map +1 -1
  157. package/esm5/index.js +1 -1
  158. package/esm5/index.js.map +1 -1
  159. package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  160. package/esm5/lib/interaction/abstract-interaction-context.js +146 -0
  161. package/esm5/lib/interaction/abstract-interaction-context.js.map +1 -0
  162. package/esm5/lib/interaction/activity-ref.js +153 -0
  163. package/esm5/lib/interaction/activity-ref.js.map +1 -0
  164. package/esm5/lib/interaction/activity.js +29 -1
  165. package/esm5/lib/interaction/activity.js.map +1 -1
  166. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +273 -265
  167. package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  168. package/esm5/lib/interaction/components/{activity-outlet → activity-container/activity-outlet}/activity-outlet.component.js +25 -32
  169. package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -0
  170. package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.ngfactory.js.map +1 -0
  171. package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.scss.shim.ngstyle.js.map +1 -0
  172. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +2 -3
  173. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js.map +1 -1
  174. package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +4 -10
  175. package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js.map +1 -1
  176. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +2 -3
  177. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js.map +1 -1
  178. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +158 -0
  179. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -0
  180. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.ngfactory.js.map +1 -0
  181. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
  182. package/esm5/lib/interaction/index.js +7 -6
  183. package/esm5/lib/interaction/index.js.map +1 -1
  184. package/esm5/lib/interaction/interaction-context.js +12 -106
  185. package/esm5/lib/interaction/interaction-context.js.map +1 -1
  186. package/esm5/lib/interaction/interaction.module.js +4 -4
  187. package/esm5/lib/interaction/interaction.module.js.map +1 -1
  188. package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  189. package/esm5/lib/interaction/route-synchronisation-adapter.js +17 -0
  190. package/esm5/lib/interaction/route-synchronisation-adapter.js.map +1 -0
  191. package/esm5/lib/interaction/services/interaction-service-routing-adapter.js +98 -0
  192. package/esm5/lib/interaction/services/interaction-service-routing-adapter.js.map +1 -0
  193. package/esm5/lib/interaction/services/interaction.service.js +243 -117
  194. package/esm5/lib/interaction/services/interaction.service.js.map +1 -1
  195. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +6 -2
  196. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js.map +1 -1
  197. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +96 -107
  198. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js.map +1 -1
  199. package/esm5/lib/interaction/services/modal-interaction-context.factory.js +3 -1
  200. package/esm5/lib/interaction/services/modal-interaction-context.factory.js.map +1 -1
  201. package/esm5/lib/place/components/abstract-place-navigation.component.js +24 -6
  202. package/esm5/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  203. package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js +6 -3
  204. package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
  205. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +130 -129
  206. package/esm5/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  207. package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +6 -3
  208. package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
  209. package/esm5/lib/place/guards/place.guard.js +17 -13
  210. package/esm5/lib/place/guards/place.guard.js.map +1 -1
  211. package/esm5/lib/place/index.js +15 -2
  212. package/esm5/lib/place/index.js.map +1 -1
  213. package/esm5/lib/place/{guards → navigation}/place-component-deactivation-handler.js +45 -21
  214. package/esm5/lib/place/navigation/place-component-deactivation-handler.js.map +1 -0
  215. package/esm5/lib/place/navigation/session/abstract-pop-state-navigation.js +49 -0
  216. package/esm5/lib/place/navigation/session/abstract-pop-state-navigation.js.map +1 -0
  217. package/esm5/lib/place/navigation/session/event-cleanup/event-clean-up-session.js +36 -0
  218. package/esm5/lib/place/navigation/session/event-cleanup/event-clean-up-session.js.map +1 -0
  219. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js +151 -0
  220. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js.map +1 -0
  221. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js +221 -0
  222. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js.map +1 -0
  223. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js +186 -0
  224. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js.map +1 -0
  225. package/esm5/lib/place/navigation/session/interactions/navigating-during-interaction.js +107 -0
  226. package/esm5/lib/place/navigation/session/interactions/navigating-during-interaction.js.map +1 -0
  227. package/esm5/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js +77 -0
  228. package/esm5/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js.map +1 -0
  229. package/esm5/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js +167 -0
  230. package/esm5/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js.map +1 -0
  231. package/esm5/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js +185 -0
  232. package/esm5/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -0
  233. package/esm5/lib/place/navigation/session/navigating.js +75 -0
  234. package/esm5/lib/place/navigation/session/navigating.js.map +1 -0
  235. package/esm5/lib/place/navigation/session/navigation-context.js +32 -0
  236. package/esm5/lib/place/navigation/session/navigation-context.js.map +1 -0
  237. package/esm5/lib/place/navigation/session/navigation-session.js +450 -0
  238. package/esm5/lib/place/navigation/session/navigation-session.js.map +1 -0
  239. package/esm5/lib/place/navigation/session/pop-state-navigation.js +50 -0
  240. package/esm5/lib/place/navigation/session/pop-state-navigation.js.map +1 -0
  241. package/esm5/lib/place/place-component.js +61 -17
  242. package/esm5/lib/place/place-component.js.map +1 -1
  243. package/esm5/lib/place/place-router.js +414 -401
  244. package/esm5/lib/place/place-router.js.map +1 -1
  245. package/esm5/lib/place/place.module.js.map +1 -1
  246. package/esm5/lib/place/place.module.ngfactory.js.map +1 -1
  247. package/esm5/lib/place/route/parameter-decorators.js +1 -0
  248. package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
  249. package/esm5/lib/place/url-service.js +176 -0
  250. package/esm5/lib/place/url-service.js.map +1 -0
  251. package/esm5/lib/place/url-service.ngfactory.js.map +1 -0
  252. package/esm5/lib/place/url-snapshot.js +22 -1
  253. package/esm5/lib/place/url-snapshot.js.map +1 -1
  254. package/esm5/lib/place/visit.js +14 -0
  255. package/esm5/lib/place/visit.js.map +1 -1
  256. package/esm5/public_api.js +2 -2
  257. package/esm5/public_api.js.map +1 -1
  258. package/fesm2015/coolon-angular-ui-powerups.js +2644 -2266
  259. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  260. package/fesm5/coolon-angular-ui-powerups.js +3703 -2982
  261. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  262. package/lib/interaction/abstract-interaction-context.d.ts +24 -0
  263. package/lib/interaction/activity-ref.d.ts +19 -0
  264. package/lib/interaction/activity.d.ts +5 -1
  265. package/lib/interaction/components/activity-container/activity-container.component.d.ts +42 -43
  266. package/lib/interaction/components/{activity-outlet → activity-container/activity-outlet}/activity-outlet.component.d.ts +7 -10
  267. package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +2 -2
  268. package/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.d.ts +2 -5
  269. package/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.d.ts +2 -2
  270. package/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.d.ts +24 -0
  271. package/lib/interaction/index.d.ts +6 -5
  272. package/lib/interaction/interaction-context.d.ts +8 -29
  273. package/lib/interaction/route-synchronisation-adapter.d.ts +5 -0
  274. package/lib/interaction/services/interaction-service-routing-adapter.d.ts +15 -0
  275. package/lib/interaction/services/interaction.service.d.ts +52 -24
  276. package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.d.ts +2 -1
  277. package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.d.ts +15 -12
  278. package/lib/interaction/services/modal-interaction-context.factory.d.ts +2 -1
  279. package/lib/place/components/abstract-place-navigation.component.d.ts +5 -3
  280. package/lib/place/components/list-place-nav/list-place-nav.component.d.ts +2 -1
  281. package/lib/place/components/place-outlet/place-outlet.component.d.ts +9 -10
  282. package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +2 -1
  283. package/lib/place/guards/place.guard.d.ts +4 -3
  284. package/lib/place/index.d.ts +15 -2
  285. package/lib/place/navigation/place-component-deactivation-handler.d.ts +22 -0
  286. package/lib/place/navigation/session/abstract-pop-state-navigation.d.ts +9 -0
  287. package/lib/place/navigation/session/event-cleanup/event-clean-up-session.d.ts +4 -0
  288. package/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.d.ts +27 -0
  289. package/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.d.ts +43 -0
  290. package/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.d.ts +33 -0
  291. package/lib/place/navigation/session/interactions/navigating-during-interaction.d.ts +15 -0
  292. package/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.d.ts +17 -0
  293. package/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.d.ts +24 -0
  294. package/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.d.ts +15 -0
  295. package/lib/place/navigation/session/navigating.d.ts +11 -0
  296. package/lib/place/navigation/session/navigation-context.d.ts +28 -0
  297. package/lib/place/navigation/session/navigation-session.d.ts +51 -0
  298. package/lib/place/navigation/session/pop-state-navigation.d.ts +7 -0
  299. package/lib/place/place-component.d.ts +6 -3
  300. package/lib/place/place-router.d.ts +39 -35
  301. package/lib/place/url-service.d.ts +30 -0
  302. package/lib/place/url-snapshot.d.ts +3 -1
  303. package/lib/place/visit.d.ts +1 -0
  304. package/package.json +1 -1
  305. package/schematics/place-routes/templates/place-routes.ts.template +4 -3
  306. package/esm2015/lib/interaction/abstract-activity.js +0 -13
  307. package/esm2015/lib/interaction/abstract-activity.js.map +0 -1
  308. package/esm2015/lib/interaction/abstract-activity.metadata.json +0 -1
  309. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -21
  310. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js.map +0 -1
  311. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.metadata.json +0 -1
  312. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js.map +0 -1
  313. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.metadata.json +0 -1
  314. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.ngfactory.js.map +0 -1
  315. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.scss.shim.ngstyle.js.map +0 -1
  316. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +0 -102
  317. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js.map +0 -1
  318. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.metadata.json +0 -1
  319. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.ngfactory.js.map +0 -1
  320. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.scss.shim.ngstyle.js.map +0 -1
  321. package/esm2015/lib/interaction/interaction-context-base.js +0 -171
  322. package/esm2015/lib/interaction/interaction-context-base.js.map +0 -1
  323. package/esm2015/lib/interaction/interaction-context-base.metadata.json +0 -1
  324. package/esm2015/lib/place/guards/navigation-state.js +0 -1118
  325. package/esm2015/lib/place/guards/navigation-state.js.map +0 -1
  326. package/esm2015/lib/place/guards/navigation-state.metadata.json +0 -1
  327. package/esm2015/lib/place/guards/place-component-deactivation-handler.js.map +0 -1
  328. package/esm2015/lib/place/guards/place-component-deactivation-handler.metadata.json +0 -1
  329. package/esm5/lib/interaction/abstract-activity.js +0 -30
  330. package/esm5/lib/interaction/abstract-activity.js.map +0 -1
  331. package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -21
  332. package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js.map +0 -1
  333. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js.map +0 -1
  334. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.ngfactory.js.map +0 -1
  335. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.scss.shim.ngstyle.js.map +0 -1
  336. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +0 -119
  337. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js.map +0 -1
  338. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.ngfactory.js.map +0 -1
  339. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.scss.shim.ngstyle.js.map +0 -1
  340. package/esm5/lib/interaction/interaction-context-base.js +0 -228
  341. package/esm5/lib/interaction/interaction-context-base.js.map +0 -1
  342. package/esm5/lib/place/guards/navigation-state.js +0 -1491
  343. package/esm5/lib/place/guards/navigation-state.js.map +0 -1
  344. package/esm5/lib/place/guards/place-component-deactivation-handler.js.map +0 -1
  345. package/lib/interaction/abstract-activity.d.ts +0 -6
  346. package/lib/interaction/components/activity-outlet/activity-outlet-context.d.ts +0 -7
  347. package/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.d.ts +0 -17
  348. package/lib/interaction/interaction-context-base.d.ts +0 -29
  349. package/lib/place/guards/navigation-state.d.ts +0 -228
  350. package/lib/place/guards/place-component-deactivation-handler.d.ts +0 -15
@@ -0,0 +1,450 @@
1
+ /**
2
+ * @fileoverview added by tsickle
3
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
+ */
5
+ import * as tslib_1 from "tslib";
6
+ import { GarbageCollector, lang, Logger } from '@coolon/pectin';
7
+ import { PlaceComponentDeactivationHandler } from '../place-component-deactivation-handler';
8
+ /**
9
+ * Transient states
10
+ * @abstract
11
+ */
12
+ var /**
13
+ * Transient states
14
+ * @abstract
15
+ */
16
+ NavigationSession = /** @class */ (function (_super) {
17
+ tslib_1.__extends(NavigationSession, _super);
18
+ function NavigationSession(context, startingUrl) {
19
+ var _this = _super.call(this) || this;
20
+ _this.context = context;
21
+ _this.startingUrl = startingUrl;
22
+ _this.debugPropertyKeys = [];
23
+ _this._visits = new Map();
24
+ _this.componentDeactivationHandlers = new Map();
25
+ // TODO: can I get away without creating one every time?
26
+ _this._interactionContext = _this.context.routerInteractionAdapter.createExclusiveInteractionContext();
27
+ _this.onDispose((/**
28
+ * @return {?}
29
+ */
30
+ function () {
31
+ // the interaction context can be detached during the back button cancellation state transition
32
+ // as the transition is synchronous and activityCancellation isn't. Otherwise dispose will be
33
+ // called before the context has been cancelled. It might be work having the interaction context
34
+ // automatically cancel if the context is disposed so we don't have worry about detaching etc.
35
+ if (_this._interactionContext) {
36
+ _this._interactionContext.dispose(); // or do something like cancelAndDispose?
37
+ }
38
+ }));
39
+ return _this;
40
+ }
41
+ Object.defineProperty(NavigationSession.prototype, "name", {
42
+ get: /**
43
+ * @return {?}
44
+ */
45
+ function () {
46
+ return this.constructor.name;
47
+ },
48
+ enumerable: true,
49
+ configurable: true
50
+ });
51
+ Object.defineProperty(NavigationSession.prototype, "urlService", {
52
+ get: /**
53
+ * @return {?}
54
+ */
55
+ function () {
56
+ return this.context.urlService;
57
+ },
58
+ enumerable: true,
59
+ configurable: true
60
+ });
61
+ Object.defineProperty(NavigationSession.prototype, "interactionServiceAdapter", {
62
+ get: /**
63
+ * @return {?}
64
+ */
65
+ function () {
66
+ return this.context.routerInteractionAdapter;
67
+ },
68
+ enumerable: true,
69
+ configurable: true
70
+ });
71
+ /**
72
+ * @param {?} visit
73
+ * @return {?}
74
+ */
75
+ NavigationSession.prototype.storeVisit = /**
76
+ * @param {?} visit
77
+ * @return {?}
78
+ */
79
+ function (visit) {
80
+ // console.log(`Storing visit for ${visit.placeDefinition.component.name}`, {visit});
81
+ this._visits.set(visit.placeDefinition, visit);
82
+ };
83
+ /**
84
+ * @param {?} placeDef
85
+ * @return {?}
86
+ */
87
+ NavigationSession.prototype.getVisitFor = /**
88
+ * @param {?} placeDef
89
+ * @return {?}
90
+ */
91
+ function (placeDef) {
92
+ /** @type {?} */
93
+ var visit = this._visits.get(placeDef);
94
+ // console.log(`Getting visit for ${placeDef.component.name}`, {visit});
95
+ return visit;
96
+ };
97
+ Object.defineProperty(NavigationSession.prototype, "canDeactivateInteractionContext", {
98
+ get: /**
99
+ * @return {?}
100
+ */
101
+ function () {
102
+ return this._interactionContext;
103
+ },
104
+ enumerable: true,
105
+ configurable: true
106
+ });
107
+ /**
108
+ * @return {?}
109
+ */
110
+ NavigationSession.prototype.notifyActive = /**
111
+ * @return {?}
112
+ */
113
+ function () {
114
+ // noop.
115
+ };
116
+ /**
117
+ * @param {?} event
118
+ * @return {?}
119
+ */
120
+ NavigationSession.prototype.onRouterStarted = /**
121
+ * @param {?} event
122
+ * @return {?}
123
+ */
124
+ function (event) {
125
+ // navigation sessions can have many cancel start cycles due to place guard redirects
126
+ this.ignore(event);
127
+ };
128
+ // @Trace()
129
+ // @Trace()
130
+ /**
131
+ * @param {?} url
132
+ * @return {?}
133
+ */
134
+ NavigationSession.prototype.onUrlChange =
135
+ // @Trace()
136
+ /**
137
+ * @param {?} url
138
+ * @return {?}
139
+ */
140
+ function (url) {
141
+ // Normally we just ignore these but they are the only way of detecting if the back button
142
+ // was clicked during a canDeactivate promise.
143
+ // 1. a route is in progress and awaiting a canDeactivateGuard
144
+ // 2. the user the clicks the back button.
145
+ // So to handle that scenario we need to check if we've got a can deactivate interaction in
146
+ // progress and the do the appropriate clean up.
147
+ if (this.canDeactivateInteractionContext && this.canDeactivateInteractionContext.isActive()) {
148
+ this.cancelCanDeactivateInteraction(url);
149
+ }
150
+ };
151
+ /**
152
+ * @param {?} event
153
+ * @return {?}
154
+ */
155
+ NavigationSession.prototype.onPopState = /**
156
+ * @param {?} event
157
+ * @return {?}
158
+ */
159
+ function (event) {
160
+ return this.illegalTransition(event);
161
+ };
162
+ /**
163
+ * @param {?} event
164
+ * @return {?}
165
+ */
166
+ NavigationSession.prototype.onRouterCancelled = /**
167
+ * @param {?} event
168
+ * @return {?}
169
+ */
170
+ function (event) {
171
+ return this.illegalTransition(event);
172
+ };
173
+ /**
174
+ * @param {?} event
175
+ * @return {?}
176
+ */
177
+ NavigationSession.prototype.onRouterError = /**
178
+ * @param {?} event
179
+ * @return {?}
180
+ */
181
+ function (event) {
182
+ return this.illegalTransition(event);
183
+ };
184
+ /**
185
+ * @param {?} event
186
+ * @return {?}
187
+ */
188
+ NavigationSession.prototype.onRouterEnd = /**
189
+ * @param {?} event
190
+ * @return {?}
191
+ */
192
+ function (event) {
193
+ return this.illegalTransition(event);
194
+ };
195
+ /**
196
+ * @return {?}
197
+ */
198
+ NavigationSession.prototype.getVisits = /**
199
+ * @return {?}
200
+ */
201
+ function () {
202
+ return Array.from(this._visits.values());
203
+ };
204
+ /**
205
+ * @protected
206
+ * @template R
207
+ * @param {?} message
208
+ * @return {?}
209
+ */
210
+ NavigationSession.prototype.illegalTransition = /**
211
+ * @protected
212
+ * @template R
213
+ * @param {?} message
214
+ * @return {?}
215
+ */
216
+ function (message) {
217
+ return lang.illegalState(message.toString() + " not supported by " + this.toString());
218
+ };
219
+ /**
220
+ * @protected
221
+ * @return {?}
222
+ */
223
+ NavigationSession.prototype.currentRouterUrl = /**
224
+ * @protected
225
+ * @return {?}
226
+ */
227
+ function () {
228
+ return this.urlService.getCurrentRouterUrl();
229
+ };
230
+ /**
231
+ * @param {?} url
232
+ * @param {?=} options
233
+ * @return {?}
234
+ */
235
+ NavigationSession.prototype.resetBrowserLocation = /**
236
+ * @param {?} url
237
+ * @param {?=} options
238
+ * @return {?}
239
+ */
240
+ function (url, options) {
241
+ if (options === void 0) { options = { replaceCurrent: false }; }
242
+ // console.log(`---> resetting browser location to: ${url}`);
243
+ this.urlService.resetBrowserLocation(url, options);
244
+ };
245
+ // @Trace()
246
+ // @Trace()
247
+ /**
248
+ * @protected
249
+ * @param {?} poppedHistoryToReplace
250
+ * @param {?} activeUrl
251
+ * @return {?}
252
+ */
253
+ NavigationSession.prototype.repairBrowserHistoryAndUrlAfterGuardCancellation =
254
+ // @Trace()
255
+ /**
256
+ * @protected
257
+ * @param {?} poppedHistoryToReplace
258
+ * @param {?} activeUrl
259
+ * @return {?}
260
+ */
261
+ function (poppedHistoryToReplace, activeUrl) {
262
+ // Important: I tried to perform this fix at a later point int he routing cycle but it created all kinds of
263
+ // strangeness.
264
+ Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
265
+ console.log("replacing " + this.urlService.getCurrentLocationUrlSnapshot().url + " with " + poppedHistoryToReplace);
266
+ this.urlService.resetBrowserLocation(poppedHistoryToReplace, { replaceCurrent: true });
267
+ console.log("pushing " + activeUrl + " back onto the history.");
268
+ this.urlService.resetBrowserLocation(activeUrl, { replaceCurrent: false });
269
+ };
270
+ /**
271
+ * @param {?} event
272
+ * @param {?=} reason
273
+ * @return {?}
274
+ */
275
+ NavigationSession.prototype.ignore = /**
276
+ * @param {?} event
277
+ * @param {?=} reason
278
+ * @return {?}
279
+ */
280
+ function (event, reason) {
281
+ reason = reason ? " -> " + reason : '';
282
+ Logger.get(this).info("Ignoring router event" + reason + ": " + event.constructor.name + " -> " + event.url + " :: " + this.toString());
283
+ };
284
+ /**
285
+ * @return {?}
286
+ */
287
+ NavigationSession.prototype.toString = /**
288
+ * @return {?}
289
+ */
290
+ function () {
291
+ return this.constructor.name + "(" + this.debugState() + ")";
292
+ };
293
+ /**
294
+ * @protected
295
+ * @param {?=} properties
296
+ * @return {?}
297
+ */
298
+ NavigationSession.prototype.debugState = /**
299
+ * @protected
300
+ * @param {?=} properties
301
+ * @return {?}
302
+ */
303
+ function (properties) {
304
+ var _this = this;
305
+ return (properties || this.debugPropertyKeys).map((/**
306
+ * @param {?} p
307
+ * @return {?}
308
+ */
309
+ function (p) {
310
+ return p + ": " + _this[p];
311
+ })).join(', ');
312
+ };
313
+ /**
314
+ * @param {?} component
315
+ * @param {?} currentUrl
316
+ * @param {?} nextUrl
317
+ * @return {?}
318
+ */
319
+ NavigationSession.prototype.canDeactivatePlace = /**
320
+ * @param {?} component
321
+ * @param {?} currentUrl
322
+ * @param {?} nextUrl
323
+ * @return {?}
324
+ */
325
+ function (component, currentUrl, nextUrl) {
326
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
327
+ var handler, isPrimaryHandler;
328
+ return tslib_1.__generator(this, function (_a) {
329
+ // console.log(`---> canDeactivatePlace(${component.placeDefinition.path}, ${currentUrl.url} -> ${nextUrl.url})`);
330
+ // lookup the handler and create it if we've not seen it yet
331
+ handler = this.componentDeactivationHandlers.get(component);
332
+ if (!handler) {
333
+ isPrimaryHandler = this.componentDeactivationHandlers.size === 0;
334
+ handler = new PlaceComponentDeactivationHandler(component, this, isPrimaryHandler);
335
+ this.componentDeactivationHandlers.set(component, handler);
336
+ }
337
+ return [2 /*return*/, handler.canDeactivate(currentUrl, nextUrl).then((/**
338
+ * @param {?} result
339
+ * @return {?}
340
+ */
341
+ function (result) {
342
+ // console.log(`<--- canDeactivatePlace(${component.placeDefinition.path}): ${result}`);
343
+ return result;
344
+ })).catch((/**
345
+ * @param {?} error
346
+ * @return {?}
347
+ */
348
+ function (error) {
349
+ throw error;
350
+ }))];
351
+ });
352
+ });
353
+ };
354
+ /**
355
+ * @param {?} newUrl
356
+ * @return {?}
357
+ */
358
+ NavigationSession.prototype.cancelCanDeactivateInteraction = /**
359
+ * @param {?} newUrl
360
+ * @return {?}
361
+ */
362
+ function (newUrl) {
363
+ Logger.get(this).info("back button pressed during navigation session interaction promise");
364
+ // detach the interaction from the session so it doesn't get disposed until the activity has finished
365
+ // all it's things.
366
+ /** @type {?} */
367
+ var canDeactivateInteractionContext = this.detachCanDeactivateInteractionContext();
368
+ // TODO: I need to make the exclusive interaction context disallow nested activities or
369
+ // that would mess things up entirely. Or, can I do a context.abortAll().then(..)
370
+ Logger.get(this).info('cancelling current navigation activity..');
371
+ canDeactivateInteractionContext.cancelActiveActivity().then((/**
372
+ * @return {?}
373
+ */
374
+ function () {
375
+ canDeactivateInteractionContext.dispose();
376
+ }));
377
+ this.handleCanDeactivateCancelledEventScenario(newUrl);
378
+ };
379
+ /**
380
+ * @protected
381
+ * @param {?} url
382
+ * @return {?}
383
+ */
384
+ NavigationSession.prototype.reinstateUrlAfterAngularChangedItOnCancellation = /**
385
+ * @protected
386
+ * @param {?} url
387
+ * @return {?}
388
+ */
389
+ function (url) {
390
+ // Angular calls _this.resetUrlToCurrentUrlTree() on cancelling and fucks our history.
391
+ // So this means that the top of the stack is the url we want to go back to, and not the one that was on
392
+ // it before the cancel event fired.
393
+ // So we need to:
394
+ // - replace the just inserted url with the one that used to be there.
395
+ // - push our actual url back onto the top of the stack.
396
+ this.resetBrowserLocation(url, { replaceCurrent: true });
397
+ };
398
+ /**
399
+ * @protected
400
+ * @return {?}
401
+ */
402
+ NavigationSession.prototype.detachCanDeactivateInteractionContext = /**
403
+ * @protected
404
+ * @return {?}
405
+ */
406
+ function () {
407
+ /** @type {?} */
408
+ var context = this._interactionContext;
409
+ this._interactionContext = null;
410
+ return context;
411
+ };
412
+ return NavigationSession;
413
+ }(GarbageCollector));
414
+ /**
415
+ * Transient states
416
+ * @abstract
417
+ */
418
+ export { NavigationSession };
419
+ if (false) {
420
+ /** @type {?} */
421
+ NavigationSession.prototype.debugPropertyKeys;
422
+ /**
423
+ * @type {?}
424
+ * @private
425
+ */
426
+ NavigationSession.prototype._visits;
427
+ /**
428
+ * @type {?}
429
+ * @private
430
+ */
431
+ NavigationSession.prototype.componentDeactivationHandlers;
432
+ /** @type {?} */
433
+ NavigationSession.prototype.isPopState;
434
+ /**
435
+ * @type {?}
436
+ * @private
437
+ */
438
+ NavigationSession.prototype._interactionContext;
439
+ /** @type {?} */
440
+ NavigationSession.prototype.context;
441
+ /** @type {?} */
442
+ NavigationSession.prototype.startingUrl;
443
+ /**
444
+ * @abstract
445
+ * @param {?} newUrl
446
+ * @return {?}
447
+ */
448
+ NavigationSession.prototype.handleCanDeactivateCancelledEventScenario = function (newUrl) { };
449
+ }
450
+ //# sourceMappingURL=navigation-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-session.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/navigation-session.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EAAO,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAS,MAAM,gBAAgB,CAAC;AAQ5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC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GrF,+BAA+B,GAAG,IAAI,CAAC,qCAAqC,EAAE;QACpF,uFAAuF;QACvF,uFAAuF;QACvF,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QAClE,+BAA+B,CAAC,oBAAoB,EAAE,CAAC,IAAI;;;QAAC;YAC1D,+BAA+B,CAAC,OAAO,EAAE,CAAC;QAC5C,CAAC,EAAC,CAAC;QAEH,IAAI,CAAC,yCAAyC,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;;;;;;IAIS,2EAA+C;;;;;IAAzD,UAA0D,GAAW;QACnE,sFAAsF;QACtF,wGAAwG;QACxG,oCAAoC;QACpC,iBAAiB;QACjB,sEAAsE;QACtE,wDAAwD;QACxD,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;;;;;IAES,iEAAqC;;;;IAA/C;;YACQ,OAAO,GAAG,IAAI,CAAC,mBAAmB;QACxC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,OAAO,OAAO,CAAC;IACjB,CAAC;IACH,wBAAC;AAAD,CAAC,AAxLD,CAAgD,gBAAgB,GAwL/D;;;;;;;;IAtLC,8CAAiC;;;;;IACjC,oCAAoD;;;;;IAEpD,0DAAqG;;IACrG,uCAAsC;;;;;IAEtC,gDAAgD;;IAEpC,oCAAmC;;IAAE,wCAA4B;;;;;;IA6J7E,8FAAwE","sourcesContent":["import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, RouterEvent } from '@angular/router';\nimport { Dsl, GarbageCollector, lang, Logger, Trace } from '@coolon/pectin';\nimport { InteractionContext } from '../../../interaction/interaction-context';\nimport { InteractionServiceRoutingAdapter } from '../../../interaction/services/interaction-service-routing-adapter';\nimport { PlaceComponent } from '../../place-component';\nimport { PlaceDefinition } from '../../place-definition';\nimport { UrlService } from '../../url-service';\nimport { UrlSnapshot } from '../../url-snapshot';\nimport { Visit } from '../../visit';\nimport { PlaceComponentDeactivationHandler } from '../place-component-deactivation-handler';\nimport { NavigationContext } from './navigation-context';\n\n/**\n * Transient states\n */\nexport abstract class NavigationSession extends GarbageCollector {\n\n debugPropertyKeys: string[] = [];\n private _visits = new Map<PlaceDefinition, Visit>();\n\n private componentDeactivationHandlers = new Map<PlaceComponent, PlaceComponentDeactivationHandler>();\n abstract readonly isPopState: boolean;\n\n private _interactionContext: InteractionContext;\n\n constructor(readonly context: NavigationContext, readonly startingUrl: string) {\n super();\n // TODO: can I get away without creating one every time?\n this._interactionContext = this.context.routerInteractionAdapter.createExclusiveInteractionContext();\n this.onDispose(() => {\n // the interaction context can be detached during the back button cancellation state transition\n // as the transition is synchronous and activityCancellation isn't. Otherwise dispose will be\n // called before the context has been cancelled. It might be work having the interaction context\n // automatically cancel if the context is disposed so we don't have worry about detaching etc.\n if (this._interactionContext) {\n this._interactionContext.dispose(); // or do something like cancelAndDispose?\n }\n });\n }\n\n get name(): string {\n return this.constructor.name;\n }\n\n get urlService(): UrlService {\n return this.context.urlService;\n }\n\n get interactionServiceAdapter(): InteractionServiceRoutingAdapter {\n return this.context.routerInteractionAdapter;\n }\n\n storeVisit(visit: Visit) {\n // console.log(`Storing visit for ${visit.placeDefinition.component.name}`, {visit});\n this._visits.set(visit.placeDefinition, visit);\n }\n\n\n getVisitFor(placeDef: PlaceDefinition) {\n const visit = this._visits.get(placeDef);\n // console.log(`Getting visit for ${placeDef.component.name}`, {visit});\n return visit;\n }\n\n get canDeactivateInteractionContext(): InteractionContext {\n return this._interactionContext;\n }\n\n notifyActive() {\n // noop.\n }\n\n onRouterStarted(event: NavigationStart): void {\n // navigation sessions can have many cancel start cycles due to place guard redirects\n this.ignore(event);\n }\n\n // @Trace()\n onUrlChange(url: string) {\n // Normally we just ignore these but they are the only way of detecting if the back button\n // was clicked during a canDeactivate promise.\n // 1. a route is in progress and awaiting a canDeactivateGuard\n // 2. the user the clicks the back button.\n // So to handle that scenario we need to check if we've got a can deactivate interaction in\n // progress and the do the appropriate clean up.\n if (this.canDeactivateInteractionContext && this.canDeactivateInteractionContext.isActive()) {\n this.cancelCanDeactivateInteraction(url);\n }\n }\n\n onPopState(event: NavigationStart): void {\n return this.illegalTransition(event);\n }\n\n onRouterCancelled(event: NavigationCancel): void {\n return this.illegalTransition(event);\n }\n\n onRouterError(event: NavigationError): void {\n return this.illegalTransition(event);\n }\n\n onRouterEnd(event: NavigationEnd): void {\n return this.illegalTransition(event);\n }\n\n getVisits(): Visit[] {\n return Array.from(this._visits.values());\n }\n\n protected illegalTransition<R>(message: string | RouterEvent): R {\n return lang.illegalState(`${message.toString()} not supported by ${this.toString()}`);\n }\n\n protected currentRouterUrl(): string {\n return this.urlService.getCurrentRouterUrl();\n }\n\n resetBrowserLocation(url, options: { replaceCurrent: boolean } = { replaceCurrent: false }) {\n // console.log(`---> resetting browser location to: ${url}`);\n this.urlService.resetBrowserLocation(url, options);\n }\n\n // @Trace()\n protected repairBrowserHistoryAndUrlAfterGuardCancellation(poppedHistoryToReplace: string, activeUrl:string): void {\n // Important: I tried to perform this fix at a later point int he routing cycle but it created all kinds of\n // strangeness.\n Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');\n console.log(`replacing ${this.urlService.getCurrentLocationUrlSnapshot().url} with ${poppedHistoryToReplace}`);\n this.urlService.resetBrowserLocation(poppedHistoryToReplace, { replaceCurrent: true });\n console.log(`pushing ${activeUrl} back onto the history.`);\n this.urlService.resetBrowserLocation(activeUrl, { replaceCurrent: false });\n }\n\n\n ignore(event: RouterEvent, reason?: string): void {\n reason = reason ? ` -> ${reason}` : '';\n Logger.get(this).info(`Ignoring router event${reason}: ${event.constructor.name} -> ${event.url} :: ${this.toString()}`);\n }\n\n toString(): string {\n return `${this.constructor.name}(${this.debugState()})`;\n }\n\n protected debugState(properties?: string[]) {\n return (properties || this.debugPropertyKeys).map(p => {\n return `${p}: ${this[p]}`;\n }).join(', ');\n }\n\n async canDeactivatePlace(component: PlaceComponent, currentUrl: UrlSnapshot, nextUrl: UrlSnapshot): Promise<boolean | UrlSnapshot> {\n // console.log(`---> canDeactivatePlace(${component.placeDefinition.path}, ${currentUrl.url} -> ${nextUrl.url})`);\n // lookup the handler and create it if we've not seen it yet\n let handler = this.componentDeactivationHandlers.get(component);\n if (!handler) {\n const isPrimaryHandler = this.componentDeactivationHandlers.size === 0; // only primary handler cancels the app model interations\n handler = new PlaceComponentDeactivationHandler(component, this, isPrimaryHandler);\n this.componentDeactivationHandlers.set(component, handler);\n }\n return handler.canDeactivate(currentUrl, nextUrl).then(result => {\n // console.log(`<--- canDeactivatePlace(${component.placeDefinition.path}): ${result}`);\n return result;\n }).catch(error => {\n throw error;\n });\n }\n\n cancelCanDeactivateInteraction(newUrl: string): void {\n Logger.get(this).info(`back button pressed during navigation session interaction promise`);\n // detach the interaction from the session so it doesn't get disposed until the activity has finished\n // all it's things.\n const canDeactivateInteractionContext = this.detachCanDeactivateInteractionContext();\n // TODO: I need to make the exclusive interaction context disallow nested activities or\n // that would mess things up entirely. Or, can I do a context.abortAll().then(..)\n Logger.get(this).info('cancelling current navigation activity..');\n canDeactivateInteractionContext.cancelActiveActivity().then(() => {\n canDeactivateInteractionContext.dispose();\n });\n\n this.handleCanDeactivateCancelledEventScenario(newUrl);\n }\n\n abstract handleCanDeactivateCancelledEventScenario(newUrl: string): void\n\n protected reinstateUrlAfterAngularChangedItOnCancellation(url: string) {\n // Angular calls _this.resetUrlToCurrentUrlTree() on cancelling and fucks our history.\n // So this means that the top of the stack is the url we want to go back to, and not the one that was on\n // it before the cancel event fired.\n // So we need to:\n // - replace the just inserted url with the one that used to be there.\n // - push our actual url back onto the top of the stack.\n this.resetBrowserLocation(url, { replaceCurrent: true });\n }\n\n protected detachCanDeactivateInteractionContext(): InteractionContext {\n const context = this._interactionContext;\n this._interactionContext = null;\n return context;\n }\n}\n"]}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @fileoverview added by tsickle
3
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
+ */
5
+ import * as tslib_1 from "tslib";
6
+ import { AbstractPopStateNavigation } from './abstract-pop-state-navigation';
7
+ import { WaitUntilPopStateDuringCanDeactivateInteractionFinishes } from './event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes';
8
+ var PopStateNavigation = /** @class */ (function (_super) {
9
+ tslib_1.__extends(PopStateNavigation, _super);
10
+ function PopStateNavigation() {
11
+ return _super !== null && _super.apply(this, arguments) || this;
12
+ }
13
+ /**
14
+ * @param {?} event
15
+ * @return {?}
16
+ */
17
+ PopStateNavigation.prototype.onRouterCancelled = /**
18
+ * @param {?} event
19
+ * @return {?}
20
+ */
21
+ function (event) {
22
+ this.repairBrowserHistoryAndUrlAfterGuardCancellation();
23
+ this.context.finishRoutingSession();
24
+ };
25
+ /**
26
+ * @param {?} event
27
+ * @return {?}
28
+ */
29
+ PopStateNavigation.prototype.onRouterEnd = /**
30
+ * @param {?} event
31
+ * @return {?}
32
+ */
33
+ function (event) {
34
+ this.context.finishRoutingSession(this.getVisits());
35
+ };
36
+ /**
37
+ * @param {?} locationTriggerUrl
38
+ * @return {?}
39
+ */
40
+ PopStateNavigation.prototype.handleCanDeactivateCancelledEventScenario = /**
41
+ * @param {?} locationTriggerUrl
42
+ * @return {?}
43
+ */
44
+ function (locationTriggerUrl) {
45
+ this.context.transitionTo(new WaitUntilPopStateDuringCanDeactivateInteractionFinishes(this.context, this.startingUrl, locationTriggerUrl, this.poppedHistoryUrl));
46
+ };
47
+ return PopStateNavigation;
48
+ }(AbstractPopStateNavigation));
49
+ export { PopStateNavigation };
50
+ //# sourceMappingURL=pop-state-navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pop-state-navigation.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/pop-state-navigation.ts"],"names":[],"mappings":";;;;;AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAG7E,OAAO,EAAE,uDAAuD,EAAE,MAAM,+EAA+E,CAAC;AAExJ;IAAwC,8CAA0B;IAAlE;;IAkBA,CAAC;;;;;IAhBC,8CAAiB;;;;IAAjB,UAAkB,KAAuB;QACvC,IAAI,CAAC,gDAAgD,EAAE,CAAC;QACxD,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IACtC,CAAC;;;;;IAED,wCAAW;;;;IAAX,UAAY,KAAoB;QAC9B,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACtD,CAAC;;;;;IAED,sEAAyC;;;;IAAzC,UAA0C,kBAA0B;QAClE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,uDAAuD,CAAC,IAAI,CAAC,OAAO,EAChG,IAAI,CAAC,WAAW,EAChB,kBAAkB,EAClB,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC5B,CAAC;IAEH,yBAAC;AAAD,CAAC,AAlBD,CAAwC,0BAA0B,GAkBjE","sourcesContent":["import { NavigationCancel, NavigationEnd, NavigationError } from '@angular/router';\nimport { Logger, Trace } from '@coolon/pectin';\nimport { AbstractPopStateNavigation } from './abstract-pop-state-navigation';\nimport { NavigationContext } from './navigation-context';\nimport { NavigationSession } from './navigation-session';\nimport { WaitUntilPopStateDuringCanDeactivateInteractionFinishes } from './event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes';\n\nexport class PopStateNavigation extends AbstractPopStateNavigation {\n\n onRouterCancelled(event: NavigationCancel): void {\n this.repairBrowserHistoryAndUrlAfterGuardCancellation();\n this.context.finishRoutingSession();\n }\n\n onRouterEnd(event: NavigationEnd): void {\n this.context.finishRoutingSession(this.getVisits());\n }\n\n handleCanDeactivateCancelledEventScenario(locationTriggerUrl: string): void {\n this.context.transitionTo(new WaitUntilPopStateDuringCanDeactivateInteractionFinishes(this.context,\n this.startingUrl,\n locationTriggerUrl,\n this.poppedHistoryUrl));\n }\n\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
4
  */
5
5
  import * as tslib_1 from "tslib";
6
- import { assert, Binding, DebugContext, lang } from '@coolon/pectin';
6
+ import { assert, Binding, DebugContext, Dsl, Guard, lang, MutableValueModel } from '@coolon/pectin';
7
7
  import { Klass } from '@coolon/typescript-utilities';
8
8
  import { Memoize } from '@typescript-plus/fast-memoize-decorator';
9
9
  import 'reflect-metadata';
@@ -18,29 +18,73 @@ export var ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
18
18
  var PlaceComponent = /** @class */ (function (_super) {
19
19
  tslib_1.__extends(PlaceComponent, _super);
20
20
  function PlaceComponent() {
21
- return _super.call(this) || this;
21
+ var _this = _super.call(this) || this;
22
+ _this.visitModel = new MutableValueModel();
23
+ _this._inVisitUpdate = new Guard();
24
+ return _this;
22
25
  }
26
+ // @Trace()
27
+ // @Trace()
23
28
  /**
24
29
  * @param {?} visit
30
+ * @param {?} notifyVisitChanged
25
31
  * @return {?}
26
32
  */
27
- PlaceComponent.prototype.initialiseVisit = /**
33
+ PlaceComponent.prototype.initialiseVisit =
34
+ // @Trace()
35
+ /**
28
36
  * @param {?} visit
37
+ * @param {?} notifyVisitChanged
29
38
  * @return {?}
30
39
  */
31
- function (visit) {
40
+ function (visit, notifyVisitChanged) {
32
41
  var _this = this;
33
- assert.isNil(this.visit);
34
- this.visit = visit;
35
- DebugContext.get(this.visit).tag(this.placeDefinition.component.name + ".visit");
42
+ assert.isNil(this.visitModel.value);
43
+ var when = Dsl.disposeWith(this).when;
44
+ this.visitModel.value = visit;
45
+ DebugContext.get(this.visitModel).tag(this.placeDefinition.component.name + ".visitModel");
36
46
  this.placeDefinition.getVisitParameterDefs().forEach((/**
37
47
  * @param {?} parameterDef
38
48
  * @return {?}
39
49
  */
40
- function (parameterDef) {
41
- _this.installBinding(parameterDef);
50
+ function (parameterDef) { return _this.installBinding(parameterDef); }));
51
+ when.valueOf(this.visitModel).changes((/**
52
+ * @param {?} current
53
+ * @param {?} previous
54
+ * @return {?}
55
+ */
56
+ function (current, previous) {
57
+ notifyVisitChanged(current, previous);
58
+ }), { unless: this._inVisitUpdate });
59
+ };
60
+ /**
61
+ * @param {?} visit
62
+ * @return {?}
63
+ */
64
+ PlaceComponent.prototype.updateVisit = /**
65
+ * @param {?} visit
66
+ * @return {?}
67
+ */
68
+ function (visit) {
69
+ var _this = this;
70
+ assert.isTruthy(this.isInitialised());
71
+ assert.notNil(visit);
72
+ this._inVisitUpdate.whileTrue((/**
73
+ * @return {?}
74
+ */
75
+ function () {
76
+ _this.visitModel.value = visit;
42
77
  }));
43
78
  };
79
+ /**
80
+ * @return {?}
81
+ */
82
+ PlaceComponent.prototype.isInitialised = /**
83
+ * @return {?}
84
+ */
85
+ function () {
86
+ return !!this.visitModel.value;
87
+ };
44
88
  // @Trace()
45
89
  // @Trace()
46
90
  /**
@@ -62,7 +106,7 @@ var PlaceComponent = /** @class */ (function (_super) {
62
106
  var model = (/** @type {?} */ (this[parameterDef.propertyName]));
63
107
  DebugContext.tag(model, this.placeDefinition.component.name + "." + parameterDef.propertyName);
64
108
  /** @type {?} */
65
- var binding = this.registerDisposable(new Binding(this.visit, model, {
109
+ var binding = this.registerDisposable(new Binding(this.visitModel, model, {
66
110
  toRight: /**
67
111
  * @param {?} visit
68
112
  * @return {?}
@@ -83,12 +127,7 @@ var PlaceComponent = /** @class */ (function (_super) {
83
127
  return currentVisit.replace(parameterDef, value);
84
128
  }
85
129
  }));
86
- setTimeout((/**
87
- * @return {?}
88
- */
89
- function () {
90
- binding.writeRight();
91
- }));
130
+ binding.writeRight();
92
131
  };
93
132
  Object.defineProperty(PlaceComponent.prototype, "placeDefinition", {
94
133
  get: /**
@@ -135,7 +174,12 @@ if (false) {
135
174
  * @type {?}
136
175
  * @private
137
176
  */
138
- PlaceComponent.prototype.visit;
177
+ PlaceComponent.prototype.visitModel;
178
+ /**
179
+ * @type {?}
180
+ * @private
181
+ */
182
+ PlaceComponent.prototype._inVisitUpdate;
139
183
  /** @type {?} */
140
184
  PlaceComponent.prototype.interactionContext;
141
185
  }