@memberjunction/ng-conversations 4.3.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/lib/components/agent/active-agent-indicator.component.d.ts +6 -6
  2. package/dist/lib/components/agent/active-agent-indicator.component.d.ts.map +1 -1
  3. package/dist/lib/components/agent/active-agent-indicator.component.js.map +1 -1
  4. package/dist/lib/components/agent/agent-process-panel.component.d.ts +2 -2
  5. package/dist/lib/components/agent/agent-process-panel.component.d.ts.map +1 -1
  6. package/dist/lib/components/agent/agent-process-panel.component.js.map +1 -1
  7. package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +2 -2
  8. package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
  9. package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
  10. package/dist/lib/components/artifact/artifact-viewer-panel.component.d.ts +48 -0
  11. package/dist/lib/components/artifact/artifact-viewer-panel.component.d.ts.map +1 -0
  12. package/dist/lib/components/artifact/artifact-viewer-panel.component.js +457 -0
  13. package/dist/lib/components/artifact/artifact-viewer-panel.component.js.map +1 -0
  14. package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts +8 -8
  15. package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts.map +1 -1
  16. package/dist/lib/components/collection/artifact-collection-picker-modal.component.js.map +1 -1
  17. package/dist/lib/components/collection/artifact-create-modal.component.d.ts +4 -4
  18. package/dist/lib/components/collection/artifact-create-modal.component.d.ts.map +1 -1
  19. package/dist/lib/components/collection/artifact-create-modal.component.js.map +1 -1
  20. package/dist/lib/components/collection/collection-artifact-card.component.d.ts +3 -3
  21. package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -1
  22. package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -1
  23. package/dist/lib/components/collection/collection-form-modal.component.d.ts +4 -4
  24. package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
  25. package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
  26. package/dist/lib/components/collection/collection-share-modal.component.d.ts +2 -2
  27. package/dist/lib/components/collection/collection-share-modal.component.d.ts.map +1 -1
  28. package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
  29. package/dist/lib/components/collection/collection-tree.component.d.ts +10 -10
  30. package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
  31. package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
  32. package/dist/lib/components/collection/collection-view.component.d.ts +12 -12
  33. package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
  34. package/dist/lib/components/collection/collection-view.component.js.map +1 -1
  35. package/dist/lib/components/collection/collections-full-view.component.d.ts +25 -25
  36. package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
  37. package/dist/lib/components/collection/collections-full-view.component.js +54 -54
  38. package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
  39. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +17 -17
  40. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
  41. package/dist/lib/components/conversation/conversation-chat-area.component.js +20 -11
  42. package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
  43. package/dist/lib/components/conversation/conversation-list.component.d.ts +9 -9
  44. package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -1
  45. package/dist/lib/components/conversation/conversation-list.component.js.map +1 -1
  46. package/dist/lib/components/delete-confirm/delete-confirm-modal.component.d.ts +52 -0
  47. package/dist/lib/components/delete-confirm/delete-confirm-modal.component.d.ts.map +1 -0
  48. package/dist/lib/components/delete-confirm/delete-confirm-modal.component.js +276 -0
  49. package/dist/lib/components/delete-confirm/delete-confirm-modal.component.js.map +1 -0
  50. package/dist/lib/components/export/export-modal.component.d.ts +2 -2
  51. package/dist/lib/components/export/export-modal.component.d.ts.map +1 -1
  52. package/dist/lib/components/export/export-modal.component.js.map +1 -1
  53. package/dist/lib/components/library/library-full-view.component.d.ts +4 -4
  54. package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
  55. package/dist/lib/components/library/library-full-view.component.js.map +1 -1
  56. package/dist/lib/components/members/members-modal.component.d.ts +2 -2
  57. package/dist/lib/components/members/members-modal.component.d.ts.map +1 -1
  58. package/dist/lib/components/members/members-modal.component.js.map +1 -1
  59. package/dist/lib/components/mention/mention-editor.component.js.map +1 -1
  60. package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
  61. package/dist/lib/components/message/message-input.component.d.ts +6 -6
  62. package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
  63. package/dist/lib/components/message/message-input.component.js.map +1 -1
  64. package/dist/lib/components/message/message-item.component.d.ts +18 -18
  65. package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
  66. package/dist/lib/components/message/message-item.component.js +4 -4
  67. package/dist/lib/components/message/message-item.component.js.map +1 -1
  68. package/dist/lib/components/message/message-list.component.d.ts +13 -13
  69. package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
  70. package/dist/lib/components/message/message-list.component.js.map +1 -1
  71. package/dist/lib/components/project/project-form-modal.component.d.ts +3 -3
  72. package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -1
  73. package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
  74. package/dist/lib/components/project/project-selector.component.d.ts +7 -7
  75. package/dist/lib/components/project/project-selector.component.d.ts.map +1 -1
  76. package/dist/lib/components/project/project-selector.component.js +1 -1
  77. package/dist/lib/components/project/project-selector.component.js.map +1 -1
  78. package/dist/lib/components/share/share-modal.component.d.ts +2 -2
  79. package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
  80. package/dist/lib/components/share/share-modal.component.js +5 -5
  81. package/dist/lib/components/share/share-modal.component.js.map +1 -1
  82. package/dist/lib/components/shared/user-picker.component.js +1 -1
  83. package/dist/lib/components/shared/user-picker.component.js.map +1 -1
  84. package/dist/lib/components/task/tasks-full-view.component.d.ts +9 -9
  85. package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
  86. package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
  87. package/dist/lib/components/tasks/task-widget.component.d.ts +3 -3
  88. package/dist/lib/components/tasks/task-widget.component.d.ts.map +1 -1
  89. package/dist/lib/components/tasks/task-widget.component.js.map +1 -1
  90. package/dist/lib/components/thread/thread-panel.component.d.ts +7 -7
  91. package/dist/lib/components/thread/thread-panel.component.d.ts.map +1 -1
  92. package/dist/lib/components/thread/thread-panel.component.js +2 -2
  93. package/dist/lib/components/thread/thread-panel.component.js.map +1 -1
  94. package/dist/lib/components/workspace/conversation-workspace.component.d.ts +7 -7
  95. package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
  96. package/dist/lib/components/workspace/conversation-workspace.component.js +2 -2
  97. package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
  98. package/dist/lib/models/conversation-complete-query.model.d.ts +9 -9
  99. package/dist/lib/models/conversation-complete-query.model.d.ts.map +1 -1
  100. package/dist/lib/models/conversation-state.model.d.ts +5 -5
  101. package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
  102. package/dist/lib/models/lazy-artifact-info.d.ts +6 -6
  103. package/dist/lib/models/lazy-artifact-info.d.ts.map +1 -1
  104. package/dist/lib/models/lazy-artifact-info.js +2 -2
  105. package/dist/lib/models/lazy-artifact-info.js.map +1 -1
  106. package/dist/lib/services/active-tasks.service.js.map +1 -1
  107. package/dist/lib/services/agent-state.service.d.ts +2 -2
  108. package/dist/lib/services/agent-state.service.d.ts.map +1 -1
  109. package/dist/lib/services/agent-state.service.js.map +1 -1
  110. package/dist/lib/services/artifact-permission.service.d.ts +2 -2
  111. package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
  112. package/dist/lib/services/artifact-permission.service.js.map +1 -1
  113. package/dist/lib/services/artifact-state.service.d.ts +10 -10
  114. package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
  115. package/dist/lib/services/artifact-state.service.js.map +1 -1
  116. package/dist/lib/services/artifact-use-tracking.service.js.map +1 -1
  117. package/dist/lib/services/collection-permission.service.d.ts +2 -2
  118. package/dist/lib/services/collection-permission.service.d.ts.map +1 -1
  119. package/dist/lib/services/collection-permission.service.js.map +1 -1
  120. package/dist/lib/services/conversation-agent.service.d.ts +6 -6
  121. package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
  122. package/dist/lib/services/conversation-agent.service.js +1 -1
  123. package/dist/lib/services/conversation-agent.service.js.map +1 -1
  124. package/dist/lib/services/conversation-attachment.service.d.ts +3 -3
  125. package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
  126. package/dist/lib/services/conversation-attachment.service.js.map +1 -1
  127. package/dist/lib/services/conversation-data.service.d.ts +10 -10
  128. package/dist/lib/services/conversation-data.service.d.ts.map +1 -1
  129. package/dist/lib/services/conversation-data.service.js +4 -4
  130. package/dist/lib/services/conversation-data.service.js.map +1 -1
  131. package/dist/lib/services/conversation-state.service.d.ts +160 -0
  132. package/dist/lib/services/conversation-state.service.d.ts.map +1 -0
  133. package/dist/lib/services/conversation-state.service.js +334 -0
  134. package/dist/lib/services/conversation-state.service.js.map +1 -0
  135. package/dist/lib/services/data-cache.service.d.ts +21 -21
  136. package/dist/lib/services/data-cache.service.d.ts.map +1 -1
  137. package/dist/lib/services/data-cache.service.js +21 -21
  138. package/dist/lib/services/data-cache.service.js.map +1 -1
  139. package/dist/lib/services/export.service.js +2 -2
  140. package/dist/lib/services/export.service.js.map +1 -1
  141. package/dist/lib/services/search.service.js +4 -4
  142. package/dist/lib/services/search.service.js.map +1 -1
  143. package/dist/lib/services/ui-command-handler.service.d.ts +18 -7
  144. package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
  145. package/dist/lib/services/ui-command-handler.service.js +48 -9
  146. package/dist/lib/services/ui-command-handler.service.js.map +1 -1
  147. package/dist/public-api.d.ts +1 -0
  148. package/dist/public-api.d.ts.map +1 -1
  149. package/dist/public-api.js +1 -0
  150. package/dist/public-api.js.map +1 -1
  151. package/package.json +17 -17
