@memberjunction/ng-conversations 6.1.4 → 6.2.0-edge.1

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 (424) hide show
  1. package/README.md +36 -3
  2. package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +19 -3
  3. package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -1
  4. package/dist/lib/components/active-tasks/active-tasks-panel.component.js +39 -7
  5. package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -1
  6. package/dist/lib/components/agent/active-agent-indicator.component.d.ts +74 -6
  7. package/dist/lib/components/agent/active-agent-indicator.component.d.ts.map +1 -1
  8. package/dist/lib/components/agent/active-agent-indicator.component.js +111 -21
  9. package/dist/lib/components/agent/active-agent-indicator.component.js.map +1 -1
  10. package/dist/lib/components/agent/agent-process-panel.component.d.ts +31 -5
  11. package/dist/lib/components/agent/agent-process-panel.component.d.ts.map +1 -1
  12. package/dist/lib/components/agent/agent-process-panel.component.js +71 -15
  13. package/dist/lib/components/agent/agent-process-panel.component.js.map +1 -1
  14. package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +65 -9
  15. package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
  16. package/dist/lib/components/artifact/artifact-share-modal.component.js +169 -57
  17. package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
  18. package/dist/lib/components/attachment/image-viewer.component.d.ts +77 -11
  19. package/dist/lib/components/attachment/image-viewer.component.d.ts.map +1 -1
  20. package/dist/lib/components/attachment/image-viewer.component.js +181 -47
  21. package/dist/lib/components/attachment/image-viewer.component.js.map +1 -1
  22. package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts +129 -19
  23. package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts.map +1 -1
  24. package/dist/lib/components/collection/artifact-collection-picker-modal.component.js +350 -116
  25. package/dist/lib/components/collection/artifact-collection-picker-modal.component.js.map +1 -1
  26. package/dist/lib/components/collection/artifact-create-modal.component.d.ts +60 -8
  27. package/dist/lib/components/collection/artifact-create-modal.component.d.ts.map +1 -1
  28. package/dist/lib/components/collection/artifact-create-modal.component.js +130 -46
  29. package/dist/lib/components/collection/artifact-create-modal.component.js.map +1 -1
  30. package/dist/lib/components/collection/collection-artifact-card.component.d.ts +63 -3
  31. package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -1
  32. package/dist/lib/components/collection/collection-artifact-card.component.js +113 -19
  33. package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -1
  34. package/dist/lib/components/collection/collection-form-modal.component.d.ts +54 -8
  35. package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
  36. package/dist/lib/components/collection/collection-form-modal.component.js +130 -46
  37. package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
  38. package/dist/lib/components/collection/collection-share-modal.component.d.ts +70 -10
  39. package/dist/lib/components/collection/collection-share-modal.component.d.ts.map +1 -1
  40. package/dist/lib/components/collection/collection-share-modal.component.js +175 -53
  41. package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
  42. package/dist/lib/components/collection/collection-tree.component.d.ts +89 -9
  43. package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
  44. package/dist/lib/components/collection/collection-tree.component.js +220 -70
  45. package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
  46. package/dist/lib/components/collection/collection-view.component.d.ts +89 -11
  47. package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
  48. package/dist/lib/components/collection/collection-view.component.js +154 -40
  49. package/dist/lib/components/collection/collection-view.component.js.map +1 -1
  50. package/dist/lib/components/collection/collections-full-view.component.d.ts +390 -38
  51. package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
  52. package/dist/lib/components/collection/collections-full-view.component.js +951 -367
  53. package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
  54. package/dist/lib/components/composer/ai-composer.component.d.ts +213 -18
  55. package/dist/lib/components/composer/ai-composer.component.d.ts.map +1 -1
  56. package/dist/lib/components/composer/ai-composer.component.js +388 -44
  57. package/dist/lib/components/composer/ai-composer.component.js.map +1 -1
  58. package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts +12 -1
  59. package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts.map +1 -1
  60. package/dist/lib/components/conversation/conversation-agent-picker.component.js +26 -4
  61. package/dist/lib/components/conversation/conversation-agent-picker.component.js.map +1 -1
  62. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +1090 -123
  63. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
  64. package/dist/lib/components/conversation/conversation-chat-area.component.js +2407 -731
  65. package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
  66. package/dist/lib/components/conversation/conversation-empty-state.component.d.ts +139 -19
  67. package/dist/lib/components/conversation/conversation-empty-state.component.d.ts.map +1 -1
  68. package/dist/lib/components/conversation/conversation-empty-state.component.js +296 -59
  69. package/dist/lib/components/conversation/conversation-empty-state.component.js.map +1 -1
  70. package/dist/lib/components/conversation/conversation-list.component.d.ts +579 -78
  71. package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -1
  72. package/dist/lib/components/conversation/conversation-list.component.js +2322 -823
  73. package/dist/lib/components/conversation/conversation-list.component.js.map +1 -1
  74. package/dist/lib/components/conversation/pinned-messages-panel.component.d.ts +40 -4
  75. package/dist/lib/components/conversation/pinned-messages-panel.component.d.ts.map +1 -1
  76. package/dist/lib/components/conversation/pinned-messages-panel.component.js +72 -14
  77. package/dist/lib/components/conversation/pinned-messages-panel.component.js.map +1 -1
  78. package/dist/lib/components/dialogs/input-dialog.component.d.ts +57 -11
  79. package/dist/lib/components/dialogs/input-dialog.component.d.ts.map +1 -1
  80. package/dist/lib/components/dialogs/input-dialog.component.js +128 -16
  81. package/dist/lib/components/dialogs/input-dialog.component.js.map +1 -1
  82. package/dist/lib/components/dialogs/rating-dialog.component.d.ts +68 -10
  83. package/dist/lib/components/dialogs/rating-dialog.component.d.ts.map +1 -1
  84. package/dist/lib/components/dialogs/rating-dialog.component.js +151 -27
  85. package/dist/lib/components/dialogs/rating-dialog.component.js.map +1 -1
  86. package/dist/lib/components/export/export-modal.component.d.ts +84 -10
  87. package/dist/lib/components/export/export-modal.component.d.ts.map +1 -1
  88. package/dist/lib/components/export/export-modal.component.js +173 -49
  89. package/dist/lib/components/export/export-modal.component.js.map +1 -1
  90. package/dist/lib/components/global-tasks/global-tasks-panel.component.d.ts +29 -3
  91. package/dist/lib/components/global-tasks/global-tasks-panel.component.d.ts.map +1 -1
  92. package/dist/lib/components/global-tasks/global-tasks-panel.component.js +58 -12
  93. package/dist/lib/components/global-tasks/global-tasks-panel.component.js.map +1 -1
  94. package/dist/lib/components/library/library-full-view.component.d.ts +57 -8
  95. package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
  96. package/dist/lib/components/library/library-full-view.component.js +119 -35
  97. package/dist/lib/components/library/library-full-view.component.js.map +1 -1
  98. package/dist/lib/components/members/members-modal.component.d.ts +76 -10
  99. package/dist/lib/components/members/members-modal.component.d.ts.map +1 -1
  100. package/dist/lib/components/members/members-modal.component.js +164 -50
  101. package/dist/lib/components/members/members-modal.component.js.map +1 -1
  102. package/dist/lib/components/message/actionable-commands.component.d.ts +37 -5
  103. package/dist/lib/components/message/actionable-commands.component.d.ts.map +1 -1
  104. package/dist/lib/components/message/actionable-commands.component.js +82 -16
  105. package/dist/lib/components/message/actionable-commands.component.js.map +1 -1
  106. package/dist/lib/components/message/conversation-message-rating.component.d.ts +46 -10
  107. package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
  108. package/dist/lib/components/message/conversation-message-rating.component.js +120 -36
  109. package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
  110. package/dist/lib/components/message/message-input.component.d.ts +549 -74
  111. package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
  112. package/dist/lib/components/message/message-input.component.js +1250 -421
  113. package/dist/lib/components/message/message-input.component.js.map +1 -1
  114. package/dist/lib/components/message/message-item.component.d.ts +411 -29
  115. package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
  116. package/dist/lib/components/message/message-item.component.js +896 -222
  117. package/dist/lib/components/message/message-item.component.js.map +1 -1
  118. package/dist/lib/components/message/message-list.component.d.ts +288 -29
  119. package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
  120. package/dist/lib/components/message/message-list.component.js +561 -123
  121. package/dist/lib/components/message/message-list.component.js.map +1 -1
  122. package/dist/lib/components/navigation/conversation-navigation.component.d.ts +64 -5
  123. package/dist/lib/components/navigation/conversation-navigation.component.d.ts.map +1 -1
  124. package/dist/lib/components/navigation/conversation-navigation.component.js +101 -11
  125. package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -1
  126. package/dist/lib/components/notification/activity-indicator.component.d.ts +6 -2
  127. package/dist/lib/components/notification/activity-indicator.component.d.ts.map +1 -1
  128. package/dist/lib/components/notification/activity-indicator.component.js +13 -3
  129. package/dist/lib/components/notification/activity-indicator.component.js.map +1 -1
  130. package/dist/lib/components/notification/notification-badge.component.d.ts +15 -3
  131. package/dist/lib/components/notification/notification-badge.component.d.ts.map +1 -1
  132. package/dist/lib/components/notification/notification-badge.component.js +36 -8
  133. package/dist/lib/components/notification/notification-badge.component.js.map +1 -1
  134. package/dist/lib/components/overlay/chat-overlay.component.d.ts +1 -1
  135. package/dist/lib/components/overlay/chat-overlay.component.js +4 -4
  136. package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
  137. package/dist/lib/components/project/project-form-modal.component.d.ts +93 -11
  138. package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -1
  139. package/dist/lib/components/project/project-form-modal.component.js +348 -87
  140. package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
  141. package/dist/lib/components/project/project-selector.component.d.ts +78 -8
  142. package/dist/lib/components/project/project-selector.component.d.ts.map +1 -1
  143. package/dist/lib/components/project/project-selector.component.js +177 -46
  144. package/dist/lib/components/project/project-selector.component.js.map +1 -1
  145. package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.d.ts +1 -1
  146. package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.d.ts.map +1 -1
  147. package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.js.map +1 -1
  148. package/dist/lib/components/realtime/channels/client-context-channel.d.ts +1 -1
  149. package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -1
  150. package/dist/lib/components/realtime/channels/client-context-channel.js +1 -1
  151. package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -1
  152. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts +1 -1
  153. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts.map +1 -1
  154. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js +3 -0
  155. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js.map +1 -1
  156. package/dist/lib/components/realtime/media/media-channel.d.ts +2 -1
  157. package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -1
  158. package/dist/lib/components/realtime/media/media-channel.js +1 -1
  159. package/dist/lib/components/realtime/media/media-channel.js.map +1 -1
  160. package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +2 -2
  161. package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +1 -1
  162. package/dist/lib/components/realtime/realtime-activity-rail.component.js +2 -2
  163. package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
  164. package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +1 -1
  165. package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
  166. package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
  167. package/dist/lib/components/realtime/realtime-composer.component.d.ts +3 -1
  168. package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
  169. package/dist/lib/components/realtime/realtime-composer.component.js +26 -8
  170. package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
  171. package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +2 -2
  172. package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -1
  173. package/dist/lib/components/realtime/realtime-delegation-card.component.js +2 -2
  174. package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
  175. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +4 -4
  176. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
  177. package/dist/lib/components/realtime/realtime-session-overlay.component.js +19 -19
  178. package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
  179. package/dist/lib/components/realtime/realtime-session-state.d.ts +2 -3
  180. package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -1
  181. package/dist/lib/components/realtime/realtime-session-state.js +3 -2
  182. package/dist/lib/components/realtime/realtime-session-state.js.map +1 -1
  183. package/dist/lib/components/realtime/realtime-session-thread.component.d.ts +17 -1
  184. package/dist/lib/components/realtime/realtime-session-thread.component.d.ts.map +1 -1
  185. package/dist/lib/components/realtime/realtime-session-thread.component.js +122 -45
  186. package/dist/lib/components/realtime/realtime-session-thread.component.js.map +1 -1
  187. package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts +47 -31
  188. package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts.map +1 -1
  189. package/dist/lib/components/realtime/realtime-session-timeline-card.component.js +138 -124
  190. package/dist/lib/components/realtime/realtime-session-timeline-card.component.js.map +1 -1
  191. package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +4 -4
  192. package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -1
  193. package/dist/lib/components/realtime/realtime-surface-tabs.component.js +4 -4
  194. package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
  195. package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +2 -2
  196. package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
  197. package/dist/lib/components/realtime/realtime-surface-tabs.model.js +3 -3
  198. package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
  199. package/dist/lib/components/realtime/realtime-ui-config.d.ts +13 -11
  200. package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
  201. package/dist/lib/components/realtime/realtime-ui-config.js +29 -25
  202. package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
  203. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +1 -1
  204. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
  205. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +1 -1
  206. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
  207. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +4 -2
  208. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
  209. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +7 -3
  210. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
  211. package/dist/lib/components/search/search-panel.component.d.ts +133 -22
  212. package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
  213. package/dist/lib/components/search/search-panel.component.js +312 -83
  214. package/dist/lib/components/search/search-panel.component.js.map +1 -1
  215. package/dist/lib/components/share/share-modal.component.d.ts +69 -9
  216. package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
  217. package/dist/lib/components/share/share-modal.component.js +139 -31
  218. package/dist/lib/components/share/share-modal.component.js.map +1 -1
  219. package/dist/lib/components/shared/user-picker.component.d.ts +48 -8
  220. package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -1
  221. package/dist/lib/components/shared/user-picker.component.js +110 -30
  222. package/dist/lib/components/shared/user-picker.component.js.map +1 -1
  223. package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +114 -11
  224. package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
  225. package/dist/lib/components/sidebar/conversation-sidebar.component.js +199 -21
  226. package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
  227. package/dist/lib/components/sidebar/routines-section.component.d.ts +20 -1
  228. package/dist/lib/components/sidebar/routines-section.component.d.ts.map +1 -1
  229. package/dist/lib/components/sidebar/routines-section.component.js +25 -5
  230. package/dist/lib/components/sidebar/routines-section.component.js.map +1 -1
  231. package/dist/lib/components/slots/slot-interfaces.d.ts +19 -0
  232. package/dist/lib/components/slots/slot-interfaces.d.ts.map +1 -1
  233. package/dist/lib/components/slots/slot-interfaces.js.map +1 -1
  234. package/dist/lib/components/task/tasks-full-view.component.d.ts +95 -13
  235. package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
  236. package/dist/lib/components/task/tasks-full-view.component.js +223 -75
  237. package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
  238. package/dist/lib/components/tasks/task-widget.component.d.ts +46 -6
  239. package/dist/lib/components/tasks/task-widget.component.d.ts.map +1 -1
  240. package/dist/lib/components/tasks/task-widget.component.js +100 -16
  241. package/dist/lib/components/tasks/task-widget.component.js.map +1 -1
  242. package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +64 -7
  243. package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -1
  244. package/dist/lib/components/tasks/tasks-dropdown.component.js +127 -27
  245. package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
  246. package/dist/lib/components/thread/thread-panel.component.d.ts +66 -8
  247. package/dist/lib/components/thread/thread-panel.component.d.ts.map +1 -1
  248. package/dist/lib/components/thread/thread-panel.component.js +146 -36
  249. package/dist/lib/components/thread/thread-panel.component.js.map +1 -1
  250. package/dist/lib/components/toast/toast.component.d.ts +11 -1
  251. package/dist/lib/components/toast/toast.component.d.ts.map +1 -1
  252. package/dist/lib/components/toast/toast.component.js +25 -5
  253. package/dist/lib/components/toast/toast.component.js.map +1 -1
  254. package/dist/lib/components/workspace/conversation-workspace.component.d.ts +385 -42
  255. package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
  256. package/dist/lib/components/workspace/conversation-workspace.component.js +887 -291
  257. package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
  258. package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts +8 -0
  259. package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts.map +1 -1
  260. package/dist/lib/composer-plugins/base-conversation-mention.provider.js +8 -1
  261. package/dist/lib/composer-plugins/base-conversation-mention.provider.js.map +1 -1
  262. package/dist/lib/conversations.module.d.ts.map +1 -1
  263. package/dist/lib/conversations.module.js.map +1 -1
  264. package/dist/lib/directives/chat-slot.directive.d.ts +5 -1
  265. package/dist/lib/directives/chat-slot.directive.d.ts.map +1 -1
  266. package/dist/lib/directives/chat-slot.directive.js.map +1 -1
  267. package/dist/lib/directives/search-shortcut.directive.d.ts +9 -1
  268. package/dist/lib/directives/search-shortcut.directive.d.ts.map +1 -1
  269. package/dist/lib/directives/search-shortcut.directive.js +14 -4
  270. package/dist/lib/directives/search-shortcut.directive.js.map +1 -1
  271. package/dist/lib/events/chat-events.d.ts +34 -7
  272. package/dist/lib/events/chat-events.d.ts.map +1 -1
  273. package/dist/lib/events/chat-events.js +37 -7
  274. package/dist/lib/events/chat-events.js.map +1 -1
  275. package/dist/lib/models/agent-turn.model.d.ts +103 -0
  276. package/dist/lib/models/agent-turn.model.d.ts.map +1 -0
  277. package/dist/lib/models/agent-turn.model.js +12 -0
  278. package/dist/lib/models/agent-turn.model.js.map +1 -0
  279. package/dist/lib/models/collection-view.model.js.map +1 -1
  280. package/dist/lib/models/conversation-state.model.d.ts +8 -0
  281. package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
  282. package/dist/lib/models/conversation-state.model.js.map +1 -1
  283. package/dist/lib/models/lazy-artifact-info.d.ts +44 -12
  284. package/dist/lib/models/lazy-artifact-info.d.ts.map +1 -1
  285. package/dist/lib/models/lazy-artifact-info.js +98 -34
  286. package/dist/lib/models/lazy-artifact-info.js.map +1 -1
  287. package/dist/lib/services/active-tasks.service.d.ts +30 -4
  288. package/dist/lib/services/active-tasks.service.d.ts.map +1 -1
  289. package/dist/lib/services/active-tasks.service.js +71 -19
  290. package/dist/lib/services/active-tasks.service.js.map +1 -1
  291. package/dist/lib/services/agent-state.service.d.ts +17 -1
  292. package/dist/lib/services/agent-state.service.d.ts.map +1 -1
  293. package/dist/lib/services/agent-state.service.js +48 -16
  294. package/dist/lib/services/agent-state.service.js.map +1 -1
  295. package/dist/lib/services/artifact-permission.service.d.ts +39 -0
  296. package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
  297. package/dist/lib/services/artifact-permission.service.js +152 -17
  298. package/dist/lib/services/artifact-permission.service.js.map +1 -1
  299. package/dist/lib/services/artifact-state.service.d.ts +58 -5
  300. package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
  301. package/dist/lib/services/artifact-state.service.js +135 -35
  302. package/dist/lib/services/artifact-state.service.js.map +1 -1
  303. package/dist/lib/services/browser-realtime-media-host.d.ts +24 -0
  304. package/dist/lib/services/browser-realtime-media-host.d.ts.map +1 -0
  305. package/dist/lib/services/browser-realtime-media-host.js +95 -0
  306. package/dist/lib/services/browser-realtime-media-host.js.map +1 -0
  307. package/dist/lib/services/collection-permission.service.d.ts +28 -0
  308. package/dist/lib/services/collection-permission.service.d.ts.map +1 -1
  309. package/dist/lib/services/collection-permission.service.js +88 -32
  310. package/dist/lib/services/collection-permission.service.js.map +1 -1
  311. package/dist/lib/services/collection-state.service.d.ts +11 -1
  312. package/dist/lib/services/collection-state.service.d.ts.map +1 -1
  313. package/dist/lib/services/collection-state.service.js +25 -5
  314. package/dist/lib/services/collection-state.service.js.map +1 -1
  315. package/dist/lib/services/conversation-agent.service.d.ts +26 -4
  316. package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
  317. package/dist/lib/services/conversation-agent.service.js +57 -18
  318. package/dist/lib/services/conversation-agent.service.js.map +1 -1
  319. package/dist/lib/services/conversation-attachment.service.d.ts +41 -2
  320. package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
  321. package/dist/lib/services/conversation-attachment.service.js +80 -13
  322. package/dist/lib/services/conversation-attachment.service.js.map +1 -1
  323. package/dist/lib/services/conversation-streaming.service.d.ts +22 -0
  324. package/dist/lib/services/conversation-streaming.service.d.ts.map +1 -1
  325. package/dist/lib/services/conversation-streaming.service.js +50 -10
  326. package/dist/lib/services/conversation-streaming.service.js.map +1 -1
  327. package/dist/lib/services/data-cache.service.d.ts +31 -0
  328. package/dist/lib/services/data-cache.service.d.ts.map +1 -1
  329. package/dist/lib/services/data-cache.service.js +71 -15
  330. package/dist/lib/services/data-cache.service.js.map +1 -1
  331. package/dist/lib/services/dialog.service.d.ts +13 -0
  332. package/dist/lib/services/dialog.service.d.ts.map +1 -1
  333. package/dist/lib/services/dialog.service.js +25 -5
  334. package/dist/lib/services/dialog.service.js.map +1 -1
  335. package/dist/lib/services/export.service.d.ts +2 -0
  336. package/dist/lib/services/export.service.d.ts.map +1 -1
  337. package/dist/lib/services/export.service.js +5 -1
  338. package/dist/lib/services/export.service.js.map +1 -1
  339. package/dist/lib/services/graphql-attachment-blob-store.d.ts +44 -0
  340. package/dist/lib/services/graphql-attachment-blob-store.d.ts.map +1 -0
  341. package/dist/lib/services/graphql-attachment-blob-store.js +113 -0
  342. package/dist/lib/services/graphql-attachment-blob-store.js.map +1 -0
  343. package/dist/lib/services/mention-autocomplete.service.d.ts +17 -141
  344. package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
  345. package/dist/lib/services/mention-autocomplete.service.js +15 -460
  346. package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
  347. package/dist/lib/services/mention-parser.service.d.ts +10 -0
  348. package/dist/lib/services/mention-parser.service.d.ts.map +1 -1
  349. package/dist/lib/services/mention-parser.service.js +25 -5
  350. package/dist/lib/services/mention-parser.service.js.map +1 -1
  351. package/dist/lib/services/notification.service.d.ts +54 -6
  352. package/dist/lib/services/notification.service.d.ts.map +1 -1
  353. package/dist/lib/services/notification.service.js +123 -27
  354. package/dist/lib/services/notification.service.js.map +1 -1
  355. package/dist/lib/services/realtime-audio-recorder.d.ts +4 -4
  356. package/dist/lib/services/realtime-audio-recorder.js +12 -12
  357. package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
  358. package/dist/lib/services/realtime-pcm-wav.d.ts +4 -0
  359. package/dist/lib/services/realtime-pcm-wav.d.ts.map +1 -1
  360. package/dist/lib/services/realtime-pcm-wav.js +10 -2
  361. package/dist/lib/services/realtime-pcm-wav.js.map +1 -1
  362. package/dist/lib/services/realtime-session-review.service.d.ts +1 -1
  363. package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
  364. package/dist/lib/services/realtime-session-review.service.js +1 -1
  365. package/dist/lib/services/realtime-session-review.service.js.map +1 -1
  366. package/dist/lib/services/realtime-session.service.d.ts +16 -1150
  367. package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
  368. package/dist/lib/services/realtime-session.service.js +28 -2430
  369. package/dist/lib/services/realtime-session.service.js.map +1 -1
  370. package/dist/lib/services/search.service.d.ts +42 -9
  371. package/dist/lib/services/search.service.d.ts.map +1 -1
  372. package/dist/lib/services/search.service.js +103 -23
  373. package/dist/lib/services/search.service.js.map +1 -1
  374. package/dist/lib/services/toast.service.d.ts +19 -1
  375. package/dist/lib/services/toast.service.d.ts.map +1 -1
  376. package/dist/lib/services/toast.service.js +45 -9
  377. package/dist/lib/services/toast.service.js.map +1 -1
  378. package/dist/lib/services/ui-command-handler.service.d.ts +16 -2
  379. package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
  380. package/dist/lib/services/ui-command-handler.service.js +36 -8
  381. package/dist/lib/services/ui-command-handler.service.js.map +1 -1
  382. package/dist/lib/utils/agent-artifact-summary.d.ts +2 -2
  383. package/dist/lib/utils/agent-artifact-summary.js +3 -3
  384. package/dist/lib/utils/agent-artifact-summary.js.map +1 -1
  385. package/dist/lib/utils/agent-turn-routing.d.ts +69 -0
  386. package/dist/lib/utils/agent-turn-routing.d.ts.map +1 -0
  387. package/dist/lib/utils/agent-turn-routing.js +96 -0
  388. package/dist/lib/utils/agent-turn-routing.js.map +1 -0
  389. package/dist/lib/utils/artifact-panel-action.d.ts +15 -4
  390. package/dist/lib/utils/artifact-panel-action.d.ts.map +1 -1
  391. package/dist/lib/utils/artifact-panel-action.js +10 -2
  392. package/dist/lib/utils/artifact-panel-action.js.map +1 -1
  393. package/dist/lib/utils/distinct-artifacts.d.ts +2 -0
  394. package/dist/lib/utils/distinct-artifacts.d.ts.map +1 -1
  395. package/dist/lib/utils/distinct-artifacts.js +5 -1
  396. package/dist/lib/utils/distinct-artifacts.js.map +1 -1
  397. package/dist/lib/utils/plan-mode-preference.d.ts +2 -2
  398. package/dist/lib/utils/plan-mode-preference.js +6 -6
  399. package/dist/lib/utils/plan-mode-preference.js.map +1 -1
  400. package/dist/lib/utils/realtime-session-timeline.d.ts +8 -79
  401. package/dist/lib/utils/realtime-session-timeline.d.ts.map +1 -1
  402. package/dist/lib/utils/realtime-session-timeline.js +8 -89
  403. package/dist/lib/utils/realtime-session-timeline.js.map +1 -1
  404. package/dist/public-api.d.ts +5 -2
  405. package/dist/public-api.d.ts.map +1 -1
  406. package/dist/public-api.js +9 -2
  407. package/dist/public-api.js.map +1 -1
  408. package/package.json +33 -32
  409. package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +0 -384
  410. package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +0 -1
  411. package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +0 -231
  412. package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +0 -1
  413. package/dist/lib/services/delegation-result-parser.d.ts +0 -50
  414. package/dist/lib/services/delegation-result-parser.d.ts.map +0 -1
  415. package/dist/lib/services/delegation-result-parser.js +0 -60
  416. package/dist/lib/services/delegation-result-parser.js.map +0 -1
  417. package/dist/lib/services/narration-template.d.ts +0 -42
  418. package/dist/lib/services/narration-template.d.ts.map +0 -1
  419. package/dist/lib/services/narration-template.js +0 -73
  420. package/dist/lib/services/narration-template.js.map +0 -1
  421. package/dist/lib/services/skill-picker-narrowing.d.ts +0 -13
  422. package/dist/lib/services/skill-picker-narrowing.d.ts.map +0 -1
  423. package/dist/lib/services/skill-picker-narrowing.js +0 -13
  424. package/dist/lib/services/skill-picker-narrowing.js.map +0 -1
