@memberjunction/ng-user-routines 0.0.0 → 5.45.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 (42) hide show
  1. package/dist/lib/my-routines-list.component.d.ts +119 -0
  2. package/dist/lib/my-routines-list.component.d.ts.map +1 -0
  3. package/dist/lib/my-routines-list.component.js +574 -0
  4. package/dist/lib/my-routines-list.component.js.map +1 -0
  5. package/dist/lib/new-routine.component.d.ts +182 -0
  6. package/dist/lib/new-routine.component.d.ts.map +1 -0
  7. package/dist/lib/new-routine.component.js +1070 -0
  8. package/dist/lib/new-routine.component.js.map +1 -0
  9. package/dist/lib/routine-history.component.d.ts +65 -0
  10. package/dist/lib/routine-history.component.d.ts.map +1 -0
  11. package/dist/lib/routine-history.component.js +290 -0
  12. package/dist/lib/routine-history.component.js.map +1 -0
  13. package/dist/lib/routine-target-catalog.d.ts +48 -0
  14. package/dist/lib/routine-target-catalog.d.ts.map +1 -0
  15. package/dist/lib/routine-target-catalog.js +59 -0
  16. package/dist/lib/routine-target-catalog.js.map +1 -0
  17. package/dist/lib/routine-ui-helpers.d.ts +49 -0
  18. package/dist/lib/routine-ui-helpers.d.ts.map +1 -0
  19. package/dist/lib/routine-ui-helpers.js +174 -0
  20. package/dist/lib/routine-ui-helpers.js.map +1 -0
  21. package/dist/lib/user-routines-command-center.component.d.ts +88 -0
  22. package/dist/lib/user-routines-command-center.component.d.ts.map +1 -0
  23. package/dist/lib/user-routines-command-center.component.js +372 -0
  24. package/dist/lib/user-routines-command-center.component.js.map +1 -0
  25. package/dist/lib/user-routines-events.d.ts +88 -0
  26. package/dist/lib/user-routines-events.d.ts.map +1 -0
  27. package/dist/lib/user-routines-events.js +97 -0
  28. package/dist/lib/user-routines-events.js.map +1 -0
  29. package/dist/lib/user-routines-slide-in.component.d.ts +57 -0
  30. package/dist/lib/user-routines-slide-in.component.d.ts.map +1 -0
  31. package/dist/lib/user-routines-slide-in.component.js +170 -0
  32. package/dist/lib/user-routines-slide-in.component.js.map +1 -0
  33. package/dist/lib/user-routines.module.d.ts +37 -0
  34. package/dist/lib/user-routines.module.d.ts.map +1 -0
  35. package/dist/lib/user-routines.module.js +113 -0
  36. package/dist/lib/user-routines.module.js.map +1 -0
  37. package/dist/public-api.d.ts +10 -0
  38. package/dist/public-api.d.ts.map +1 -0
  39. package/dist/public-api.js +19 -0
  40. package/dist/public-api.js.map +1 -0
  41. package/package.json +49 -7
  42. package/README.md +0 -45