@@ -0,0 +1,160 @@
1
+ import { ConversationEntity } from '@memberjunction/core-entities';
2
+ import { UserInfo } from '@memberjunction/core';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Simplified state management for conversations
6
+ * Uses simple arrays with Angular change detection instead of complex observables
7
+ * This prevents synchronization issues when updating conversation properties
8
+ */
9
+ export declare class ConversationStateService {
10
+ conversations: ConversationEntity[];
11
+ private _activeConversationId;
12
+ searchQuery: string;
13
+ isLoading: boolean;
14
+ activeThreadId: string | null;
15
+ private _activeConversationId$;
16
+ readonly activeConversationId$: import("rxjs").Observable<string | null>;
17
+ pendingMessageToSend: string | null;
18
+ isNewUnsavedConversation: boolean;
19
+ pendingArtifactId: string | null;
20
+ pendingArtifactVersionNumber: number | null;
21
+ constructor();
22
+ /**
23
+ * Gets the active conversation ID
24
+ */
25
+ get activeConversationId(): string | null;
26
+ /**
27
+ * Sets the active conversation ID and emits change event
28
+ */
29
+ set activeConversationId(value: string | null);
30
+ /**
31
+ * Gets the active conversation object
32
+ */
33
+ get activeConversation(): ConversationEntity | null;
34
+ /**
35
+ * Gets filtered conversations based on search query
36
+ */
37
+ get filteredConversations(): ConversationEntity[];
38
+ /**
39
+ * Gets pinned conversations
40
+ */
41
+ get pinnedConversations(): ConversationEntity[];
42
+ /**
43
+ * Sets the active conversation
44
+ * @param id The conversation ID to activate (or null to clear)
45
+ */
46
+ setActiveConversation(id: string | null): void;
47
+ /**
48
+ * Initiates a new unsaved conversation (doesn't create DB record yet)
49
+ * This shows the welcome screen and delays DB creation until first message
50
+ */
51
+ startNewConversation(): void;
52
+ /**
53
+ * Clears the new unsaved conversation state
54
+ * Called when the conversation is actually created or cancelled
55
+ */
56
+ clearNewConversationState(): void;
57
+ /**
58
+ * Gets the current active conversation ID
59
+ */
60
+ getActiveConversationId(): string | null;
61
+ /**
62
+ * Adds a conversation to the list
63
+ * @param conversation The conversation to add
64
+ */
65
+ addConversation(conversation: ConversationEntity): void;
66
+ /**
67
+ * Updates a conversation in the list by directly modifying the entity object
68
+ * Angular change detection will pick up the changes automatically
69
+ * @param id The conversation ID
70
+ * @param updates The fields to update
71
+ */
72
+ updateConversationInPlace(id: string, updates: Partial<ConversationEntity>): void;
73
+ /**
74
+ * Removes a conversation from the list
75
+ * @param id The conversation ID to remove
76
+ */
77
+ removeConversation(id: string): void;
78
+ /**
79
+ * Sets the search query
80
+ * @param query The search query string
81
+ */
82
+ setSearchQuery(query: string): void;
83
+ /**
84
+ * Clears the search query
85
+ */
86
+ clearSearchQuery(): void;
87
+ /**
88
+ * Loads conversations from the database
89
+ * @param environmentId The environment ID to filter by
90
+ * @param currentUser The current user context
91
+ */
92
+ loadConversations(environmentId: string, currentUser: UserInfo): Promise<void>;
93
+ /**
94
+ * Creates a new conversation
95
+ * @param name The conversation name
96
+ * @param environmentId The environment ID
97
+ * @param currentUser The current user context
98
+ * @param description Optional description
99
+ * @param projectId Optional project ID
100
+ * @returns The created conversation entity
101
+ */
102
+ createConversation(name: string, environmentId: string, currentUser: UserInfo, description?: string, projectId?: string): Promise<ConversationEntity>;
103
+ /**
104
+ * Deletes a conversation
105
+ * @param id The conversation ID
106
+ * @param currentUser The current user context
107
+ * @returns True if successful
108
+ */
109
+ deleteConversation(id: string, currentUser: UserInfo): Promise<boolean>;
110
+ /**
111
+ * Deletes multiple conversations in a batch operation
112
+ * @param ids - Array of conversation IDs to delete
113
+ * @param currentUser - Current user info
114
+ * @returns Object with successful deletions and failed deletions with error info
115
+ */
116
+ deleteMultipleConversations(ids: string[], currentUser: UserInfo): Promise<{
117
+ successful: string[];
118
+ failed: Array<{
119
+ id: string;
120
+ name: string;
121
+ error: string;
122
+ }>;
123
+ }>;
124
+ /**
125
+ * Updates a conversation - saves to database AND updates in-place in the array
126
+ * @param id The conversation ID
127
+ * @param updates The fields to update
128
+ * @param currentUser The current user context
129
+ * @returns True if successful
130
+ */
131
+ saveConversation(id: string, updates: Partial<ConversationEntity>, currentUser: UserInfo): Promise<boolean>;
132
+ /**
133
+ * Toggles the pinned status of a conversation
134
+ * @param id The conversation ID
135
+ * @param currentUser The current user context
136
+ */
137
+ togglePin(id: string, currentUser: UserInfo): Promise<void>;
138
+ /**
139
+ * Archives a conversation
140
+ * @param id The conversation ID
141
+ * @param currentUser The current user context
142
+ */
143
+ archiveConversation(id: string, currentUser: UserInfo): Promise<void>;
144
+ /**
145
+ * Opens a thread panel for a specific message
146
+ * @param messageId The parent message ID
147
+ */
148
+ openThread(messageId: string): void;
149
+ /**
150
+ * Closes the currently open thread panel
151
+ */
152
+ closeThread(): void;
153
+ /**
154
+ * Gets the currently active thread ID
155
+ */
156
+ getActiveThreadId(): string | null;
157
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConversationStateService, never>;
158
+ static ɵprov: i0.ɵɵInjectableDeclaration<ConversationStateService>;
159
+ }
160
+ //# sourceMappingURL=conversation-state.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-state.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-state.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAqB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;;AAEnE;;;;GAIG;AACH,qBAGa,wBAAwB;IAE5B,aAAa,EAAE,kBAAkB,EAAE,CAAM;IAChD,OAAO,CAAC,qBAAqB,CAAuB;IAC7C,WAAW,EAAE,MAAM,CAAM;IACzB,SAAS,EAAE,OAAO,CAAS;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAQ;IAG5C,OAAO,CAAC,sBAAsB,CAA4C;IAC1E,SAAgB,qBAAqB,2CAA8C;IAG5E,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAG3C,wBAAwB,EAAE,OAAO,CAAS;IAG1C,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAQ;IACxC,4BAA4B,EAAE,MAAM,GAAG,IAAI,CAAQ;;IAI1D;;OA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E,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAqB7E;;;;;OAKG;IACG,2BAA2B,CAC/B,GAAG,EAAE,MAAM,EAAE,EACb,WAAW,EAAE,QAAQ,GACpB,OAAO,CAAC;QACT,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC5D,CAAC;IA4BF;;;;;;OAMG;IACG,gBAAgB,CACpB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,EACpC,WAAW,EAAE,QAAQ,GACpB,OAAO,CAAC,OAAO,CAAC;IAsBnB;;;;OAIG;IACG,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjE;;;;OAIG;IACG,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E;;;OAGG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAInC;;OAEG;IACH,WAAW,IAAI,IAAI;IAInB;;OAEG;IACH,iBAAiB,IAAI,MAAM,GAAG,IAAI;yCA3WvB,wBAAwB;6CAAxB,wBAAwB;CA8WpC"}
@@ -0,0 +1,334 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { Metadata, RunView } from '@memberjunction/core';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Simplified state management for conversations
7
+ * Uses simple arrays with Angular change detection instead of complex observables
8
+ * This prevents synchronization issues when updating conversation properties
9
+ */
10
+ export class ConversationStateService {
11
+ // Simple properties - Angular change detection will handle updates
12
+ conversations = [];
13
+ _activeConversationId = null;
14
+ searchQuery = '';
15
+ isLoading = false;
16
+ activeThreadId = null;
17
+ // Observable for conversation ID changes (for URL tracking)
18
+ _activeConversationId$ = new BehaviorSubject(null);
19
+ activeConversationId$ = this._activeConversationId$.asObservable();
20
+ // Pending message from empty state - persists across component lifecycle
21
+ pendingMessageToSend = null;
22
+ // New unsaved conversation state - delays DB creation until first message
23
+ isNewUnsavedConversation = false;
24
+ // Pending artifact navigation - used when jumping from collection to conversation
25
+ pendingArtifactId = null;
26
+ pendingArtifactVersionNumber = null;
27
+ constructor() { }
28
+ /**
29
+ * Gets the active conversation ID
30
+ */
31
+ get activeConversationId() {
32
+ return this._activeConversationId;
33
+ }
34
+ /**
35
+ * Sets the active conversation ID and emits change event
36
+ */
37
+ set activeConversationId(value) {
38
+ if (this._activeConversationId !== value) {
39
+ this._activeConversationId = value;
40
+ this._activeConversationId$.next(value);
41
+ }
42
+ }
43
+ /**
44
+ * Gets the active conversation object
45
+ */
46
+ get activeConversation() {
47
+ if (!this.activeConversationId)
48
+ return null;
49
+ return this.conversations.find(c => c.ID === this.activeConversationId) || null;
50
+ }
51
+ /**
52
+ * Gets filtered conversations based on search query
53
+ */
54
+ get filteredConversations() {
55
+ if (!this.searchQuery || this.searchQuery.trim() === '') {
56
+ return this.conversations;
57
+ }
58
+ const lowerQuery = this.searchQuery.toLowerCase();
59
+ return this.conversations.filter(c => (c.Name?.toLowerCase().includes(lowerQuery)) ||
60
+ (c.Description?.toLowerCase().includes(lowerQuery)));
61
+ }
62
+ /**
63
+ * Gets pinned conversations
64
+ */
65
+ get pinnedConversations() {
66
+ return this.conversations.filter(c => c.IsPinned);
67
+ }
68
+ /**
69
+ * Sets the active conversation
70
+ * @param id The conversation ID to activate (or null to clear)
71
+ */
72
+ setActiveConversation(id) {
73
+ console.log('🎯 Setting active conversation:', id);
74
+ this.activeConversationId = id;
75
+ // Clear unsaved state when switching to an existing conversation
76
+ if (id) {
77
+ this.isNewUnsavedConversation = false;
78
+ }
79
+ }
80
+ /**
81
+ * Initiates a new unsaved conversation (doesn't create DB record yet)
82
+ * This shows the welcome screen and delays DB creation until first message
83
+ */
84
+ startNewConversation() {
85
+ console.log('✨ Starting new unsaved conversation');
86
+ this.activeConversationId = null;
87
+ this.isNewUnsavedConversation = true;
88
+ this.pendingMessageToSend = null;
89
+ }
90
+ /**
91
+ * Clears the new unsaved conversation state
92
+ * Called when the conversation is actually created or cancelled
93
+ */
94
+ clearNewConversationState() {
95
+ this.isNewUnsavedConversation = false;
96
+ }
97
+ /**
98
+ * Gets the current active conversation ID
99
+ */
100
+ getActiveConversationId() {
101
+ return this.activeConversationId;
102
+ }
103
+ /**
104
+ * Adds a conversation to the list
105
+ * @param conversation The conversation to add
106
+ */
107
+ addConversation(conversation) {
108
+ this.conversations = [conversation, ...this.conversations];
109
+ }
110
+ /**
111
+ * Updates a conversation in the list by directly modifying the entity object
112
+ * Angular change detection will pick up the changes automatically
113
+ * @param id The conversation ID
114
+ * @param updates The fields to update
115
+ */
116
+ updateConversationInPlace(id, updates) {
117
+ const conversation = this.conversations.find(c => c.ID === id);
118
+ if (conversation) {
119
+ Object.assign(conversation, updates);
120
+ console.log('📝 Updated conversation in-place:', { id, updates });
121
+ }
122
+ }
123
+ /**
124
+ * Removes a conversation from the list
125
+ * @param id The conversation ID to remove
126
+ */
127
+ removeConversation(id) {
128
+ this.conversations = this.conversations.filter(c => c.ID !== id);
129
+ }
130
+ /**
131
+ * Sets the search query
132
+ * @param query The search query string
133
+ */
134
+ setSearchQuery(query) {
135
+ this.searchQuery = query;
136
+ }
137
+ /**
138
+ * Clears the search query
139
+ */
140
+ clearSearchQuery() {
141
+ this.searchQuery = '';
142
+ }
143
+ /**
144
+ * Loads conversations from the database
145
+ * @param environmentId The environment ID to filter by
146
+ * @param currentUser The current user context
147
+ */
148
+ async loadConversations(environmentId, currentUser) {
149
+ this.isLoading = true;
150
+ try {
151
+ const rv = new RunView();
152
+ const filter = `EnvironmentID='${environmentId}' AND UserID='${currentUser.ID}' AND (IsArchived IS NULL OR IsArchived=0)`;
153
+ const result = await rv.RunView({
154
+ EntityName: 'Conversations',
155
+ ExtraFilter: filter,
156
+ OrderBy: 'IsPinned DESC, __mj_UpdatedAt DESC',
157
+ MaxRows: 1000,
158
+ ResultType: 'entity_object'
159
+ }, currentUser);
160
+ if (result.Success) {
161
+ this.conversations = result.Results || [];
162
+ }
163
+ else {
164
+ console.error('Failed to load conversations:', result.ErrorMessage);
165
+ this.conversations = [];
166
+ }
167
+ }
168
+ catch (error) {
169
+ console.error('Error loading conversations:', error);
170
+ this.conversations = [];
171
+ }
172
+ finally {
173
+ this.isLoading = false;
174
+ }
175
+ }
176
+ /**
177
+ * Creates a new conversation
178
+ * @param name The conversation name
179
+ * @param environmentId The environment ID
180
+ * @param currentUser The current user context
181
+ * @param description Optional description
182
+ * @param projectId Optional project ID
183
+ * @returns The created conversation entity
184
+ */
185
+ async createConversation(name, environmentId, currentUser, description, projectId) {
186
+ const md = new Metadata();
187
+ const conversation = await md.GetEntityObject('Conversations', currentUser);
188
+ conversation.Name = name;
189
+ conversation.EnvironmentID = environmentId;
190
+ conversation.UserID = currentUser.ID;
191
+ if (description)
192
+ conversation.Description = description;
193
+ if (projectId)
194
+ conversation.ProjectID = projectId;
195
+ const saved = await conversation.Save();
196
+ if (saved) {
197
+ this.addConversation(conversation);
198
+ return conversation;
199
+ }
200
+ else {
201
+ throw new Error(conversation.LatestResult?.Message || 'Failed to create conversation');
202
+ }
203
+ }
204
+ /**
205
+ * Deletes a conversation
206
+ * @param id The conversation ID
207
+ * @param currentUser The current user context
208
+ * @returns True if successful
209
+ */
210
+ async deleteConversation(id, currentUser) {
211
+ const md = new Metadata();
212
+ const conversation = await md.GetEntityObject('Conversations', currentUser);
213
+ const loaded = await conversation.Load(id);
214
+ if (!loaded) {
215
+ throw new Error('Conversation not found');
216
+ }
217
+ const deleted = await conversation.Delete();
218
+ if (deleted) {
219
+ this.removeConversation(id);
220
+ if (this.getActiveConversationId() === id) {
221
+ this.setActiveConversation(null);
222
+ }
223
+ return true;
224
+ }
225
+ else {
226
+ throw new Error(conversation.LatestResult?.Message || 'Failed to delete conversation');
227
+ }
228
+ }
229
+ /**
230
+ * Deletes multiple conversations in a batch operation
231
+ * @param ids - Array of conversation IDs to delete
232
+ * @param currentUser - Current user info
233
+ * @returns Object with successful deletions and failed deletions with error info
234
+ */
235
+ async deleteMultipleConversations(ids, currentUser) {
236
+ const successful = [];
237
+ const failed = [];
238
+ for (const id of ids) {
239
+ try {
240
+ const conversation = this.conversations.find(c => c.ID === id);
241
+ const name = conversation?.Name || 'Unknown';
242
+ const deleted = await this.deleteConversation(id, currentUser);
243
+ if (deleted) {
244
+ successful.push(id);
245
+ }
246
+ else {
247
+ failed.push({ id, name, error: 'Delete returned false' });
248
+ }
249
+ }
250
+ catch (error) {
251
+ const conversation = this.conversations.find(c => c.ID === id);
252
+ failed.push({
253
+ id,
254
+ name: conversation?.Name || 'Unknown',
255
+ error: error instanceof Error ? error.message : 'Unknown error'
256
+ });
257
+ }
258
+ }
259
+ return { successful, failed };
260
+ }
261
+ /**
262
+ * Updates a conversation - saves to database AND updates in-place in the array
263
+ * @param id The conversation ID
264
+ * @param updates The fields to update
265
+ * @param currentUser The current user context
266
+ * @returns True if successful
267
+ */
268
+ async saveConversation(id, updates, currentUser) {
269
+ const md = new Metadata();
270
+ const conversation = await md.GetEntityObject('Conversations', currentUser);
271
+ const loaded = await conversation.Load(id);
272
+ if (!loaded) {
273
+ throw new Error('Conversation not found');
274
+ }
275
+ // Apply updates
276
+ Object.assign(conversation, updates);
277
+ const saved = await conversation.Save();
278
+ if (saved) {
279
+ // Update the in-memory conversation directly
280
+ this.updateConversationInPlace(id, updates);
281
+ return true;
282
+ }
283
+ else {
284
+ throw new Error(conversation.LatestResult?.Message || 'Failed to update conversation');
285
+ }
286
+ }
287
+ /**
288
+ * Toggles the pinned status of a conversation
289
+ * @param id The conversation ID
290
+ * @param currentUser The current user context
291
+ */
292
+ async togglePin(id, currentUser) {
293
+ const conversation = this.conversations.find(c => c.ID === id);
294
+ if (conversation) {
295
+ await this.saveConversation(id, { IsPinned: !conversation.IsPinned }, currentUser);
296
+ }
297
+ }
298
+ /**
299
+ * Archives a conversation
300
+ * @param id The conversation ID
301
+ * @param currentUser The current user context
302
+ */
303
+ async archiveConversation(id, currentUser) {
304
+ await this.saveConversation(id, { IsArchived: true }, currentUser);
305
+ }
306
+ /**
307
+ * Opens a thread panel for a specific message
308
+ * @param messageId The parent message ID
309
+ */
310
+ openThread(messageId) {
311
+ this.activeThreadId = messageId;
312
+ }
313
+ /**
314
+ * Closes the currently open thread panel
315
+ */
316
+ closeThread() {
317
+ this.activeThreadId = null;
318
+ }
319
+ /**
320
+ * Gets the currently active thread ID
321
+ */
322
+ getActiveThreadId() {
323
+ return this.activeThreadId;
324
+ }
325
+ static ɵfac = function ConversationStateService_Factory(t) { return new (t || ConversationStateService)(); };
326
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConversationStateService, factory: ConversationStateService.ɵfac, providedIn: 'root' });
327
+ }
328
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConversationStateService, [{
329
+ type: Injectable,
330
+ args: [{
331
+ providedIn: 'root'
332
+ }]
333
+ }], () => [], null); })();
334
+ //# sourceMappingURL=conversation-state.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-state.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-state.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAY,MAAM,sBAAsB,CAAC;;AAEnE;;;;GAIG;AAIH,MAAM,OAAO,wBAAwB;IACnC,mEAAmE;IAC5D,aAAa,GAAyB,EAAE,CAAC;IACxC,qBAAqB,GAAkB,IAAI,CAAC;IAC7C,WAAW,GAAW,EAAE,C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, ConversationDetailEntity } from '@memberjunction/core-entities';
1
+ import { MJConversationEntity, MJConversationDetailEntity } from '@memberjunction/core-entities';
2
2
  import { UserInfo } from '@memberjunction/core';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