@@ -62,22 +62,102 @@ function CollectionViewComponent_Conditional_18_Template(rf, ctx) { if (rf & 1)
62
62
  export class CollectionViewComponent extends BaseAngularComponent {
63
63
  cdr;
64
64
  confirmService;
65
- collection;
66
- currentUser;
67
- environmentId;
65
+ Collection;
66
+ /** @deprecated Use {@link Collection}. */
67
+ set collection(value) {
68
+ this.Collection = value;
69
+ }
70
+ /** @deprecated Use {@link Collection}. */
71
+ get collection() {
72
+ return this.Collection;
73
+ }
74
+ CurrentUser;
75
+ /** @deprecated Use {@link CurrentUser}. */
76
+ set currentUser(value) {
77
+ this.CurrentUser = value;
78
+ }
79
+ /** @deprecated Use {@link CurrentUser}. */
80
+ get currentUser() {
81
+ return this.CurrentUser;
82
+ }
83
+ EnvironmentId;
84
+ /** @deprecated Use {@link EnvironmentId}. */
85
+ set environmentId(value) {
86
+ this.EnvironmentId = value;
87
+ }
88
+ /** @deprecated Use {@link EnvironmentId}. */
89
+ get environmentId() {
90
+ return this.EnvironmentId;
91
+ }
68
92
  canEdit = true;
69
93
  // Store versions with parent artifact info for display
70
- artifactVersions = [];
71
- viewMode = 'grid';
72
- sortBy = 'date';
73
- selectedArtifactId = null;
74
- selectedVersionNumber = undefined;
75
- showArtifactViewer = false;
76
- sortOptions = [
94
+ ArtifactVersions = [];
95
+ /** @deprecated Use {@link ArtifactVersions}. */
96
+ get artifactVersions() {
97
+ return this.ArtifactVersions;
98
+ }
99
+ /** @deprecated Use {@link ArtifactVersions}. */
100
+ set artifactVersions(value) {
101
+ this.ArtifactVersions = value;
102
+ }
103
+ ViewMode = 'grid';
104
+ /** @deprecated Use {@link ViewMode}. */
105
+ get viewMode() {
106
+ return this.ViewMode;
107
+ }
108
+ /** @deprecated Use {@link ViewMode}. */
109
+ set viewMode(value) {
110
+ this.ViewMode = value;
111
+ }
112
+ SortBy = 'date';
113
+ /** @deprecated Use {@link SortBy}. */
114
+ get sortBy() {
115
+ return this.SortBy;
116
+ }
117
+ /** @deprecated Use {@link SortBy}. */
118
+ set sortBy(value) {
119
+ this.SortBy = value;
120
+ }
121
+ SelectedArtifactId = null;
122
+ /** @deprecated Use {@link SelectedArtifactId}. */
123
+ get selectedArtifactId() {
124
+ return this.SelectedArtifactId;
125
+ }
126
+ /** @deprecated Use {@link SelectedArtifactId}. */
127
+ set selectedArtifactId(value) {
128
+ this.SelectedArtifactId = value;
129
+ }
130
+ SelectedVersionNumber = undefined;
131
+ /** @deprecated Use {@link SelectedVersionNumber}. */
132
+ get selectedVersionNumber() {
133
+ return this.SelectedVersionNumber;
134
+ }
135
+ /** @deprecated Use {@link SelectedVersionNumber}. */
136
+ set selectedVersionNumber(value) {
137
+ this.SelectedVersionNumber = value;
138
+ }
139
+ ShowArtifactViewer = false;
140
+ /** @deprecated Use {@link ShowArtifactViewer}. */
141
+ get showArtifactViewer() {
142
+ return this.ShowArtifactViewer;
143
+ }
144
+ /** @deprecated Use {@link ShowArtifactViewer}. */
145
+ set showArtifactViewer(value) {
146
+ this.ShowArtifactViewer = value;
147
+ }
148
+ SortOptions = [
77
149
  { label: 'Name', value: 'name' },
78
150
  { label: 'Date Modified', value: 'date' },
79
151
  { label: 'Type', value: 'type' }
80
152
  ];
153
+ /** @deprecated Use {@link SortOptions}. */
154
+ get sortOptions() {
155
+ return this.SortOptions;
156
+ }
157
+ /** @deprecated Use {@link SortOptions}. */
158
+ set sortOptions(value) {
159
+ this.SortOptions = value;
160
+ }
81
161
  constructor(cdr, confirmService) {
82
162
  super();
83
163
  this.cdr = cdr;
@@ -93,12 +173,12 @@ export class CollectionViewComponent extends BaseAngularComponent {
93
173
  }
94
174
  ngOnDestroy() {
95
175
  // Close artifact viewer when navigating away from collection
96
- if (this.showArtifactViewer) {
97
- this.onCloseArtifactViewer();
176
+ if (this.ShowArtifactViewer) {
177
+ this.OnCloseArtifactViewer();
98
178
  }
99
179
  }
100
180
  async loadArtifacts() {
101
- if (!this.collection)
181
+ if (!this.Collection)
102
182
  return;
103
183
  try {
104
184
  const rv = RunView.FromMetadataProvider(this.ProviderToUse);
@@ -109,11 +189,11 @@ export class CollectionViewComponent extends BaseAngularComponent {
109
189
  ExtraFilter: `ID IN (
110
190
  SELECT ca.ArtifactVersionID
111
191
  FROM [__mj].[vwCollectionArtifacts] ca
112
- WHERE ca.CollectionID='${this.collection.ID}'
192
+ WHERE ca.CollectionID='${this.Collection.ID}'
113
193
  )`,
114
194
  OrderBy: this.getVersionOrderBy(),
115
195
  ResultType: 'entity_object'
116
- }, this.currentUser);
196
+ }, this.CurrentUser);
117
197
  if (versionResult.Success && versionResult.Results) {
118
198
  // Get unique artifact IDs
119
199
  const artifactIds = [...new Set(versionResult.Results.map(v => v.ArtifactID))];
@@ -125,13 +205,13 @@ export class CollectionViewComponent extends BaseAngularComponent {
125
205
  EntityName: 'MJ: Artifacts',
126
206
  ExtraFilter: artifactFilter,
127
207
  ResultType: 'entity_object'
128
- }, this.currentUser);
208
+ }, this.CurrentUser);
129
209
  if (artifactResult.Success && artifactResult.Results) {
130
210
  artifactResult.Results.forEach(a => artifactMap.set(a.ID, a));
131
211
  }
132
212
  }
133
213
  // Combine version + artifact info
134
- this.artifactVersions = versionResult.Results
214
+ this.ArtifactVersions = versionResult.Results
135
215
  .map(version => ({
136
216
  version,
137
217
  artifact: artifactMap.get(version.ArtifactID)
@@ -139,16 +219,16 @@ export class CollectionViewComponent extends BaseAngularComponent {
139
219
  .filter(item => item.artifact != null); // Filter out any without parent artifact
140
220
  }
141
221
  else {
142
- this.artifactVersions = [];
222
+ this.ArtifactVersions = [];
143
223
  }
144
224
  }
145
225
  catch (error) {
146
226
  console.error('Failed to load collection artifacts:', error);
147
- this.artifactVersions = [];
227
+ this.ArtifactVersions = [];
148
228
  }
149
229
  }
150
230
  getVersionOrderBy() {
151
- switch (this.sortBy) {
231
+ switch (this.SortBy) {
152
232
  case 'name':
153
233
  return 'Name ASC, VersionNumber DESC';
154
234
  case 'type':
@@ -159,28 +239,48 @@ export class CollectionViewComponent extends BaseAngularComponent {
159
239
  return '__mj_UpdatedAt DESC';
160
240
  }
161
241
  }
162
- onSortChange() {
242
+ OnSortChange() {
163
243
  this.loadArtifacts();
164
244
  }
165
- onArtifactSelected(item) {
245
+ /** @deprecated Use {@link OnSortChange}. */
246
+ onSortChange() {
247
+ return this.OnSortChange();
248
+ }
249
+ OnArtifactSelected(item) {
166
250
  // TODO: Emit event or navigate to artifact detail view
167
251
  }
168
- onViewArtifact(item) {
169
- this.selectedArtifactId = item.artifact.ID;
170
- this.selectedVersionNumber = item.version.VersionNumber;
252
+ /** @deprecated Use {@link OnArtifactSelected}. */
253
+ onArtifactSelected(item) {
254
+ return this.OnArtifactSelected(item);
255
+ }
256
+ OnViewArtifact(item) {
257
+ this.SelectedArtifactId = item.artifact.ID;
258
+ this.SelectedVersionNumber = item.version.VersionNumber;
171
259
  // Force change detection to ensure Input bindings propagate before component creation
172
260
  this.cdr.detectChanges();
173
- this.showArtifactViewer = true;
261
+ this.ShowArtifactViewer = true;
174
262
  }
263
+ /** @deprecated Use {@link OnViewArtifact}. */
264
+ onViewArtifact(item) {
265
+ return this.OnViewArtifact(item);
266
+ }
267
+ OnCloseArtifactViewer() {
268
+ this.ShowArtifactViewer = false;
269
+ this.SelectedArtifactId = null;
270
+ this.SelectedVersionNumber = undefined;
271
+ }
272
+ /** @deprecated Use {@link OnCloseArtifactViewer}. */
175
273
  onCloseArtifactViewer() {
176
- this.showArtifactViewer = false;
177
- this.selectedArtifactId = null;
178
- this.selectedVersionNumber = undefined;
274
+ return this.OnCloseArtifactViewer();
179
275
  }
180
- onEditArtifact(item) {
276
+ OnEditArtifact(item) {
181
277
  // TODO: Open artifact editor
182
278
  }
183
- async onRemoveArtifact(item) {
279
+ /** @deprecated Use {@link OnEditArtifact}. */
280
+ onEditArtifact(item) {
281
+ return this.OnEditArtifact(item);
282
+ }
283
+ async OnRemoveArtifact(item) {
184
284
  const versionLabel = `"${item.artifact.Name}" v${item.version.VersionNumber}`;
185
285
  if (!(await this.confirmService.ConfirmDelete({ title: 'Remove from Collection', message: `Remove ${versionLabel} from this collection?`, confirmText: 'Remove' })))
186
286
  return;
@@ -189,9 +289,9 @@ export class CollectionViewComponent extends BaseAngularComponent {
189
289
  const rv = RunView.FromMetadataProvider(this.ProviderToUse);
190
290
  const result = await rv.RunView({
191
291
  EntityName: 'MJ: Collection Artifacts',
192
- ExtraFilter: `CollectionID='${this.collection.ID}' AND ArtifactVersionID='${item.version.ID}'`,
292
+ ExtraFilter: `CollectionID='${this.Collection.ID}' AND ArtifactVersionID='${item.version.ID}'`,
193
293
  ResultType: 'entity_object'
194
- }, this.currentUser);
294
+ }, this.CurrentUser);
195
295
  if (result.Success && result.Results && result.Results.length > 0) {
196
296
  // Delete all version associations atomically
197
297
  const md = this.ProviderToUse;
@@ -215,7 +315,11 @@ export class CollectionViewComponent extends BaseAngularComponent {
215
315
  MJNotificationService.Instance.CreateSimpleNotification('Failed to remove artifact version from collection', 'error');
216
316
  }
217
317
  }
218
- async onAddArtifact() {
318
+ /** @deprecated Use {@link OnRemoveArtifact}. */
319
+ async onRemoveArtifact(item) {
320
+ return this.OnRemoveArtifact(item);
321
+ }
322
+ async OnAddArtifact() {
219
323
  // TODO: Open artifact picker dialog
220
324
  // For now, just show a simple prompt
221
325
  const name = prompt('Enter artifact name:');
@@ -224,7 +328,7 @@ export class CollectionViewComponent extends BaseAngularComponent {
224
328
  try {
225
329
  // Create new artifact
226
330
  const md = this.ProviderToUse;
227
- const artifact = await md.GetEntityObject('MJ: Artifacts', this.currentUser);
331
+ const artifact = await md.GetEntityObject('MJ: Artifacts', this.CurrentUser);
228
332
  artifact.Name = name;
229
333
  // Type is read-only, set via TypeID instead
230
334
  // For now, skip setting type - it has a default
@@ -238,14 +342,14 @@ export class CollectionViewComponent extends BaseAngularComponent {
238
342
  OrderBy: 'VersionNumber DESC',
239
343
  MaxRows: 1,
240
344
  ResultType: 'entity_object'
241
- }, this.currentUser);
345
+ }, this.CurrentUser);
242
346
  if (!versionResult.Success || !versionResult.Results || versionResult.Results.length === 0) {
243
347
  alert('Failed to get artifact version');
244
348
  return;
245
349
  }
246
350
  // Add to collection via join table using version ID
247
- const joinRecord = await md.GetEntityObject('MJ: Collection Artifacts', this.currentUser);
248
- joinRecord.CollectionID = this.collection.ID;
351
+ const joinRecord = await md.GetEntityObject('MJ: Collection Artifacts', this.CurrentUser);
352
+ joinRecord.CollectionID = this.Collection.ID;
249
353
  joinRecord.ArtifactVersionID = versionResult.Results[0].ID;
250
354
  await joinRecord.Save();
251
355
  await this.loadArtifacts();
@@ -256,8 +360,12 @@ export class CollectionViewComponent extends BaseAngularComponent {
256
360
  alert('Failed to add artifact');
257
361
  }
258
362
  }
363
+ /** @deprecated Use {@link OnAddArtifact}. */
364
+ async onAddArtifact() {
365
+ return this.OnAddArtifact();
366
+ }
259
367
  static ɵfac = function CollectionViewComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CollectionViewComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.MJConfirmService)); };
260
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CollectionViewComponent, selectors: [["mj-collection-view"]], inputs: { collection: "collection", currentUser: "currentUser", environmentId: "environmentId", canEdit: "canEdit" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 19, vars: 13, consts: [[1, "collection-view"], [1, "view-header"], [1, "header-actions"], [1, "view-mode-toggle"], ["title", "Grid View", 1, "mode-btn", 3, "click"], [1, "fas", "fa-grid"], ["title", "List View", 1, "mode-btn", 3, "click"], [1, "fas", "fa-list"], [1, "mj-select", 2, "width", "150px", 3, "ngModelChange", "ngModel"], [3, "value"], ["title", "Add Artifact", 1, "btn-add"], [1, "view-content"], ["Icon", "fa-solid fa-folder-open", "Title", "This collection is empty", "ActionIcon", "fa-solid fa-plus", 3, "ActionText"], [3, "artifact", "version"], [1, "artifact-viewer-overlay"], ["title", "Add Artifact", 1, "btn-add", 3, "click"], [1, "fas", "fa-plus"], ["Icon", "fa-solid fa-folder-open", "Title", "This collection is empty", "ActionIcon", "fa-solid fa-plus", 3, "Action", "ActionText"], [3, "selected", "viewed", "edited", "removed", "artifact", "version"], [1, "artifact-viewer-overlay", 3, "click"], [1, "artifact-viewer-container", 3, "click"], [3, "closed", "artifactId", "versionNumber", "currentUser", "environmentId", "viewContext", "contextCollectionId"]], template: function CollectionViewComponent_Template(rf, ctx) { if (rf & 1) {
368
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CollectionViewComponent, selectors: [["mj-collection-view"]], inputs: { Collection: "Collection", collection: "collection", CurrentUser: "CurrentUser", currentUser: "currentUser", EnvironmentId: "EnvironmentId", environmentId: "environmentId", canEdit: "canEdit" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 19, vars: 13, consts: [[1, "collection-view"], [1, "view-header"], [1, "header-actions"], [1, "view-mode-toggle"], ["title", "Grid View", 1, "mode-btn", 3, "click"], [1, "fas", "fa-grid"], ["title", "List View", 1, "mode-btn", 3, "click"], [1, "fas", "fa-list"], [1, "mj-select", 2, "width", "150px", 3, "ngModelChange", "ngModel"], [3, "value"], ["title", "Add Artifact", 1, "btn-add"], [1, "view-content"], ["Icon", "fa-solid fa-folder-open", "Title", "This collection is empty", "ActionIcon", "fa-solid fa-plus", 3, "ActionText"], [3, "artifact", "version"], [1, "artifact-viewer-overlay"], ["title", "Add Artifact", 1, "btn-add", 3, "click"], [1, "fas", "fa-plus"], ["Icon", "fa-solid fa-folder-open", "Title", "This collection is empty", "ActionIcon", "fa-solid fa-plus", 3, "Action", "ActionText"], [3, "selected", "viewed", "edited", "removed", "artifact", "version"], [1, "artifact-viewer-overlay", 3, "click"], [1, "artifact-viewer-container", 3, "click"], [3, "closed", "artifactId", "versionNumber", "currentUser", "environmentId", "viewContext", "contextCollectionId"]], template: function CollectionViewComponent_Template(rf, ctx) { if (rf & 1) {
261
369
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h2");
262
370
  i0.ɵɵtext(3);
263
371
  i0.ɵɵelementEnd();
@@ -386,10 +494,16 @@ export class CollectionViewComponent extends BaseAngularComponent {
386
494
  </div>
387
495
  }
388
496
  `, styles: ["\n .collection-view { display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface); }\n\n .view-header { padding: 20px 24px; border-bottom: 1px solid var(--mj-border-default); display: flex; justify-content: space-between; align-items: center; }\n .view-header h2 { margin: 0; font-size: 20px; flex: 1; }\n\n .header-actions { display: flex; align-items: center; gap: 12px; }\n\n .view-mode-toggle { display: flex; border: 1px solid var(--mj-border-default); border-radius: 4px; overflow: hidden; }\n .mode-btn { padding: 8px 12px; background: var(--mj-bg-surface); border: none; border-right: 1px solid var(--mj-border-default); cursor: pointer; color: var(--mj-text-muted); transition: all 150ms ease; }\n .mode-btn:last-child { border-right: none; }\n .mode-btn:hover { background: var(--mj-bg-surface-sunken); }\n .mode-btn.active { background: var(--mj-brand-primary); color: var(--mj-text-inverse); }\n\n .btn-add { padding: 8px 16px; background: var(--mj-brand-primary); color: var(--mj-text-inverse); border: none; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; }\n .btn-add:hover { background: var(--mj-brand-primary-hover); }\n\n .view-content { flex: 1; overflow-y: auto; padding: 24px; }\n .view-content.grid-mode { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }\n .view-content.list-mode { display: flex; flex-direction: column; gap: 12px; }\n\n .artifact-viewer-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--mj-bg-overlay); display: flex; align-items: center; justify-content: center; z-index: 10000; }\n .artifact-viewer-container { width: 90%; max-width: 1200px; height: 90vh; background: var(--mj-bg-surface); border-radius: 12px; overflow: hidden; box-shadow: var(--mj-shadow-lg); }\n "] }]
389
- }], () => [{ type: i0.ChangeDetectorRef }, { type: i1.MJConfirmService }], { collection: [{
497
+ }], () => [{ type: i0.ChangeDetectorRef }, { type: i1.MJConfirmService }], { Collection: [{
498
+ type: Input
499
+ }], collection: [{
500
+ type: Input
501
+ }], CurrentUser: [{
390
502
  type: Input
391
503
  }], currentUser: [{
392
504
  type: Input
505
+ }], EnvironmentId: [{
506
+ type: Input
393
507
  }], environmentId: [{
394
508
  type: Input
395
509
  }], canEdit: [{
@@ -1 +1 @@
1
- {"version":3,"file":"collection-view.component.js","sourceRoot":"","sources":["../../../../src/lib/components/collection/collection-view.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAkE,MAAM,eAAe,CAAC;AACjH,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAY,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;;;;;;;;;IAqC3D,iCAA+B;IAAA,YAAkB;IAAA,iBAAS;;;IAAlD,uCAAsB;IAAC,cAAkB;IAAlB,qCAAkB;;;;IAKnD,kCAAuE;IAA/C,4LAAS,sBAAe,KAAC;IAC/C,wBAA2B;IAAC,qBAC9B;IAAA,iBAAS;;;;IAOX,0CAK+B;IAA7B,sMAAU,sBAAe,KAAC;IAL5B,iBAK+B;;;IAF7B,iEAA4C;;;;IAM9C,uDAMqC;IAAnC,AADA,AADA,AADA,yOAAY,kCAAwB,KAAC,wNAC3B,8BAAoB,KAAC,wNACrB,8BAAoB,KAAC,0NACpB,gCAAsB,KAAC;IACpC,iBAA8B;;;IAL5B,AADA,2CAA0B,4BACF;;;;IAY9B,+BAAuE;IAAlC,yLAAS,8BAAuB,KAAC;IACpE,+BAA0E;IAAnC,sHAAS,wBAAwB,I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ACH,CAAC;iHAlOU,uBAAuB;6DAAvB,uBAAuB;YAtG5B,AADF,AADF,8BAA6B,aACF,SACnB;YAAA,YAAqC;YAAA,iBAAK;YAG1C,AADF,AADF,8BAA4B,aACI,gBAKR;YADlB,mHAAoB,MAAM,IAAC;YAE3B,uBAA2B;YAC7B,iBAAS;YACT,iCAIoB;YADlB,mHAAoB,MAAM,IAAC;YAE3B,uBAA2B;YAE/B,AADE,iBAAS,EACL;YAEN,kCAIwB;YAHtB,+MAAoB;YACpB,qHAAiB,kBAAc,IAAC;YAGhC,+FAEC;YACH,iBAAS;YAET,+FAAe;YAMnB,AADE,iBAAM,EACF;YAEN,gCAA0G;YACxG,uGAAqC;YASrC,qHASC;YAEL,AADE,iBAAM,EACF;YAGN,4FAAgD;;YA7DxC,eAAqC;YAArC,yDAAqC;YAKnC,eAAoC;YAApC,iDAAoC;YAOpC,eAAoC;YAApC,iDAAoC;YAQtC,eAAoB;YAApB,0CAAoB;YAIpB,cAEC;YAFD,8BAEC;YAGH,eAIC;YAJD,uCAIC;YAIqB,cAAuC;YAAC,AAAxC,oDAAuC,sCAAwC;YACvG,cAOC;YAPD,6DAOC;YAED,cASC;YATD,mCASC;YAKL,eAcC;YAdD,4EAcC;;;iFA2BQ,uBAAuB;cA5GnC,SAAS;6BACI,KAAK,YACP,oBAAoB,YACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+EP;;kBA2BF,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kFAJK,uBAAuB","sourcesContent":["import { Component, Input, OnInit, OnChanges, OnDestroy, SimpleChanges, ChangeDetectorRef } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCollectionEntity, MJArtifactEntity, MJArtifactVersionEntity, MJCollectionArtifactEntity } from '@memberjunction/core-entities';\nimport { UserInfo, RunView, Metadata } from '@memberjunction/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\n\ntype ViewMode = 'grid' | 'list';\ntype SortBy = 'name' | 'date' | 'type';\n\n@Component({\n standalone: false,\n selector: 'mj-collection-view',\n template: `\n <div class=\"collection-view\">\n <div class=\"view-header\">\n <h2>{{ collection.Name || 'Collection' }}</h2>\n <div class=\"header-actions\">\n <div class=\"view-mode-toggle\">\n <button\n class=\"mode-btn\"\n [class.active]=\"viewMode === 'grid'\"\n (click)=\"viewMode = 'grid'\"\n title=\"Grid View\">\n <i class=\"fas fa-grid\"></i>\n </button>\n <button\n class=\"mode-btn\"\n [class.active]=\"viewMode === 'list'\"\n (click)=\"viewMode = 'list'\"\n title=\"List View\">\n <i class=\"fas fa-list\"></i>\n </button>\n </div>\n \n <select\n [(ngModel)]=\"sortBy\"\n (ngModelChange)=\"onSortChange()\"\n class=\"mj-select\"\n style=\"width: 150px;\">\n @for (option of sortOptions; track option.value) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n \n @if (canEdit) {\n <button class=\"btn-add\" (click)=\"onAddArtifact()\" title=\"Add Artifact\">\n <i class=\"fas fa-plus\"></i> Add\n </button>\n }\n </div>\n </div>\n \n <div class=\"view-content\" [class.grid-mode]=\"viewMode === 'grid'\" [class.list-mode]=\"viewMode === 'list'\">\n @if (artifactVersions.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-folder-open\"\n Title=\"This collection is empty\"\n [ActionText]=\"canEdit ? 'Add Artifact' : ''\"\n ActionIcon=\"fa-solid fa-plus\"\n (Action)=\"onAddArtifact()\" />\n }\n \n @for (item of artifactVersions; track item.version.ID) {\n <mj-collection-artifact-card\n [artifact]=\"item.artifact\"\n [version]=\"item.version\"\n (selected)=\"onArtifactSelected(item)\"\n (viewed)=\"onViewArtifact(item)\"\n (edited)=\"onEditArtifact(item)\"\n (removed)=\"onRemoveArtifact(item)\">\n </mj-collection-artifact-card>\n }\n </div>\n </div>\n \n <!-- Artifact Viewer Panel -->\n @if (showArtifactViewer && selectedArtifactId) {\n <div class=\"artifact-viewer-overlay\" (click)=\"onCloseArtifactViewer()\">\n <div class=\"artifact-viewer-container\" (click)=\"$event.stopPropagation()\">\n <mj-artifact-viewer-panel\n [artifactId]=\"selectedArtifactId\"\n [versionNumber]=\"selectedVersionNumber\"\n [currentUser]=\"currentUser\"\n [environmentId]=\"environmentId\"\n [viewContext]=\"'collection'\"\n [contextCollectionId]=\"collection.ID\"\n (closed)=\"onCloseArtifactViewer()\">\n </mj-artifact-viewer-panel>\n </div>\n </div>\n }\n `,\n styles: [`\n .collection-view { display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface); }\n\n .view-header { padding: 20px 24px; border-bottom: 1px solid var(--mj-border-default); display: flex; justify-content: space-between; align-items: center; }\n .view-header h2 { margin: 0; font-size: 20px; flex: 1; }\n\n .header-actions { display: flex; align-items: center; gap: 12px; }\n\n .view-mode-toggle { display: flex; border: 1px solid var(--mj-border-default); border-radius: 4px; overflow: hidden; }\n .mode-btn { padding: 8px 12px; background: var(--mj-bg-surface); border: none; border-right: 1px solid var(--mj-border-default); cursor: pointer; color: var(--mj-text-muted); transition: all 150ms ease; }\n .mode-btn:last-child { border-right: none; }\n .mode-btn:hover { background: var(--mj-bg-surface-sunken); }\n .mode-btn.active { background: var(--mj-brand-primary); color: var(--mj-text-inverse); }\n\n .btn-add { padding: 8px 16px; background: var(--mj-brand-primary); color: var(--mj-text-inverse); border: none; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; }\n .btn-add:hover { background: var(--mj-brand-primary-hover); }\n\n .view-content { flex: 1; overflow-y: auto; padding: 24px; }\n .view-content.grid-mode { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }\n .view-content.list-mode { display: flex; flex-direction: column; gap: 12px; }\n\n .artifact-viewer-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--mj-bg-overlay); display: flex; align-items: center; justify-content: center; z-index: 10000; }\n .artifact-viewer-container { width: 90%; max-width: 1200px; height: 90vh; background: var(--mj-bg-surface); border-radius: 12px; overflow: hidden; box-shadow: var(--mj-shadow-lg); }\n `]\n})\nexport class CollectionViewComponent extends BaseAngularComponent implements OnInit, OnChanges, OnDestroy {\n @Input() collection!: MJCollectionEntity;\n @Input() currentUser!: UserInfo;\n @Input() environmentId!: string;\n @Input() canEdit: boolean = true;\n\n // Store versions with parent artifact info for display\n public artifactVersions: Array<{\n version: MJArtifactVersionEntity;\n artifact: MJArtifactEntity;\n }> = [];\n public viewMode: ViewMode = 'grid';\n public sortBy: SortBy = 'date';\n public selectedArtifactId: string | null = null;\n public selectedVersionNumber: number | undefined = undefined;\n public showArtifactViewer = false;\n\n public sortOptions = [\n { label: 'Name', value: 'name' },\n { label: 'Date Modified', value: 'date' },\n { label: 'Type', value: 'type' }\n ];\n\n constructor(private cdr: ChangeDetectorRef, private confirmService: MJConfirmService) {\n super();}\n\n ngOnInit() {\n this.loadArtifacts();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['collection'] && !changes['collection'].firstChange) {\n this.loadArtifacts();\n }\n }\n\n ngOnDestroy() {\n // Close artifact viewer when navigating away from collection\n if (this.showArtifactViewer) {\n this.onCloseArtifactViewer();\n }\n }\n\n private async loadArtifacts(): Promise<void> {\n if (!this.collection) return;\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const md = this.ProviderToUse;\n\n // Load ALL VERSIONS in this collection (no DISTINCT - each version is separate)\n const versionResult = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (\n SELECT ca.ArtifactVersionID\n FROM [__mj].[vwCollectionArtifacts] ca\n WHERE ca.CollectionID='${this.collection.ID}'\n )`,\n OrderBy: this.getVersionOrderBy(),\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (versionResult.Success && versionResult.Results) {\n // Get unique artifact IDs\n const artifactIds = [...new Set(versionResult.Results.map(v => v.ArtifactID))];\n\n // Load parent artifact info (just for display metadata - no visibility filtering)\n const artifactMap = new Map<string, MJArtifactEntity>();\n if (artifactIds.length > 0) {\n const artifactFilter = artifactIds.map(id => `ID='${id}'`).join(' OR ');\n const artifactResult = await rv.RunView<MJArtifactEntity>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: artifactFilter,\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (artifactResult.Success && artifactResult.Results) {\n artifactResult.Results.forEach(a => artifactMap.set(a.ID, a));\n }\n }\n\n // Combine version + artifact info\n this.artifactVersions = versionResult.Results\n .map(version => ({\n version,\n artifact: artifactMap.get(version.ArtifactID)!\n }))\n .filter(item => item.artifact != null); // Filter out any without parent artifact\n } else {\n this.artifactVersions = [];\n }\n } catch (error) {\n console.error('Failed to load collection artifacts:', error);\n this.artifactVersions = [];\n }\n }\n\n private getVersionOrderBy(): string {\n switch (this.sortBy) {\n case 'name':\n return 'Name ASC, VersionNumber DESC';\n case 'type':\n // Will sort by parent artifact type (handled in template)\n return 'ArtifactID ASC, VersionNumber DESC';\n case 'date':\n default:\n return '__mj_UpdatedAt DESC';\n }\n }\n\n onSortChange(): void {\n this.loadArtifacts();\n }\n\n onArtifactSelected(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n // TODO: Emit event or navigate to artifact detail view\n }\n\n onViewArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n this.selectedArtifactId = item.artifact.ID;\n this.selectedVersionNumber = item.version.VersionNumber;\n // Force change detection to ensure Input bindings propagate before component creation\n this.cdr.detectChanges();\n this.showArtifactViewer = true;\n }\n\n onCloseArtifactViewer(): void {\n this.showArtifactViewer = false;\n this.selectedArtifactId = null;\n this.selectedVersionNumber = undefined;\n }\n\n onEditArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n // TODO: Open artifact editor\n }\n\n async onRemoveArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): Promise<void> {\n const versionLabel = `\"${item.artifact.Name}\" v${item.version.VersionNumber}`;\n if (!(await this.confirmService.ConfirmDelete({ title: 'Remove from Collection', message: `Remove ${versionLabel} from this collection?`, confirmText: 'Remove' }))) return;\n\n try {\n // Delete THIS SPECIFIC VERSION from the collection\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView({\n EntityName: 'MJ: Collection Artifacts',\n ExtraFilter: `CollectionID='${this.collection.ID}' AND ArtifactVersionID='${item.version.ID}'`,\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (result.Success && result.Results && result.Results.length > 0) {\n // Delete all version associations atomically\n const md = this.ProviderToUse;\n const tg = await md.CreateTransactionGroup();\n for (const joinRecord of result.Results) {\n joinRecord.TransactionGroup = tg;\n await joinRecord.Delete();\n }\n const success = await tg.Submit();\n if (!success) {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to remove ${versionLabel} from collection`,\n 'error'\n );\n return;\n }\n await this.loadArtifacts();\n this.cdr.detectChanges();\n MJNotificationService.Instance.CreateSimpleNotification(\n `Removed ${versionLabel} from collection`,\n 'success',\n 3000\n );\n }\n } catch (error) {\n console.error('Failed to remove artifact version from collection:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to remove artifact version from collection',\n 'error'\n );\n }\n }\n\n async onAddArtifact(): Promise<void> {\n // TODO: Open artifact picker dialog\n // For now, just show a simple prompt\n const name = prompt('Enter artifact name:');\n if (!name) return;\n\n try {\n // Create new artifact\n const md = this.ProviderToUse;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', this.currentUser);\n\n artifact.Name = name;\n // Type is read-only, set via TypeID instead\n // For now, skip setting type - it has a default\n\n const saved = await artifact.Save();\n if (saved) {\n // Get the latest version of this artifact to add to collection\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const versionResult = await rv.RunView({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ArtifactID='${artifact.ID}'`,\n OrderBy: 'VersionNumber DESC',\n MaxRows: 1,\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (!versionResult.Success || !versionResult.Results || versionResult.Results.length === 0) {\n alert('Failed to get artifact version');\n return;\n }\n\n // Add to collection via join table using version ID\n const joinRecord = await md.GetEntityObject<MJCollectionArtifactEntity>('MJ: Collection Artifacts', this.currentUser);\n joinRecord.CollectionID = this.collection.ID;\n joinRecord.ArtifactVersionID = versionResult.Results[0].ID;\n\n await joinRecord.Save();\n await this.loadArtifacts();\n }\n } catch (error) {\n console.error('Failed to add artifact:', error);\n alert('Failed to add artifact');\n }\n }\n}"]}
1
+ {"version":3,"file":"collection-view.component.js","sourceRoot":"","sources":["../../../../src/lib/components/collection/collection-view.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAkE,MAAM,eAAe,CAAC;AACjH,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAY,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;;;;;;;;;IAqC3D,iCAA+B;IAAA,YAAkB;IAAA,iBAAS;;;IAAlD,uCAAsB;IAAC,cAAkB;IAAlB,qCAAkB;;;;IAKnD,kCAAuE;IAA/C,4LAAS,sBAAe,KAAC;IAC/C,wBAA2B;IAAC,qBAC9B;IAAA,iBAAS;;;;IAOX,0CAK+B;IAA7B,sMAAU,sBAAe,KAAC;IAL5B,iBAK+B;;;IAF7B,iEAA4C;;;;IAM9C,uDAMqC;IAAnC,AADA,AADA,AADA,yOAAY,kCAAwB,KAAC,wNAC3B,8BAAoB,KAAC,wNACrB,8BAAoB,KAAC,0NACpB,gCAAsB,KAAC;IACpC,iBAA8B;;;IAL5B,AADA,2CAA0B,4BACF;;;;IAY9B,+BAAuE;IAAlC,yLAAS,8BAAuB,KAAC;IACpE,+BAA0E;IAAnC,sHAAS,wBAAwB,IA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AC;IAED,6CAA6C;IAC7C,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;iHArWU,uBAAuB;6DAAvB,uBAAuB;YAtG5B,AADF,AADF,8BAA6B,aACF,SACnB;YAAA,YAAqC;YAAA,iBAAK;YAG1C,AADF,AADF,8BAA4B,aACI,gBAKR;YADlB,mHAAoB,MAAM,IAAC;YAE3B,uBAA2B;YAC7B,iBAAS;YACT,iCAIoB;YADlB,mHAAoB,MAAM,IAAC;YAE3B,uBAA2B;YAE/B,AADE,iBAAS,EACL;YAEN,kCAIwB;YAHtB,+MAAoB;YACpB,qHAAiB,kBAAc,IAAC;YAGhC,+FAEC;YACH,iBAAS;YAET,+FAAe;YAMnB,AADE,iBAAM,EACF;YAEN,gCAA0G;YACxG,uGAAqC;YASrC,qHASC;YAEL,AADE,iBAAM,EACF;YAGN,4FAAgD;;YA7DxC,eAAqC;YAArC,yDAAqC;YAKnC,eAAoC;YAApC,iDAAoC;YAOpC,eAAoC;YAApC,iDAAoC;YAQtC,eAAoB;YAApB,0CAAoB;YAIpB,cAEC;YAFD,8BAEC;YAGH,eAIC;YAJD,uCAIC;YAIqB,cAAuC;YAAC,AAAxC,oDAAuC,sCAAwC;YACvG,cAOC;YAPD,6DAOC;YAED,cASC;YATD,mCASC;YAKL,eAcC;YAdD,4EAcC;;;iFA2BQ,uBAAuB;cA5GnC,SAAS;6BACI,KAAK,YACP,oBAAoB,YACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+EP;;kBA2BF,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kFA/BK,uBAAuB","sourcesContent":["import { Component, Input, OnInit, OnChanges, OnDestroy, SimpleChanges, ChangeDetectorRef } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCollectionEntity, MJArtifactEntity, MJArtifactVersionEntity, MJCollectionArtifactEntity } from '@memberjunction/core-entities';\nimport { UserInfo, RunView, Metadata } from '@memberjunction/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\n\ntype ViewMode = 'grid' | 'list';\ntype SortBy = 'name' | 'date' | 'type';\n\n@Component({\n standalone: false,\n selector: 'mj-collection-view',\n template: `\n <div class=\"collection-view\">\n <div class=\"view-header\">\n <h2>{{ collection.Name || 'Collection' }}</h2>\n <div class=\"header-actions\">\n <div class=\"view-mode-toggle\">\n <button\n class=\"mode-btn\"\n [class.active]=\"viewMode === 'grid'\"\n (click)=\"viewMode = 'grid'\"\n title=\"Grid View\">\n <i class=\"fas fa-grid\"></i>\n </button>\n <button\n class=\"mode-btn\"\n [class.active]=\"viewMode === 'list'\"\n (click)=\"viewMode = 'list'\"\n title=\"List View\">\n <i class=\"fas fa-list\"></i>\n </button>\n </div>\n \n <select\n [(ngModel)]=\"sortBy\"\n (ngModelChange)=\"onSortChange()\"\n class=\"mj-select\"\n style=\"width: 150px;\">\n @for (option of sortOptions; track option.value) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n \n @if (canEdit) {\n <button class=\"btn-add\" (click)=\"onAddArtifact()\" title=\"Add Artifact\">\n <i class=\"fas fa-plus\"></i> Add\n </button>\n }\n </div>\n </div>\n \n <div class=\"view-content\" [class.grid-mode]=\"viewMode === 'grid'\" [class.list-mode]=\"viewMode === 'list'\">\n @if (artifactVersions.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-folder-open\"\n Title=\"This collection is empty\"\n [ActionText]=\"canEdit ? 'Add Artifact' : ''\"\n ActionIcon=\"fa-solid fa-plus\"\n (Action)=\"onAddArtifact()\" />\n }\n \n @for (item of artifactVersions; track item.version.ID) {\n <mj-collection-artifact-card\n [artifact]=\"item.artifact\"\n [version]=\"item.version\"\n (selected)=\"onArtifactSelected(item)\"\n (viewed)=\"onViewArtifact(item)\"\n (edited)=\"onEditArtifact(item)\"\n (removed)=\"onRemoveArtifact(item)\">\n </mj-collection-artifact-card>\n }\n </div>\n </div>\n \n <!-- Artifact Viewer Panel -->\n @if (showArtifactViewer && selectedArtifactId) {\n <div class=\"artifact-viewer-overlay\" (click)=\"onCloseArtifactViewer()\">\n <div class=\"artifact-viewer-container\" (click)=\"$event.stopPropagation()\">\n <mj-artifact-viewer-panel\n [artifactId]=\"selectedArtifactId\"\n [versionNumber]=\"selectedVersionNumber\"\n [currentUser]=\"currentUser\"\n [environmentId]=\"environmentId\"\n [viewContext]=\"'collection'\"\n [contextCollectionId]=\"collection.ID\"\n (closed)=\"onCloseArtifactViewer()\">\n </mj-artifact-viewer-panel>\n </div>\n </div>\n }\n `,\n styles: [`\n .collection-view { display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface); }\n\n .view-header { padding: 20px 24px; border-bottom: 1px solid var(--mj-border-default); display: flex; justify-content: space-between; align-items: center; }\n .view-header h2 { margin: 0; font-size: 20px; flex: 1; }\n\n .header-actions { display: flex; align-items: center; gap: 12px; }\n\n .view-mode-toggle { display: flex; border: 1px solid var(--mj-border-default); border-radius: 4px; overflow: hidden; }\n .mode-btn { padding: 8px 12px; background: var(--mj-bg-surface); border: none; border-right: 1px solid var(--mj-border-default); cursor: pointer; color: var(--mj-text-muted); transition: all 150ms ease; }\n .mode-btn:last-child { border-right: none; }\n .mode-btn:hover { background: var(--mj-bg-surface-sunken); }\n .mode-btn.active { background: var(--mj-brand-primary); color: var(--mj-text-inverse); }\n\n .btn-add { padding: 8px 16px; background: var(--mj-brand-primary); color: var(--mj-text-inverse); border: none; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; }\n .btn-add:hover { background: var(--mj-brand-primary-hover); }\n\n .view-content { flex: 1; overflow-y: auto; padding: 24px; }\n .view-content.grid-mode { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }\n .view-content.list-mode { display: flex; flex-direction: column; gap: 12px; }\n\n .artifact-viewer-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--mj-bg-overlay); display: flex; align-items: center; justify-content: center; z-index: 10000; }\n .artifact-viewer-container { width: 90%; max-width: 1200px; height: 90vh; background: var(--mj-bg-surface); border-radius: 12px; overflow: hidden; box-shadow: var(--mj-shadow-lg); }\n `]\n})\nexport class CollectionViewComponent extends BaseAngularComponent implements OnInit, OnChanges, OnDestroy {\n @Input() Collection!: MJCollectionEntity;\n\n /** @deprecated Use {@link Collection}. */\n @Input() set collection(value: MJCollectionEntity) {\n this.Collection = value;\n }\n /** @deprecated Use {@link Collection}. */\n get collection(): MJCollectionEntity {\n return this.Collection;\n }\n @Input() CurrentUser!: UserInfo;\n\n /** @deprecated Use {@link CurrentUser}. */\n @Input() set currentUser(value: UserInfo) {\n this.CurrentUser = value;\n }\n /** @deprecated Use {@link CurrentUser}. */\n get currentUser(): UserInfo {\n return this.CurrentUser;\n }\n @Input() EnvironmentId!: string;\n\n /** @deprecated Use {@link EnvironmentId}. */\n @Input() set environmentId(value: string) {\n this.EnvironmentId = value;\n }\n /** @deprecated Use {@link EnvironmentId}. */\n get environmentId(): string {\n return this.EnvironmentId;\n }\n @Input() canEdit: boolean = true;\n\n // Store versions with parent artifact info for display\n public ArtifactVersions: Array<{\n version: MJArtifactVersionEntity;\n artifact: MJArtifactEntity;\n }> = [];\n\n /** @deprecated Use {@link ArtifactVersions}. */\n public get artifactVersions(): Array<{\n version: MJArtifactVersionEntity;\n artifact: MJArtifactEntity;\n }> {\n return this.ArtifactVersions;\n }\n /** @deprecated Use {@link ArtifactVersions}. */\n public set artifactVersions(value: Array<{\n version: MJArtifactVersionEntity;\n artifact: MJArtifactEntity;\n }>) {\n this.ArtifactVersions = value;\n }\n public ViewMode: ViewMode = 'grid';\n\n /** @deprecated Use {@link ViewMode}. */\n public get viewMode(): ViewMode {\n return this.ViewMode;\n }\n /** @deprecated Use {@link ViewMode}. */\n public set viewMode(value: ViewMode) {\n this.ViewMode = value;\n }\n public SortBy: SortBy = 'date';\n\n /** @deprecated Use {@link SortBy}. */\n public get sortBy(): SortBy {\n return this.SortBy;\n }\n /** @deprecated Use {@link SortBy}. */\n public set sortBy(value: SortBy) {\n this.SortBy = value;\n }\n public SelectedArtifactId: string | null = null;\n\n /** @deprecated Use {@link SelectedArtifactId}. */\n public get selectedArtifactId(): string | null {\n return this.SelectedArtifactId;\n }\n /** @deprecated Use {@link SelectedArtifactId}. */\n public set selectedArtifactId(value: string | null) {\n this.SelectedArtifactId = value;\n }\n public SelectedVersionNumber: number | undefined = undefined;\n\n /** @deprecated Use {@link SelectedVersionNumber}. */\n public get selectedVersionNumber(): number | undefined {\n return this.SelectedVersionNumber;\n }\n /** @deprecated Use {@link SelectedVersionNumber}. */\n public set selectedVersionNumber(value: number | undefined) {\n this.SelectedVersionNumber = value;\n }\n public ShowArtifactViewer = false;\n\n /** @deprecated Use {@link ShowArtifactViewer}. */\n public get showArtifactViewer() {\n return this.ShowArtifactViewer;\n }\n /** @deprecated Use {@link ShowArtifactViewer}. */\n public set showArtifactViewer(value) {\n this.ShowArtifactViewer = value;\n }\n\n public SortOptions = [\n { label: 'Name', value: 'name' },\n { label: 'Date Modified', value: 'date' },\n { label: 'Type', value: 'type' }\n ];\n\n /** @deprecated Use {@link SortOptions}. */\n public get sortOptions() {\n return this.SortOptions;\n }\n /** @deprecated Use {@link SortOptions}. */\n public set sortOptions(value) {\n this.SortOptions = value;\n }\n\n constructor(private cdr: ChangeDetectorRef, private confirmService: MJConfirmService) {\n super();}\n\n ngOnInit() {\n this.loadArtifacts();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['collection'] && !changes['collection'].firstChange) {\n this.loadArtifacts();\n }\n }\n\n ngOnDestroy() {\n // Close artifact viewer when navigating away from collection\n if (this.ShowArtifactViewer) {\n this.OnCloseArtifactViewer();\n }\n }\n\n private async loadArtifacts(): Promise<void> {\n if (!this.Collection) return;\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const md = this.ProviderToUse;\n\n // Load ALL VERSIONS in this collection (no DISTINCT - each version is separate)\n const versionResult = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (\n SELECT ca.ArtifactVersionID\n FROM [__mj].[vwCollectionArtifacts] ca\n WHERE ca.CollectionID='${this.Collection.ID}'\n )`,\n OrderBy: this.getVersionOrderBy(),\n ResultType: 'entity_object'\n }, this.CurrentUser);\n\n if (versionResult.Success && versionResult.Results) {\n // Get unique artifact IDs\n const artifactIds = [...new Set(versionResult.Results.map(v => v.ArtifactID))];\n\n // Load parent artifact info (just for display metadata - no visibility filtering)\n const artifactMap = new Map<string, MJArtifactEntity>();\n if (artifactIds.length > 0) {\n const artifactFilter = artifactIds.map(id => `ID='${id}'`).join(' OR ');\n const artifactResult = await rv.RunView<MJArtifactEntity>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: artifactFilter,\n ResultType: 'entity_object'\n }, this.CurrentUser);\n\n if (artifactResult.Success && artifactResult.Results) {\n artifactResult.Results.forEach(a => artifactMap.set(a.ID, a));\n }\n }\n\n // Combine version + artifact info\n this.ArtifactVersions = versionResult.Results\n .map(version => ({\n version,\n artifact: artifactMap.get(version.ArtifactID)!\n }))\n .filter(item => item.artifact != null); // Filter out any without parent artifact\n } else {\n this.ArtifactVersions = [];\n }\n } catch (error) {\n console.error('Failed to load collection artifacts:', error);\n this.ArtifactVersions = [];\n }\n }\n\n private getVersionOrderBy(): string {\n switch (this.SortBy) {\n case 'name':\n return 'Name ASC, VersionNumber DESC';\n case 'type':\n // Will sort by parent artifact type (handled in template)\n return 'ArtifactID ASC, VersionNumber DESC';\n case 'date':\n default:\n return '__mj_UpdatedAt DESC';\n }\n }\n\n OnSortChange(): void {\n this.loadArtifacts();\n }\n\n /** @deprecated Use {@link OnSortChange}. */\n onSortChange(): void {\n return this.OnSortChange();\n }\n\n OnArtifactSelected(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n // TODO: Emit event or navigate to artifact detail view\n }\n\n /** @deprecated Use {@link OnArtifactSelected}. */\n onArtifactSelected(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n return this.OnArtifactSelected(item);\n }\n\n OnViewArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n this.SelectedArtifactId = item.artifact.ID;\n this.SelectedVersionNumber = item.version.VersionNumber;\n // Force change detection to ensure Input bindings propagate before component creation\n this.cdr.detectChanges();\n this.ShowArtifactViewer = true;\n }\n\n /** @deprecated Use {@link OnViewArtifact}. */\n onViewArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n return this.OnViewArtifact(item);\n }\n\n OnCloseArtifactViewer(): void {\n this.ShowArtifactViewer = false;\n this.SelectedArtifactId = null;\n this.SelectedVersionNumber = undefined;\n }\n\n /** @deprecated Use {@link OnCloseArtifactViewer}. */\n onCloseArtifactViewer(): void {\n return this.OnCloseArtifactViewer();\n }\n\n OnEditArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n // TODO: Open artifact editor\n }\n\n /** @deprecated Use {@link OnEditArtifact}. */\n onEditArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n return this.OnEditArtifact(item);\n }\n\n async OnRemoveArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): Promise<void> {\n const versionLabel = `\"${item.artifact.Name}\" v${item.version.VersionNumber}`;\n if (!(await this.confirmService.ConfirmDelete({ title: 'Remove from Collection', message: `Remove ${versionLabel} from this collection?`, confirmText: 'Remove' }))) return;\n\n try {\n // Delete THIS SPECIFIC VERSION from the collection\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView({\n EntityName: 'MJ: Collection Artifacts',\n ExtraFilter: `CollectionID='${this.Collection.ID}' AND ArtifactVersionID='${item.version.ID}'`,\n ResultType: 'entity_object'\n }, this.CurrentUser);\n\n if (result.Success && result.Results && result.Results.length > 0) {\n // Delete all version associations atomically\n const md = this.ProviderToUse;\n const tg = await md.CreateTransactionGroup();\n for (const joinRecord of result.Results) {\n joinRecord.TransactionGroup = tg;\n await joinRecord.Delete();\n }\n const success = await tg.Submit();\n if (!success) {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to remove ${versionLabel} from collection`,\n 'error'\n );\n return;\n }\n await this.loadArtifacts();\n this.cdr.detectChanges();\n MJNotificationService.Instance.CreateSimpleNotification(\n `Removed ${versionLabel} from collection`,\n 'success',\n 3000\n );\n }\n } catch (error) {\n console.error('Failed to remove artifact version from collection:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to remove artifact version from collection',\n 'error'\n );\n }\n }\n\n /** @deprecated Use {@link OnRemoveArtifact}. */\n async onRemoveArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): Promise<void> {\n return this.OnRemoveArtifact(item);\n }\n\n async OnAddArtifact(): Promise<void> {\n // TODO: Open artifact picker dialog\n // For now, just show a simple prompt\n const name = prompt('Enter artifact name:');\n if (!name) return;\n\n try {\n // Create new artifact\n const md = this.ProviderToUse;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', this.CurrentUser);\n\n artifact.Name = name;\n // Type is read-only, set via TypeID instead\n // For now, skip setting type - it has a default\n\n const saved = await artifact.Save();\n if (saved) {\n // Get the latest version of this artifact to add to collection\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const versionResult = await rv.RunView({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ArtifactID='${artifact.ID}'`,\n OrderBy: 'VersionNumber DESC',\n MaxRows: 1,\n ResultType: 'entity_object'\n }, this.CurrentUser);\n\n if (!versionResult.Success || !versionResult.Results || versionResult.Results.length === 0) {\n alert('Failed to get artifact version');\n return;\n }\n\n // Add to collection via join table using version ID\n const joinRecord = await md.GetEntityObject<MJCollectionArtifactEntity>('MJ: Collection Artifacts', this.CurrentUser);\n joinRecord.CollectionID = this.Collection.ID;\n joinRecord.ArtifactVersionID = versionResult.Results[0].ID;\n\n await joinRecord.Save();\n await this.loadArtifacts();\n }\n } catch (error) {\n console.error('Failed to add artifact:', error);\n alert('Failed to add artifact');\n }\n }\n\n /** @deprecated Use {@link OnAddArtifact}. */\n async onAddArtifact(): Promise<void> {\n return this.OnAddArtifact();\n }\n}"]}