@@ -0,0 +1,372 @@
1
+ import { ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewChild, inject } from '@angular/core';
2
+ import { BaseAngularComponent } from '@memberjunction/ng-base-types';
3
+ import { UserRoutineEngine } from '@memberjunction/core-entities';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@memberjunction/ng-ui-components";
6
+ import * as i2 from "./my-routines-list.component";
7
+ import * as i3 from "./new-routine.component";
8
+ import * as i4 from "./routine-history.component";
9
+ const _c0 = ["list"];
10
+ const _c1 = ["history"];
11
+ function UserRoutinesCommandCenterComponent_Conditional_1_Conditional_5_Template(rf, ctx) { if (rf & 1) {
12
+ i0.ɵɵelementStart(0, "span", 10);
13
+ i0.ɵɵtext(1);
14
+ i0.ɵɵelementEnd();
15
+ } if (rf & 2) {
16
+ const ctx_r1 = i0.ɵɵnextContext(2);
17
+ i0.ɵɵadvance();
18
+ i0.ɵɵtextInterpolate(ctx_r1.TotalCount);
19
+ } }
20
+ function UserRoutinesCommandCenterComponent_Conditional_1_Conditional_11_Template(rf, ctx) { if (rf & 1) {
21
+ i0.ɵɵelementStart(0, "span", 13);
22
+ i0.ɵɵtext(1);
23
+ i0.ɵɵelementEnd();
24
+ } if (rf & 2) {
25
+ const ctx_r1 = i0.ɵɵnextContext(2);
26
+ i0.ɵɵadvance();
27
+ i0.ɵɵtextInterpolate1(" History", ctx_r1.HistoryRoutineName ? " \u2014 " + ctx_r1.HistoryRoutineName : "", " ");
28
+ } }
29
+ function UserRoutinesCommandCenterComponent_Conditional_1_Conditional_13_Template(rf, ctx) { if (rf & 1) {
30
+ const _r3 = i0.ɵɵgetCurrentView();
31
+ i0.ɵɵelementStart(0, "mj-page-search", 17);
32
+ i0.ɵɵlistener("ValueChange", function UserRoutinesCommandCenterComponent_Conditional_1_Conditional_13_Template_mj_page_search_ValueChange_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnSearchChange($event)); });
33
+ i0.ɵɵelementEnd();
34
+ i0.ɵɵelementStart(1, "mj-refresh-button", 18);
35
+ i0.ɵɵlistener("Clicked", function UserRoutinesCommandCenterComponent_Conditional_1_Conditional_13_Template_mj_refresh_button_Clicked_1_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.Refresh()); });
36
+ i0.ɵɵelementEnd();
37
+ i0.ɵɵelementStart(2, "button", 19);
38
+ i0.ɵɵlistener("click", function UserRoutinesCommandCenterComponent_Conditional_1_Conditional_13_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.ShowNewRoutine()); });
39
+ i0.ɵɵelement(3, "i", 20);
40
+ i0.ɵɵtext(4, " New Routine ");
41
+ i0.ɵɵelementEnd();
42
+ } if (rf & 2) {
43
+ const ctx_r1 = i0.ɵɵnextContext(2);
44
+ i0.ɵɵproperty("Value", ctx_r1.SearchText);
45
+ i0.ɵɵadvance();
46
+ i0.ɵɵproperty("ShowLabel", false);
47
+ } }
48
+ function UserRoutinesCommandCenterComponent_Conditional_1_Conditional_14_Template(rf, ctx) { if (rf & 1) {
49
+ const _r4 = i0.ɵɵgetCurrentView();
50
+ i0.ɵɵelementStart(0, "button", 21);
51
+ i0.ɵɵlistener("click", function UserRoutinesCommandCenterComponent_Conditional_1_Conditional_14_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.ShowList()); });
52
+ i0.ɵɵelement(1, "i", 22);
53
+ i0.ɵɵtext(2, " Back to list ");
54
+ i0.ɵɵelementEnd();
55
+ } }
56
+ function UserRoutinesCommandCenterComponent_Conditional_1_Conditional_15_Template(rf, ctx) { if (rf & 1) {
57
+ const _r5 = i0.ɵɵgetCurrentView();
58
+ i0.ɵɵelementStart(0, "button", 23);
59
+ i0.ɵɵlistener("click", function UserRoutinesCommandCenterComponent_Conditional_1_Conditional_15_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.CloseRequested.emit()); });
60
+ i0.ɵɵelement(1, "i", 24);
61
+ i0.ɵɵelementEnd();
62
+ } }
63
+ function UserRoutinesCommandCenterComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
64
+ const _r1 = i0.ɵɵgetCurrentView();
65
+ i0.ɵɵelementStart(0, "div", 3)(1, "div", 8);
66
+ i0.ɵɵelement(2, "i", 9);
67
+ i0.ɵɵelementStart(3, "span");
68
+ i0.ɵɵtext(4, "Routines");
69
+ i0.ɵɵelementEnd();
70
+ i0.ɵɵconditionalCreate(5, UserRoutinesCommandCenterComponent_Conditional_1_Conditional_5_Template, 2, 1, "span", 10);
71
+ i0.ɵɵelementEnd();
72
+ i0.ɵɵelementStart(6, "div", 11)(7, "button", 12);
73
+ i0.ɵɵlistener("click", function UserRoutinesCommandCenterComponent_Conditional_1_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.ShowList()); });
74
+ i0.ɵɵtext(8, " My Routines ");
75
+ i0.ɵɵelementEnd();
76
+ i0.ɵɵelementStart(9, "button", 12);
77
+ i0.ɵɵlistener("click", function UserRoutinesCommandCenterComponent_Conditional_1_Template_button_click_9_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.ShowNewRoutine()); });
78
+ i0.ɵɵtext(10);
79
+ i0.ɵɵelementEnd();
80
+ i0.ɵɵconditionalCreate(11, UserRoutinesCommandCenterComponent_Conditional_1_Conditional_11_Template, 2, 1, "span", 13);
81
+ i0.ɵɵelementEnd();
82
+ i0.ɵɵelement(12, "span", 14);
83
+ i0.ɵɵconditionalCreate(13, UserRoutinesCommandCenterComponent_Conditional_1_Conditional_13_Template, 5, 2)(14, UserRoutinesCommandCenterComponent_Conditional_1_Conditional_14_Template, 3, 0, "button", 15);
84
+ i0.ɵɵconditionalCreate(15, UserRoutinesCommandCenterComponent_Conditional_1_Conditional_15_Template, 2, 0, "button", 16);
85
+ i0.ɵɵelementEnd();
86
+ } if (rf & 2) {
87
+ const ctx_r1 = i0.ɵɵnextContext();
88
+ i0.ɵɵadvance(5);
89
+ i0.ɵɵconditional(ctx_r1.TotalCount > 0 ? 5 : -1);
90
+ i0.ɵɵadvance(2);
91
+ i0.ɵɵclassProp("urcc-tab--active", ctx_r1.ActiveView === "list");
92
+ i0.ɵɵattribute("aria-selected", ctx_r1.ActiveView === "list");
93
+ i0.ɵɵadvance(2);
94
+ i0.ɵɵclassProp("urcc-tab--active", ctx_r1.ActiveView === "editor");
95
+ i0.ɵɵattribute("aria-selected", ctx_r1.ActiveView === "editor");
96
+ i0.ɵɵadvance();
97
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.ActiveView === "editor" && ctx_r1.EditingRoutineID ? "Edit Routine" : "New Routine", " ");
98
+ i0.ɵɵadvance();
99
+ i0.ɵɵconditional(ctx_r1.ActiveView === "history" ? 11 : -1);
100
+ i0.ɵɵadvance(2);
101
+ i0.ɵɵconditional(ctx_r1.ActiveView === "list" ? 13 : 14);
102
+ i0.ɵɵadvance(2);
103
+ i0.ɵɵconditional(ctx_r1.ShowClose ? 15 : -1);
104
+ } }
105
+ function UserRoutinesCommandCenterComponent_Case_3_Template(rf, ctx) { if (rf & 1) {
106
+ const _r6 = i0.ɵɵgetCurrentView();
107
+ i0.ɵɵelementStart(0, "mj-my-routines-list", 25, 0);
108
+ i0.ɵɵlistener("CreateRequested", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_CreateRequested_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.ShowNewRoutine()); })("EditRequested", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_EditRequested_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnEditRequested($event)); })("HistoryRequested", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_HistoryRequested_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnHistoryRequested($event)); })("ConversationOpened", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_ConversationOpened_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.ConversationOpened.emit($event)); })("RoutineSelected", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_RoutineSelected_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnRoutineSelected($event)); })("CountsChanged", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_CountsChanged_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnCountsChanged($event)); })("BeforeRoutinePaused", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_BeforeRoutinePaused_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.BeforeRoutinePaused.emit($event)); })("AfterRoutinePaused", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_AfterRoutinePaused_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.AfterRoutinePaused.emit($event)); })("BeforeRoutineRunNow", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_BeforeRoutineRunNow_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.BeforeRoutineRunNow.emit($event)); })("AfterRoutineRunNow", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_AfterRoutineRunNow_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.AfterRoutineRunNow.emit($event)); })("BeforeRoutineDeleted", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_BeforeRoutineDeleted_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.BeforeRoutineDeleted.emit($event)); })("AfterRoutineDeleted", function UserRoutinesCommandCenterComponent_Case_3_Template_mj_my_routines_list_AfterRoutineDeleted_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.AfterRoutineDeleted.emit($event)); });
109
+ i0.ɵɵelementEnd();
110
+ } if (rf & 2) {
111
+ const ctx_r1 = i0.ɵɵnextContext();
112
+ i0.ɵɵproperty("Provider", ctx_r1.Provider)("SearchText", ctx_r1.SearchText)("StatusFilter", ctx_r1.StatusFilter);
113
+ } }
114
+ function UserRoutinesCommandCenterComponent_Case_4_Template(rf, ctx) { if (rf & 1) {
115
+ const _r7 = i0.ɵɵgetCurrentView();
116
+ i0.ɵɵelementStart(0, "mj-new-routine", 26);
117
+ i0.ɵɵlistener("Saved", function UserRoutinesCommandCenterComponent_Case_4_Template_mj_new_routine_Saved_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnEditorSaved($event)); })("Cancelled", function UserRoutinesCommandCenterComponent_Case_4_Template_mj_new_routine_Cancelled_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnEditorCancelled()); })("BeforeRoutineCreated", function UserRoutinesCommandCenterComponent_Case_4_Template_mj_new_routine_BeforeRoutineCreated_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.BeforeRoutineCreated.emit($event)); })("AfterRoutineCreated", function UserRoutinesCommandCenterComponent_Case_4_Template_mj_new_routine_AfterRoutineCreated_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.AfterRoutineCreated.emit($event)); });
118
+ i0.ɵɵelementEnd();
119
+ } if (rf & 2) {
120
+ const ctx_r1 = i0.ɵɵnextContext();
121
+ i0.ɵɵproperty("Provider", ctx_r1.Provider)("RoutineID", ctx_r1.EditingRoutineID);
122
+ } }
123
+ function UserRoutinesCommandCenterComponent_Case_5_Template(rf, ctx) { if (rf & 1) {
124
+ const _r8 = i0.ɵɵgetCurrentView();
125
+ i0.ɵɵelementStart(0, "mj-user-routine-history", 27, 1);
126
+ i0.ɵɵlistener("HistoryRecordOpened", function UserRoutinesCommandCenterComponent_Case_5_Template_mj_user_routine_history_HistoryRecordOpened_0_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.HistoryRecordOpened.emit($event)); })("ConversationOpened", function UserRoutinesCommandCenterComponent_Case_5_Template_mj_user_routine_history_ConversationOpened_0_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.ConversationOpened.emit($event)); });
127
+ i0.ɵɵelementEnd();
128
+ } if (rf & 2) {
129
+ const ctx_r1 = i0.ɵɵnextContext();
130
+ i0.ɵɵproperty("Provider", ctx_r1.Provider)("RoutineID", ctx_r1.HistoryRoutineID)("RoutineName", ctx_r1.HistoryRoutineName);
131
+ } }
132
+ /**
133
+ * User Routines "command center" — the composite surface combining the routines list
134
+ * (default view), the create/edit form, and per-routine run history behind an internal
135
+ * tabbed navigation. This is the component hosts embed (Explorer full page, the
136
+ * slide-in, or any custom app); the individual pieces remain exported for bespoke
137
+ * layouts.
138
+ *
139
+ * All child events bubble here unchanged (including the cancelable Before/After
140
+ * pairs), so a consumer only ever wires this one component.
141
+ */
142
+ export class UserRoutinesCommandCenterComponent extends BaseAngularComponent {
143
+ cdr = inject(ChangeDetectorRef);
144
+ list;
145
+ history;
146
+ // ---------------------------------------------------------------
147
+ // Inputs
148
+ // ---------------------------------------------------------------
149
+ /** Render the built-in compact header (mark + tabs + list controls). Hosts with their own chrome set false. */
150
+ ShowHeader = true;
151
+ /** Show a close (X) affordance in the built-in header (used by the slide-in wrapper). */
152
+ ShowClose = false;
153
+ _selectedRoutineID = null;
154
+ /**
155
+ * Deep-link style selection: setting a routine ID opens its history view
156
+ * (clearing it returns to the list). Used by Explorer's query-param round trip.
157
+ */
158
+ set SelectedRoutineID(value) {
159
+ if (value !== this._selectedRoutineID) {
160
+ this._selectedRoutineID = value;
161
+ if (value) {
162
+ this.openHistoryById(value);
163
+ }
164
+ else if (this.ActiveView === 'history') {
165
+ this.ShowList();
166
+ }
167
+ }
168
+ }
169
+ get SelectedRoutineID() {
170
+ return this._selectedRoutineID;
171
+ }
172
+ /** Search text applied to the list view (hosts with their own chrome bind this). */
173
+ SearchText = '';
174
+ /** Status filter applied to the list view. */
175
+ StatusFilter = 'all';
176
+ // ---------------------------------------------------------------
177
+ // Outputs — bubbled child events + view changes
178
+ // ---------------------------------------------------------------
179
+ BeforeRoutineCreated = new EventEmitter();
180
+ AfterRoutineCreated = new EventEmitter();
181
+ BeforeRoutinePaused = new EventEmitter();
182
+ AfterRoutinePaused = new EventEmitter();
183
+ BeforeRoutineRunNow = new EventEmitter();
184
+ AfterRoutineRunNow = new EventEmitter();
185
+ BeforeRoutineDeleted = new EventEmitter();
186
+ AfterRoutineDeleted = new EventEmitter();
187
+ RoutineSelected = new EventEmitter();
188
+ HistoryRecordOpened = new EventEmitter();
189
+ /** Re-emitted from the list — the routine's dedicated conversation was requested. */
190
+ ConversationOpened = new EventEmitter();
191
+ /** Loaded/filtered counts changed in the list view. */
192
+ CountsChanged = new EventEmitter();
193
+ /** The active internal view changed ('list' | 'editor' | 'history'). */
194
+ ViewChanged = new EventEmitter();
195
+ /** The user clicked the built-in close affordance (slide-in wrapper handles it). */
196
+ CloseRequested = new EventEmitter();
197
+ /**
198
+ * The selected routine (history view) changed — `null` when returning to the list.
199
+ * Hosts using query-param round trips two-way bind [(SelectedRoutineID)].
200
+ */
201
+ SelectedRoutineIDChange = new EventEmitter();
202
+ // ---------------------------------------------------------------
203
+ // State
204
+ // ---------------------------------------------------------------
205
+ ActiveView = 'list';
206
+ /** Routine being edited (null = creating a new one). */
207
+ EditingRoutineID = null;
208
+ /** Routine whose history is open. */
209
+ HistoryRoutineID = null;
210
+ HistoryRoutineName = null;
211
+ TotalCount = 0;
212
+ FilteredCount = 0;
213
+ // ---------------------------------------------------------------
214
+ // Navigation (public so hosts can drive the surface programmatically)
215
+ // ---------------------------------------------------------------
216
+ ShowList() {
217
+ this.setView('list');
218
+ this.setSelectedRoutine(null);
219
+ }
220
+ ShowNewRoutine() {
221
+ this.EditingRoutineID = null;
222
+ this.setView('editor');
223
+ }
224
+ ShowEditRoutine(routine) {
225
+ this.EditingRoutineID = typeof routine === 'string' ? routine : routine.ID;
226
+ this.setView('editor');
227
+ }
228
+ ShowHistory(routine) {
229
+ if (typeof routine === 'string') {
230
+ this.openHistoryById(routine);
231
+ }
232
+ else {
233
+ this.HistoryRoutineID = routine.ID;
234
+ this.HistoryRoutineName = routine.Name;
235
+ this.setView('history');
236
+ this.setSelectedRoutine(routine.ID);
237
+ }
238
+ }
239
+ /** Force-refreshes the active view's data. */
240
+ async Refresh() {
241
+ if (this.ActiveView === 'history') {
242
+ await this.history?.Refresh(true);
243
+ }
244
+ else {
245
+ await this.list?.Refresh();
246
+ }
247
+ }
248
+ // ---------------------------------------------------------------
249
+ // Child wiring
250
+ // ---------------------------------------------------------------
251
+ OnCountsChanged(counts) {
252
+ this.TotalCount = counts.Total;
253
+ this.FilteredCount = counts.Filtered;
254
+ this.CountsChanged.emit(counts);
255
+ this.cdr.markForCheck();
256
+ }
257
+ OnRoutineSelected(args) {
258
+ this.RoutineSelected.emit(args);
259
+ }
260
+ OnHistoryRequested(routine) {
261
+ this.ShowHistory(routine);
262
+ }
263
+ OnEditRequested(routine) {
264
+ this.ShowEditRoutine(routine);
265
+ }
266
+ OnEditorSaved(_routine) {
267
+ this.ShowList();
268
+ }
269
+ OnEditorCancelled() {
270
+ this.ShowList();
271
+ }
272
+ OnSearchChange(value) {
273
+ this.SearchText = value;
274
+ this.cdr.markForCheck();
275
+ }
276
+ // ---------------------------------------------------------------
277
+ // Internals
278
+ // ---------------------------------------------------------------
279
+ setView(view) {
280
+ if (this.ActiveView !== view) {
281
+ this.ActiveView = view;
282
+ this.ViewChanged.emit(view);
283
+ this.cdr.markForCheck();
284
+ }
285
+ }
286
+ setSelectedRoutine(routineId) {
287
+ if (this._selectedRoutineID !== routineId) {
288
+ this._selectedRoutineID = routineId;
289
+ this.SelectedRoutineIDChange.emit(routineId);
290
+ }
291
+ }
292
+ openHistoryById(routineId) {
293
+ this.HistoryRoutineID = routineId;
294
+ const p = this.ProviderToUse;
295
+ const engine = UserRoutineEngine.GetProviderInstance(p, UserRoutineEngine);
296
+ this.HistoryRoutineName = engine.GetRoutineByID(routineId)?.Name ?? null;
297
+ this.setView('history');
298
+ this.setSelectedRoutine(routineId);
299
+ }
300
+ static ɵfac = /*@__PURE__*/ (() => { let ɵUserRoutinesCommandCenterComponent_BaseFactory; return function UserRoutinesCommandCenterComponent_Factory(__ngFactoryType__) { return (ɵUserRoutinesCommandCenterComponent_BaseFactory || (ɵUserRoutinesCommandCenterComponent_BaseFactory = i0.ɵɵgetInheritedFactory(UserRoutinesCommandCenterComponent)))(__ngFactoryType__ || UserRoutinesCommandCenterComponent); }; })();
301
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserRoutinesCommandCenterComponent, selectors: [["mj-user-routines-command-center"]], viewQuery: function UserRoutinesCommandCenterComponent_Query(rf, ctx) { if (rf & 1) {
302
+ i0.ɵɵviewQuery(_c0, 5)(_c1, 5);
303
+ } if (rf & 2) {
304
+ let _t;
305
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.list = _t.first);
306
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.history = _t.first);
307
+ } }, inputs: { ShowHeader: "ShowHeader", ShowClose: "ShowClose", SelectedRoutineID: "SelectedRoutineID", SearchText: "SearchText", StatusFilter: "StatusFilter" }, outputs: { BeforeRoutineCreated: "BeforeRoutineCreated", AfterRoutineCreated: "AfterRoutineCreated", BeforeRoutinePaused: "BeforeRoutinePaused", AfterRoutinePaused: "AfterRoutinePaused", BeforeRoutineRunNow: "BeforeRoutineRunNow", AfterRoutineRunNow: "AfterRoutineRunNow", BeforeRoutineDeleted: "BeforeRoutineDeleted", AfterRoutineDeleted: "AfterRoutineDeleted", RoutineSelected: "RoutineSelected", HistoryRecordOpened: "HistoryRecordOpened", ConversationOpened: "ConversationOpened", CountsChanged: "CountsChanged", ViewChanged: "ViewChanged", CloseRequested: "CloseRequested", SelectedRoutineIDChange: "SelectedRoutineIDChange" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 2, consts: [["list", ""], ["history", ""], [1, "urcc"], [1, "urcc-header"], [1, "urcc-body"], [3, "Provider", "SearchText", "StatusFilter"], [3, "Provider", "RoutineID"], [3, "Provider", "RoutineID", "RoutineName"], [1, "urcc-title"], [1, "fa-solid", "fa-business-time"], [1, "urcc-count"], ["role", "tablist", "aria-label", "Routines views", 1, "urcc-tabs"], ["type", "button", "role", "tab", 1, "urcc-tab", 3, "click"], ["role", "tab", "aria-selected", "true", 1, "urcc-tab", "urcc-tab--active", "urcc-tab--context"], [1, "urcc-spacer"], ["mjButton", "", "variant", "outline", "size", "sm"], ["mjButton", "", "variant", "icon", "size", "sm", "title", "Close"], ["Placeholder", "Search routines...", 1, "urcc-search", 3, "ValueChange", "Value"], [3, "Clicked", "ShowLabel"], ["mjButton", "", "variant", "primary", "size", "sm", 3, "click"], [1, "fa-solid", "fa-plus"], ["mjButton", "", "variant", "outline", "size", "sm", 3, "click"], [1, "fa-solid", "fa-arrow-left"], ["mjButton", "", "variant", "icon", "size", "sm", "title", "Close", 3, "click"], [1, "fa-solid", "fa-xmark"], [3, "CreateRequested", "EditRequested", "HistoryRequested", "ConversationOpened", "RoutineSelected", "CountsChanged", "BeforeRoutinePaused", "AfterRoutinePaused", "BeforeRoutineRunNow", "AfterRoutineRunNow", "BeforeRoutineDeleted", "AfterRoutineDeleted", "Provider", "SearchText", "StatusFilter"], [3, "Saved", "Cancelled", "BeforeRoutineCreated", "AfterRoutineCreated", "Provider", "RoutineID"], [3, "HistoryRecordOpened", "ConversationOpened", "Provider", "RoutineID", "RoutineName"]], template: function UserRoutinesCommandCenterComponent_Template(rf, ctx) { if (rf & 1) {
308
+ i0.ɵɵelementStart(0, "div", 2);
309
+ i0.ɵɵconditionalCreate(1, UserRoutinesCommandCenterComponent_Conditional_1_Template, 16, 11, "div", 3);
310
+ i0.ɵɵelementStart(2, "div", 4);
311
+ i0.ɵɵconditionalCreate(3, UserRoutinesCommandCenterComponent_Case_3_Template, 2, 3, "mj-my-routines-list", 5)(4, UserRoutinesCommandCenterComponent_Case_4_Template, 1, 2, "mj-new-routine", 6)(5, UserRoutinesCommandCenterComponent_Case_5_Template, 2, 3, "mj-user-routine-history", 7);
312
+ i0.ɵɵelementEnd()();
313
+ } if (rf & 2) {
314
+ let tmp_1_0;
315
+ i0.ɵɵadvance();
316
+ i0.ɵɵconditional(ctx.ShowHeader ? 1 : -1);
317
+ i0.ɵɵadvance(2);
318
+ i0.ɵɵconditional((tmp_1_0 = ctx.ActiveView) === "list" ? 3 : tmp_1_0 === "editor" ? 4 : tmp_1_0 === "history" ? 5 : -1);
319
+ } }, dependencies: [i1.MJButtonDirective, i1.MJPageSearchComponent, i1.MJRefreshButtonComponent, i2.MyRoutinesListComponent, i3.NewRoutineComponent, i4.RoutineHistoryComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n height: 100%;\n}\n\n.urcc[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 0;\n}\n\n.urcc-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 10px;\n flex-wrap: wrap;\n padding: 10px 14px;\n border-bottom: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n}\n\n.urcc-title[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 15px;\n font-weight: 600;\n color: var(--mj-text-primary);\n white-space: nowrap;\n}\n\n.urcc-title[_ngcontent-%COMP%] > i[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n}\n\n.urcc-count[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n height: 20px;\n padding: 0 6px;\n border-radius: var(--mj-radius-full, 999px);\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 11px;\n font-weight: 700;\n}\n\n.urcc-tabs[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 2px;\n margin-left: 8px;\n}\n\n.urcc-tab[_ngcontent-%COMP%] {\n padding: 6px 12px;\n border: none;\n background: transparent;\n color: var(--mj-text-secondary);\n font-size: 13px;\n border-radius: var(--mj-radius-md, 8px);\n cursor: pointer;\n white-space: nowrap;\n}\n\n.urcc-tab[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.urcc-tab--active[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-weight: 600;\n}\n\n.urcc-tab--context[_ngcontent-%COMP%] {\n cursor: default;\n max-width: 260px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.urcc-spacer[_ngcontent-%COMP%] {\n flex: 1 1 auto;\n}\n\n.urcc-search[_ngcontent-%COMP%] {\n min-width: 180px;\n}\n\n.urcc-body[_ngcontent-%COMP%] {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n padding: 14px;\n background: var(--mj-bg-page);\n}"] });
320
+ }
321
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserRoutinesCommandCenterComponent, [{
322
+ type: Component,
323
+ args: [{ standalone: false, selector: 'mj-user-routines-command-center', template: "<div class=\"urcc\">\n @if (ShowHeader) {\n <div class=\"urcc-header\">\n <div class=\"urcc-title\">\n <i class=\"fa-solid fa-business-time\"></i>\n <span>Routines</span>\n @if (TotalCount > 0) {\n <span class=\"urcc-count\">{{ TotalCount }}</span>\n }\n </div>\n\n <div class=\"urcc-tabs\" role=\"tablist\" aria-label=\"Routines views\">\n <button type=\"button\" class=\"urcc-tab\" role=\"tab\"\n [class.urcc-tab--active]=\"ActiveView === 'list'\"\n [attr.aria-selected]=\"ActiveView === 'list'\"\n (click)=\"ShowList()\">\n My Routines\n </button>\n <button type=\"button\" class=\"urcc-tab\" role=\"tab\"\n [class.urcc-tab--active]=\"ActiveView === 'editor'\"\n [attr.aria-selected]=\"ActiveView === 'editor'\"\n (click)=\"ShowNewRoutine()\">\n {{ ActiveView === 'editor' && EditingRoutineID ? 'Edit Routine' : 'New Routine' }}\n </button>\n @if (ActiveView === 'history') {\n <span class=\"urcc-tab urcc-tab--active urcc-tab--context\" role=\"tab\" aria-selected=\"true\">\n History{{ HistoryRoutineName ? ' \u2014 ' + HistoryRoutineName : '' }}\n </span>\n }\n </div>\n\n <span class=\"urcc-spacer\"></span>\n\n @if (ActiveView === 'list') {\n <mj-page-search class=\"urcc-search\" Placeholder=\"Search routines...\"\n [Value]=\"SearchText\" (ValueChange)=\"OnSearchChange($event)\"></mj-page-search>\n <mj-refresh-button [ShowLabel]=\"false\" (Clicked)=\"Refresh()\"></mj-refresh-button>\n <button mjButton variant=\"primary\" size=\"sm\" (click)=\"ShowNewRoutine()\">\n <i class=\"fa-solid fa-plus\"></i> New Routine\n </button>\n } @else {\n <button mjButton variant=\"outline\" size=\"sm\" (click)=\"ShowList()\">\n <i class=\"fa-solid fa-arrow-left\"></i> Back to list\n </button>\n }\n\n @if (ShowClose) {\n <button mjButton variant=\"icon\" size=\"sm\" title=\"Close\" (click)=\"CloseRequested.emit()\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n }\n </div>\n }\n\n <div class=\"urcc-body\">\n @switch (ActiveView) {\n @case ('list') {\n <mj-my-routines-list #list\n [Provider]=\"Provider\"\n [SearchText]=\"SearchText\"\n [StatusFilter]=\"StatusFilter\"\n (CreateRequested)=\"ShowNewRoutine()\"\n (EditRequested)=\"OnEditRequested($event)\"\n (HistoryRequested)=\"OnHistoryRequested($event)\"\n (ConversationOpened)=\"ConversationOpened.emit($event)\"\n (RoutineSelected)=\"OnRoutineSelected($event)\"\n (CountsChanged)=\"OnCountsChanged($event)\"\n (BeforeRoutinePaused)=\"BeforeRoutinePaused.emit($event)\"\n (AfterRoutinePaused)=\"AfterRoutinePaused.emit($event)\"\n (BeforeRoutineRunNow)=\"BeforeRoutineRunNow.emit($event)\"\n (AfterRoutineRunNow)=\"AfterRoutineRunNow.emit($event)\"\n (BeforeRoutineDeleted)=\"BeforeRoutineDeleted.emit($event)\"\n (AfterRoutineDeleted)=\"AfterRoutineDeleted.emit($event)\">\n </mj-my-routines-list>\n }\n @case ('editor') {\n <mj-new-routine\n [Provider]=\"Provider\"\n [RoutineID]=\"EditingRoutineID\"\n (Saved)=\"OnEditorSaved($event)\"\n (Cancelled)=\"OnEditorCancelled()\"\n (BeforeRoutineCreated)=\"BeforeRoutineCreated.emit($event)\"\n (AfterRoutineCreated)=\"AfterRoutineCreated.emit($event)\">\n </mj-new-routine>\n }\n @case ('history') {\n <mj-user-routine-history #history\n [Provider]=\"Provider\"\n [RoutineID]=\"HistoryRoutineID\"\n [RoutineName]=\"HistoryRoutineName\"\n (HistoryRecordOpened)=\"HistoryRecordOpened.emit($event)\"\n (ConversationOpened)=\"ConversationOpened.emit($event)\">\n </mj-user-routine-history>\n }\n }\n </div>\n</div>\n", styles: [":host {\n display: block;\n height: 100%;\n}\n\n.urcc {\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 0;\n}\n\n.urcc-header {\n display: flex;\n align-items: center;\n gap: 10px;\n flex-wrap: wrap;\n padding: 10px 14px;\n border-bottom: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n}\n\n.urcc-title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 15px;\n font-weight: 600;\n color: var(--mj-text-primary);\n white-space: nowrap;\n}\n\n.urcc-title > i {\n color: var(--mj-brand-primary);\n}\n\n.urcc-count {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n height: 20px;\n padding: 0 6px;\n border-radius: var(--mj-radius-full, 999px);\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 11px;\n font-weight: 700;\n}\n\n.urcc-tabs {\n display: flex;\n align-items: center;\n gap: 2px;\n margin-left: 8px;\n}\n\n.urcc-tab {\n padding: 6px 12px;\n border: none;\n background: transparent;\n color: var(--mj-text-secondary);\n font-size: 13px;\n border-radius: var(--mj-radius-md, 8px);\n cursor: pointer;\n white-space: nowrap;\n}\n\n.urcc-tab:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.urcc-tab--active {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-weight: 600;\n}\n\n.urcc-tab--context {\n cursor: default;\n max-width: 260px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.urcc-spacer {\n flex: 1 1 auto;\n}\n\n.urcc-search {\n min-width: 180px;\n}\n\n.urcc-body {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n padding: 14px;\n background: var(--mj-bg-page);\n}\n"] }]
324
+ }], null, { list: [{
325
+ type: ViewChild,
326
+ args: ['list']
327
+ }], history: [{
328
+ type: ViewChild,
329
+ args: ['history']
330
+ }], ShowHeader: [{
331
+ type: Input
332
+ }], ShowClose: [{
333
+ type: Input
334
+ }], SelectedRoutineID: [{
335
+ type: Input
336
+ }], SearchText: [{
337
+ type: Input
338
+ }], StatusFilter: [{
339
+ type: Input
340
+ }], BeforeRoutineCreated: [{
341
+ type: Output
342
+ }], AfterRoutineCreated: [{
343
+ type: Output
344
+ }], BeforeRoutinePaused: [{
345
+ type: Output
346
+ }], AfterRoutinePaused: [{
347
+ type: Output
348
+ }], BeforeRoutineRunNow: [{
349
+ type: Output
350
+ }], AfterRoutineRunNow: [{
351
+ type: Output
352
+ }], BeforeRoutineDeleted: [{
353
+ type: Output
354
+ }], AfterRoutineDeleted: [{
355
+ type: Output
356
+ }], RoutineSelected: [{
357
+ type: Output
358
+ }], HistoryRecordOpened: [{
359
+ type: Output
360
+ }], ConversationOpened: [{
361
+ type: Output
362
+ }], CountsChanged: [{
363
+ type: Output
364
+ }], ViewChanged: [{
365
+ type: Output
366
+ }], CloseRequested: [{
367
+ type: Output
368
+ }], SelectedRoutineIDChange: [{
369
+ type: Output
370
+ }] }); })();
371
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserRoutinesCommandCenterComponent, { className: "UserRoutinesCommandCenterComponent", filePath: "src/lib/user-routines-command-center.component.ts", lineNumber: 38 }); })();
372
+ //# sourceMappingURL=user-routines-command-center.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-routines-command-center.component.js","sourceRoot":"","sources":["../../src/lib/user-routines-command-center.component.ts","../../src/lib/user-routines-command-center.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAuB,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;;ICK7E,gCAAyB;IAAA,YAAgB;IAAA,iBAAO;;;IAAvB,cAAgB;IAAhB,uCAAgB;;;IAkBzC,gCAA0F;IACxF,YACF;IAAA,iBAAO;;;IADL,cACF;IADE,+GACF;;;;IAOF,0CAC8D;IAAvC,gPAAe,6BAAsB,KAAC;IAAC,iBAAiB;IAC/E,6CAA6D;IAAtB,qOAAW,gBAAS,KAAC;IAAC,iBAAoB;IACjF,kCAAwE;IAA3B,sNAAS,uBAAgB,KAAC;IACrE,wBAAgC;IAAC,6BACnC;IAAA,iBAAS;;;IAJP,yCAAoB;IACH,cAAmB;IAAnB,iCAAmB;;;;IAKtC,kCAAkE;IAArB,sNAAS,iBAAU,KAAC;IAC/D,wBAAsC;IAAC,8BACzC;IAAA,iBAAS;;;;IAIT,kCAAwF;IAAhC,sNAAS,4BAAqB,KAAC;IACrF,wBAAiC;IACnC,iBAAS;;;;IA9CX,AADF,8BAAyB,aACC;IACtB,uBAAyC;IACzC,4BAAM;IAAA,wBAAQ;IAAA,iBAAO;IACrB,oHAAsB;IAGxB,iBAAM;IAGJ,AADF,+BAAkE,iBAIzC;IAArB,sMAAS,iBAAU,KAAC;IACpB,6BACF;IAAA,iBAAS;IACT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AS,UAuCR;;;iFDzDQ,kCAAkC;cAN9C,SAAS;6BACM,KAAK,YACP,iCAAiC;;kBAO1C,SAAS;mBAAC,MAAM;;kBAChB,SAAS;mBAAC,SAAS;;kBAMnB,KAAK;;kBAEL,KAAK;;kBAOL,KAAK;;kBAgBL,KAAK;;kBAEL,KAAK;;kBAKL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAEN,MAAM;;kBAKN,MAAM;;kFAhEE,kCAAkC","sourcesContent":["import { ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewChild, inject } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJUserRoutineEntity, UserRoutineEngine } from '@memberjunction/core-entities';\nimport { MyRoutinesListComponent, RoutineCounts, RoutineStatusFilter } from './my-routines-list.component';\nimport { RoutineHistoryComponent } from './routine-history.component';\nimport { ConversationOpenedEventArgs,\n AfterRoutineCreatedEventArgs,\n AfterRoutineDeletedEventArgs,\n AfterRoutinePausedEventArgs,\n AfterRoutineRunNowEventArgs,\n BeforeRoutineCreatedEventArgs,\n BeforeRoutineDeletedEventArgs,\n BeforeRoutinePausedEventArgs,\n BeforeRoutineRunNowEventArgs,\n HistoryRecordOpenedEventArgs,\n RoutineSelectedEventArgs,\n} from './user-routines-events';\n\n/** The command center's active internal view. */\nexport type UserRoutinesView = 'list' | 'editor' | 'history';\n\n/**\n * User Routines \"command center\" — the composite surface combining the routines list\n * (default view), the create/edit form, and per-routine run history behind an internal\n * tabbed navigation. This is the component hosts embed (Explorer full page, the\n * slide-in, or any custom app); the individual pieces remain exported for bespoke\n * layouts.\n *\n * All child events bubble here unchanged (including the cancelable Before/After\n * pairs), so a consumer only ever wires this one component.\n */\n@Component({\n standalone: false,\n selector: 'mj-user-routines-command-center',\n templateUrl: './user-routines-command-center.component.html',\n styleUrls: ['./user-routines-command-center.component.css'],\n})\nexport class UserRoutinesCommandCenterComponent extends BaseAngularComponent {\n private cdr = inject(ChangeDetectorRef);\n\n @ViewChild('list') private list?: MyRoutinesListComponent;\n @ViewChild('history') private history?: RoutineHistoryComponent;\n\n // ---------------------------------------------------------------\n // Inputs\n // ---------------------------------------------------------------\n /** Render the built-in compact header (mark + tabs + list controls). Hosts with their own chrome set false. */\n @Input() ShowHeader = true;\n /** Show a close (X) affordance in the built-in header (used by the slide-in wrapper). */\n @Input() ShowClose = false;\n\n private _selectedRoutineID: string | null = null;\n /**\n * Deep-link style selection: setting a routine ID opens its history view\n * (clearing it returns to the list). Used by Explorer's query-param round trip.\n */\n @Input()\n public set SelectedRoutineID(value: string | null) {\n if (value !== this._selectedRoutineID) {\n this._selectedRoutineID = value;\n if (value) {\n this.openHistoryById(value);\n } else if (this.ActiveView === 'history') {\n this.ShowList();\n }\n }\n }\n public get SelectedRoutineID(): string | null {\n return this._selectedRoutineID;\n }\n\n /** Search text applied to the list view (hosts with their own chrome bind this). */\n @Input() SearchText = '';\n /** Status filter applied to the list view. */\n @Input() StatusFilter: RoutineStatusFilter = 'all';\n\n // ---------------------------------------------------------------\n // Outputs — bubbled child events + view changes\n // ---------------------------------------------------------------\n @Output() BeforeRoutineCreated = new EventEmitter<BeforeRoutineCreatedEventArgs>();\n @Output() AfterRoutineCreated = new EventEmitter<AfterRoutineCreatedEventArgs>();\n @Output() BeforeRoutinePaused = new EventEmitter<BeforeRoutinePausedEventArgs>();\n @Output() AfterRoutinePaused = new EventEmitter<AfterRoutinePausedEventArgs>();\n @Output() BeforeRoutineRunNow = new EventEmitter<BeforeRoutineRunNowEventArgs>();\n @Output() AfterRoutineRunNow = new EventEmitter<AfterRoutineRunNowEventArgs>();\n @Output() BeforeRoutineDeleted = new EventEmitter<BeforeRoutineDeletedEventArgs>();\n @Output() AfterRoutineDeleted = new EventEmitter<AfterRoutineDeletedEventArgs>();\n @Output() RoutineSelected = new EventEmitter<RoutineSelectedEventArgs>();\n @Output() HistoryRecordOpened = new EventEmitter<HistoryRecordOpenedEventArgs>();\n /** Re-emitted from the list — the routine's dedicated conversation was requested. */\n @Output() ConversationOpened = new EventEmitter<ConversationOpenedEventArgs>();\n /** Loaded/filtered counts changed in the list view. */\n @Output() CountsChanged = new EventEmitter<RoutineCounts>();\n /** The active internal view changed ('list' | 'editor' | 'history'). */\n @Output() ViewChanged = new EventEmitter<UserRoutinesView>();\n /** The user clicked the built-in close affordance (slide-in wrapper handles it). */\n @Output() CloseRequested = new EventEmitter<void>();\n /**\n * The selected routine (history view) changed — `null` when returning to the list.\n * Hosts using query-param round trips two-way bind [(SelectedRoutineID)].\n */\n @Output() SelectedRoutineIDChange = new EventEmitter<string | null>();\n\n // ---------------------------------------------------------------\n // State\n // ---------------------------------------------------------------\n public ActiveView: UserRoutinesView = 'list';\n /** Routine being edited (null = creating a new one). */\n public EditingRoutineID: string | null = null;\n /** Routine whose history is open. */\n public HistoryRoutineID: string | null = null;\n public HistoryRoutineName: string | null = null;\n public TotalCount = 0;\n public FilteredCount = 0;\n\n // ---------------------------------------------------------------\n // Navigation (public so hosts can drive the surface programmatically)\n // ---------------------------------------------------------------\n public ShowList(): void {\n this.setView('list');\n this.setSelectedRoutine(null);\n }\n\n public ShowNewRoutine(): void {\n this.EditingRoutineID = null;\n this.setView('editor');\n }\n\n public ShowEditRoutine(routine: MJUserRoutineEntity | string): void {\n this.EditingRoutineID = typeof routine === 'string' ? routine : routine.ID;\n this.setView('editor');\n }\n\n public ShowHistory(routine: MJUserRoutineEntity | string): void {\n if (typeof routine === 'string') {\n this.openHistoryById(routine);\n } else {\n this.HistoryRoutineID = routine.ID;\n this.HistoryRoutineName = routine.Name;\n this.setView('history');\n this.setSelectedRoutine(routine.ID);\n }\n }\n\n /** Force-refreshes the active view's data. */\n public async Refresh(): Promise<void> {\n if (this.ActiveView === 'history') {\n await this.history?.Refresh(true);\n } else {\n await this.list?.Refresh();\n }\n }\n\n // ---------------------------------------------------------------\n // Child wiring\n // ---------------------------------------------------------------\n public OnCountsChanged(counts: RoutineCounts): void {\n this.TotalCount = counts.Total;\n this.FilteredCount = counts.Filtered;\n this.CountsChanged.emit(counts);\n this.cdr.markForCheck();\n }\n\n public OnRoutineSelected(args: RoutineSelectedEventArgs): void {\n this.RoutineSelected.emit(args);\n }\n\n public OnHistoryRequested(routine: MJUserRoutineEntity): void {\n this.ShowHistory(routine);\n }\n\n public OnEditRequested(routine: MJUserRoutineEntity): void {\n this.ShowEditRoutine(routine);\n }\n\n public OnEditorSaved(_routine: MJUserRoutineEntity): void {\n this.ShowList();\n }\n\n public OnEditorCancelled(): void {\n this.ShowList();\n }\n\n public OnSearchChange(value: string): void {\n this.SearchText = value;\n this.cdr.markForCheck();\n }\n\n // ---------------------------------------------------------------\n // Internals\n // ---------------------------------------------------------------\n private setView(view: UserRoutinesView): void {\n if (this.ActiveView !== view) {\n this.ActiveView = view;\n this.ViewChanged.emit(view);\n this.cdr.markForCheck();\n }\n }\n\n private setSelectedRoutine(routineId: string | null): void {\n if (this._selectedRoutineID !== routineId) {\n this._selectedRoutineID = routineId;\n this.SelectedRoutineIDChange.emit(routineId);\n }\n }\n\n private openHistoryById(routineId: string): void {\n this.HistoryRoutineID = routineId;\n const p = this.ProviderToUse;\n const engine = UserRoutineEngine.GetProviderInstance<UserRoutineEngine>(p, UserRoutineEngine) as UserRoutineEngine;\n this.HistoryRoutineName = engine.GetRoutineByID(routineId)?.Name ?? null;\n this.setView('history');\n this.setSelectedRoutine(routineId);\n }\n}\n","<div class=\"urcc\">\n @if (ShowHeader) {\n <div class=\"urcc-header\">\n <div class=\"urcc-title\">\n <i class=\"fa-solid fa-business-time\"></i>\n <span>Routines</span>\n @if (TotalCount > 0) {\n <span class=\"urcc-count\">{{ TotalCount }}</span>\n }\n </div>\n\n <div class=\"urcc-tabs\" role=\"tablist\" aria-label=\"Routines views\">\n <button type=\"button\" class=\"urcc-tab\" role=\"tab\"\n [class.urcc-tab--active]=\"ActiveView === 'list'\"\n [attr.aria-selected]=\"ActiveView === 'list'\"\n (click)=\"ShowList()\">\n My Routines\n </button>\n <button type=\"button\" class=\"urcc-tab\" role=\"tab\"\n [class.urcc-tab--active]=\"ActiveView === 'editor'\"\n [attr.aria-selected]=\"ActiveView === 'editor'\"\n (click)=\"ShowNewRoutine()\">\n {{ ActiveView === 'editor' && EditingRoutineID ? 'Edit Routine' : 'New Routine' }}\n </button>\n @if (ActiveView === 'history') {\n <span class=\"urcc-tab urcc-tab--active urcc-tab--context\" role=\"tab\" aria-selected=\"true\">\n History{{ HistoryRoutineName ? ' — ' + HistoryRoutineName : '' }}\n </span>\n }\n </div>\n\n <span class=\"urcc-spacer\"></span>\n\n @if (ActiveView === 'list') {\n <mj-page-search class=\"urcc-search\" Placeholder=\"Search routines...\"\n [Value]=\"SearchText\" (ValueChange)=\"OnSearchChange($event)\"></mj-page-search>\n <mj-refresh-button [ShowLabel]=\"false\" (Clicked)=\"Refresh()\"></mj-refresh-button>\n <button mjButton variant=\"primary\" size=\"sm\" (click)=\"ShowNewRoutine()\">\n <i class=\"fa-solid fa-plus\"></i> New Routine\n </button>\n } @else {\n <button mjButton variant=\"outline\" size=\"sm\" (click)=\"ShowList()\">\n <i class=\"fa-solid fa-arrow-left\"></i> Back to list\n </button>\n }\n\n @if (ShowClose) {\n <button mjButton variant=\"icon\" size=\"sm\" title=\"Close\" (click)=\"CloseRequested.emit()\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n }\n </div>\n }\n\n <div class=\"urcc-body\">\n @switch (ActiveView) {\n @case ('list') {\n <mj-my-routines-list #list\n [Provider]=\"Provider\"\n [SearchText]=\"SearchText\"\n [StatusFilter]=\"StatusFilter\"\n (CreateRequested)=\"ShowNewRoutine()\"\n (EditRequested)=\"OnEditRequested($event)\"\n (HistoryRequested)=\"OnHistoryRequested($event)\"\n (ConversationOpened)=\"ConversationOpened.emit($event)\"\n (RoutineSelected)=\"OnRoutineSelected($event)\"\n (CountsChanged)=\"OnCountsChanged($event)\"\n (BeforeRoutinePaused)=\"BeforeRoutinePaused.emit($event)\"\n (AfterRoutinePaused)=\"AfterRoutinePaused.emit($event)\"\n (BeforeRoutineRunNow)=\"BeforeRoutineRunNow.emit($event)\"\n (AfterRoutineRunNow)=\"AfterRoutineRunNow.emit($event)\"\n (BeforeRoutineDeleted)=\"BeforeRoutineDeleted.emit($event)\"\n (AfterRoutineDeleted)=\"AfterRoutineDeleted.emit($event)\">\n </mj-my-routines-list>\n }\n @case ('editor') {\n <mj-new-routine\n [Provider]=\"Provider\"\n [RoutineID]=\"EditingRoutineID\"\n (Saved)=\"OnEditorSaved($event)\"\n (Cancelled)=\"OnEditorCancelled()\"\n (BeforeRoutineCreated)=\"BeforeRoutineCreated.emit($event)\"\n (AfterRoutineCreated)=\"AfterRoutineCreated.emit($event)\">\n </mj-new-routine>\n }\n @case ('history') {\n <mj-user-routine-history #history\n [Provider]=\"Provider\"\n [RoutineID]=\"HistoryRoutineID\"\n [RoutineName]=\"HistoryRoutineName\"\n (HistoryRecordOpened)=\"HistoryRecordOpened.emit($event)\"\n (ConversationOpened)=\"ConversationOpened.emit($event)\">\n </mj-user-routine-history>\n }\n }\n </div>\n</div>\n"]}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * User Routines Event System.
3
+ *
4
+ * Follows the Before/After cancelable event idiom used across MJ generic packages
5
+ * (ng-trees / entity-data-grid / ng-conversations): `Before*` events expose a
6
+ * mutable `Cancel` flag the consumer can set synchronously to veto the operation;
7
+ * `After*` events are informational.
8
+ */
9
+ import type { MJUserRoutineEntity } from '@memberjunction/core-entities';
10
+ /** Base class for all User Routine events. */
11
+ export declare class UserRoutineEventArgs {
12
+ /** The routine involved in the event. For BeforeRoutineCreated this is the not-yet-saved entity. */
13
+ readonly Routine: MJUserRoutineEntity;
14
+ /** Timestamp when the event was raised. */
15
+ readonly Timestamp: Date;
16
+ constructor(routine: MJUserRoutineEntity);
17
+ }
18
+ /** Base class for cancelable (Before) events. */
19
+ export declare class CancelableUserRoutineEventArgs extends UserRoutineEventArgs {
20
+ /** Set to true to cancel the operation. */
21
+ Cancel: boolean;
22
+ /** Optional reason for cancellation (for logging/debugging). */
23
+ CancelReason?: string;
24
+ }
25
+ /** Raised before a NEW routine is saved for the first time. Cancelable. */
26
+ export declare class BeforeRoutineCreatedEventArgs extends CancelableUserRoutineEventArgs {
27
+ }
28
+ /** Raised after a new routine (and its recipients) was persisted. */
29
+ export declare class AfterRoutineCreatedEventArgs extends UserRoutineEventArgs {
30
+ }
31
+ /** Raised before a routine's Status is toggled (pause OR resume). Cancelable. */
32
+ export declare class BeforeRoutinePausedEventArgs extends CancelableUserRoutineEventArgs {
33
+ /** The status the routine will move to if the operation proceeds. */
34
+ readonly NewStatus: MJUserRoutineEntity['Status'];
35
+ constructor(routine: MJUserRoutineEntity, newStatus: MJUserRoutineEntity['Status']);
36
+ }
37
+ /** Raised after a routine's Status toggle was persisted. */
38
+ export declare class AfterRoutinePausedEventArgs extends UserRoutineEventArgs {
39
+ /** The status the routine now has. */
40
+ readonly NewStatus: MJUserRoutineEntity['Status'];
41
+ constructor(routine: MJUserRoutineEntity, newStatus: MJUserRoutineEntity['Status']);
42
+ }
43
+ /** Raised before a routine is queued to run now (NextRunAt = now). Cancelable. */
44
+ export declare class BeforeRoutineRunNowEventArgs extends CancelableUserRoutineEventArgs {
45
+ }
46
+ /** Raised after a routine was queued to run now. */
47
+ export declare class AfterRoutineRunNowEventArgs extends UserRoutineEventArgs {
48
+ }
49
+ /** Raised before a routine (and its recipients) is deleted. Cancelable. */
50
+ export declare class BeforeRoutineDeletedEventArgs extends CancelableUserRoutineEventArgs {
51
+ }
52
+ /** Raised after a routine was deleted. */
53
+ export declare class AfterRoutineDeletedEventArgs extends UserRoutineEventArgs {
54
+ }
55
+ /** Informational: the user selected a routine (opened its history / detail). */
56
+ export declare class RoutineSelectedEventArgs extends UserRoutineEventArgs {
57
+ }
58
+ /**
59
+ * Informational: the user asked to open the execution record linked to a run
60
+ * (Agent Run / Prompt Run / Action Execution Log). The host owns navigation —
61
+ * Generic components never touch the Router.
62
+ */
63
+ /**
64
+ * Raised when the user opens a routine's dedicated conversation (the Application-scoped
65
+ * thread the dispatcher appends each Agent run to). The host decides how to present it —
66
+ * the conversations surface selects it in chat; other hosts may navigate.
67
+ */
68
+ export declare class ConversationOpenedEventArgs {
69
+ /** The conversation to open. */
70
+ readonly ConversationID: string;
71
+ /** The routine the conversation belongs to. */
72
+ readonly Routine: MJUserRoutineEntity;
73
+ /** Timestamp when the event was raised. */
74
+ readonly Timestamp: Date;
75
+ constructor(conversationId: string, routine: MJUserRoutineEntity);
76
+ }
77
+ export declare class HistoryRecordOpenedEventArgs {
78
+ /** Entity name of the linked record (e.g. 'MJ: AI Agent Runs'). */
79
+ readonly EntityName: string;
80
+ /** Primary key of the linked record. */
81
+ readonly RecordID: string;
82
+ /** The routine the run belongs to, when known. */
83
+ readonly Routine: MJUserRoutineEntity | null;
84
+ /** Timestamp when the event was raised. */
85
+ readonly Timestamp: Date;
86
+ constructor(entityName: string, recordId: string, routine?: MJUserRoutineEntity | null);
87
+ }
88
+ //# sourceMappingURL=user-routines-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-routines-events.d.ts","sourceRoot":"","sources":["../../src/lib/user-routines-events.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,8CAA8C;AAC9C,qBAAa,oBAAoB;IAC7B,oGAAoG;IACpG,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IAEtC,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;gBAEb,OAAO,EAAE,mBAAmB;CAI3C;AAED,iDAAiD;AACjD,qBAAa,8BAA+B,SAAQ,oBAAoB;IACpE,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAS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,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAE7C,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;gBAEb,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAmB,GAAG,IAAW;CAM/F"}
@@ -0,0 +1,97 @@
1
+ /** Base class for all User Routine events. */
2
+ export class UserRoutineEventArgs {
3
+ /** The routine involved in the event. For BeforeRoutineCreated this is the not-yet-saved entity. */
4
+ Routine;
5
+ /** Timestamp when the event was raised. */
6
+ Timestamp;
7
+ constructor(routine) {
8
+ this.Routine = routine;
9
+ this.Timestamp = new Date();
10
+ }
11
+ }
12
+ /** Base class for cancelable (Before) events. */
13
+ export class CancelableUserRoutineEventArgs extends UserRoutineEventArgs {
14
+ /** Set to true to cancel the operation. */
15
+ Cancel = false;
16
+ /** Optional reason for cancellation (for logging/debugging). */
17
+ CancelReason;
18
+ }
19
+ /** Raised before a NEW routine is saved for the first time. Cancelable. */
20
+ export class BeforeRoutineCreatedEventArgs extends CancelableUserRoutineEventArgs {
21
+ }
22
+ /** Raised after a new routine (and its recipients) was persisted. */
23
+ export class AfterRoutineCreatedEventArgs extends UserRoutineEventArgs {
24
+ }
25
+ /** Raised before a routine's Status is toggled (pause OR resume). Cancelable. */
26
+ export class BeforeRoutinePausedEventArgs extends CancelableUserRoutineEventArgs {
27
+ /** The status the routine will move to if the operation proceeds. */
28
+ NewStatus;
29
+ constructor(routine, newStatus) {
30
+ super(routine);
31
+ this.NewStatus = newStatus;
32
+ }
33
+ }
34
+ /** Raised after a routine's Status toggle was persisted. */
35
+ export class AfterRoutinePausedEventArgs extends UserRoutineEventArgs {
36
+ /** The status the routine now has. */
37
+ NewStatus;
38
+ constructor(routine, newStatus) {
39
+ super(routine);
40
+ this.NewStatus = newStatus;
41
+ }
42
+ }
43
+ /** Raised before a routine is queued to run now (NextRunAt = now). Cancelable. */
44
+ export class BeforeRoutineRunNowEventArgs extends CancelableUserRoutineEventArgs {
45
+ }
46
+ /** Raised after a routine was queued to run now. */
47
+ export class AfterRoutineRunNowEventArgs extends UserRoutineEventArgs {
48
+ }
49
+ /** Raised before a routine (and its recipients) is deleted. Cancelable. */
50
+ export class BeforeRoutineDeletedEventArgs extends CancelableUserRoutineEventArgs {
51
+ }
52
+ /** Raised after a routine was deleted. */
53
+ export class AfterRoutineDeletedEventArgs extends UserRoutineEventArgs {
54
+ }
55
+ /** Informational: the user selected a routine (opened its history / detail). */
56
+ export class RoutineSelectedEventArgs extends UserRoutineEventArgs {
57
+ }
58
+ /**
59
+ * Informational: the user asked to open the execution record linked to a run
60
+ * (Agent Run / Prompt Run / Action Execution Log). The host owns navigation —
61
+ * Generic components never touch the Router.
62
+ */
63
+ /**
64
+ * Raised when the user opens a routine's dedicated conversation (the Application-scoped
65
+ * thread the dispatcher appends each Agent run to). The host decides how to present it —
66
+ * the conversations surface selects it in chat; other hosts may navigate.
67
+ */
68
+ export class ConversationOpenedEventArgs {
69
+ /** The conversation to open. */
70
+ ConversationID;
71
+ /** The routine the conversation belongs to. */
72
+ Routine;
73
+ /** Timestamp when the event was raised. */
74
+ Timestamp;
75
+ constructor(conversationId, routine) {
76
+ this.ConversationID = conversationId;
77
+ this.Routine = routine;
78
+ this.Timestamp = new Date();
79
+ }
80
+ }
81
+ export class HistoryRecordOpenedEventArgs {
82
+ /** Entity name of the linked record (e.g. 'MJ: AI Agent Runs'). */
83
+ EntityName;
84
+ /** Primary key of the linked record. */
85
+ RecordID;
86
+ /** The routine the run belongs to, when known. */
87
+ Routine;
88
+ /** Timestamp when the event was raised. */
89
+ Timestamp;
90
+ constructor(entityName, recordId, routine = null) {
91
+ this.EntityName = entityName;
92
+ this.RecordID = recordId;
93
+ this.Routine = routine;
94
+ this.Timestamp = new Date();
95
+ }
96
+ }
97
+ //# sourceMappingURL=user-routines-events.js.map