@@ -16,66 +16,66 @@ export declare class DataCacheService {
16
16
  private conversationDetails;
17
17
  constructor();
18
18
  /**
19
- * Get a ConversationEntity by ID from cache, or load it if not cached
19
+ * Get a MJConversationEntity by ID from cache, or load it if not cached
20
20
  * @param id The conversation ID
21
21
  * @param currentUser User context for loading
22
- * @returns The cached or loaded ConversationEntity, or null if not found
22
+ * @returns The cached or loaded MJConversationEntity, or null if not found
23
23
  */
24
- getConversation(id: string, currentUser: UserInfo): Promise<ConversationEntity | null>;
24
+ getConversation(id: string, currentUser: UserInfo): Promise<MJConversationEntity | null>;
25
25
  /**
26
- * Create a new ConversationEntity and automatically cache it
26
+ * Create a new MJConversationEntity and automatically cache it
27
27
  * The cache is the ONLY place GetEntityObject() should be called
28
28
  * @param currentUser User context
29
- * @returns New ConversationEntity instance (already cached)
29
+ * @returns New MJConversationEntity instance (already cached)
30
30
  */
31
- createConversation(currentUser: UserInfo): Promise<ConversationEntity>;
31
+ createConversation(currentUser: UserInfo): Promise<MJConversationEntity>;
32
32
  /**
33
- * Remove a ConversationEntity from the cache
33
+ * Remove a MJConversationEntity from the cache
34
34
  * @param id The conversation ID to remove
35
35
  */
36
36
  removeConversation(id: string): void;
37
37
  /**
38
- * Get all cached ConversationEntity objects (no DB call)
38
+ * Get all cached MJConversationEntity objects (no DB call)
39
39
  * @returns Array of cached conversations
40
40
  */
41
- getCachedConversations(): ConversationEntity[];
41
+ getCachedConversations(): MJConversationEntity[];
42
42
  /**
43
- * Get a ConversationDetailEntity by ID from cache, or load it if not cached
43
+ * Get a MJConversationDetailEntity by ID from cache, or load it if not cached
44
44
  * @param id The conversation detail ID
45
45
  * @param currentUser User context for loading
46
- * @returns The cached or loaded ConversationDetailEntity, or null if not found
46
+ * @returns The cached or loaded MJConversationDetailEntity, or null if not found
47
47
  */
48
- getConversationDetail(id: string, currentUser: UserInfo): Promise<ConversationDetailEntity | null>;
48
+ getConversationDetail(id: string, currentUser: UserInfo): Promise<MJConversationDetailEntity | null>;
49
49
  /**
50
- * Create a new ConversationDetailEntity and automatically cache it
50
+ * Create a new MJConversationDetailEntity and automatically cache it
51
51
  * The cache is the ONLY place GetEntityObject() should be called
52
52
  * @param currentUser User context
53
- * @returns New ConversationDetailEntity instance (already cached)
53
+ * @returns New MJConversationDetailEntity instance (already cached)
54
54
  */
55
- createConversationDetail(currentUser: UserInfo): Promise<ConversationDetailEntity>;
55
+ createConversationDetail(currentUser: UserInfo): Promise<MJConversationDetailEntity>;
56
56
  /**
57
57
  * Load all ConversationDetail entities for a conversation and cache them
58
58
  * Used when loading a conversation's message history
59
59
  * @param conversationId The conversation ID
60
60
  * @param currentUser User context
61
- * @returns Array of ConversationDetailEntity objects
61
+ * @returns Array of MJConversationDetailEntity objects
62
62
  */
63
- loadConversationDetails(conversationId: string, currentUser: UserInfo): Promise<ConversationDetailEntity[]>;
63
+ loadConversationDetails(conversationId: string, currentUser: UserInfo): Promise<MJConversationDetailEntity[]>;
64
64
  /**
65
65
  * Get all cached ConversationDetail entities for a conversation (no DB call)
66
66
  * @param conversationId The conversation ID
67
67
  * @returns Array of cached conversation details
68
68
  */
69
- getCachedConversationDetails(conversationId: string): ConversationDetailEntity[];
69
+ getCachedConversationDetails(conversationId: string): MJConversationDetailEntity[];
70
70
  /**
71
- * Remove a ConversationDetailEntity from the cache
71
+ * Remove a MJConversationDetailEntity from the cache
72
72
  * @param id The conversation detail ID to remove
73
73
  */
74
74
  removeConversationDetail(id: string): void;
75
75
  /**
76
76
  * Refresh entity data by clearing cached entities of a specific type
77
77
  * This forces a reload from the database on next access
78
- * @param entityName The entity name to refresh (e.g., 'Conversations', 'Conversation Details')
78
+ * @param entityName The entity name to refresh (e.g., 'Conversations', 'MJ: Conversation Details')
79
79
  */
80
80
  refreshEntity(entityName: string): Promise<void>;
81
81
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"data-cache.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/data-cache.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAY,QAAQ,EAAc,MAAM,sBAAsB,CAAC;;AAEtE;;;;;;;;;GASG;AACH,qBAGa,gBAAgB;IAE3B,OAAO,CAAC,aAAa,CAA4B;IACjD,OAAO,CAAC,mBAAmB,CAAkC;;IAQ7D;;;;;OAKG;IACG,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAqB5F;;;;;OAKG;IACG,kBAAkB,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAY5E;;;OAGG;IACH,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIpC;;;OAGG;IACH,sBAAsB,IAAI,kBAAkB,EAAE;IAQ9C;;;;;OAKG;IACG,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;IAqBxG;;;;;OAKG;IACG,wBAAwB,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAexF;;;;;;OAMG;IACG,uBAAuB,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAyCjH;;;;OAIG;IACH,4BAA4B,CAAC,cAAc,EAAE,MAAM,GAAG,wBAAwB,EAAE;IAIhF;;;OAGG;IACH,wBAAwB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAQ1C;;;;OAIG;IACG,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IA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