@memberjunction/ng-artifacts 5.43.0 → 5.45.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 (65) hide show
  1. package/README.md +6 -0
  2. package/dist/lib/artifacts.module.d.ts +28 -25
  3. package/dist/lib/artifacts.module.d.ts.map +1 -1
  4. package/dist/lib/artifacts.module.js +22 -2
  5. package/dist/lib/artifacts.module.js.map +1 -1
  6. package/dist/lib/components/artifact-version-history.component.d.ts +1 -0
  7. package/dist/lib/components/artifact-version-history.component.d.ts.map +1 -1
  8. package/dist/lib/components/artifact-version-history.component.js +30 -31
  9. package/dist/lib/components/artifact-version-history.component.js.map +1 -1
  10. package/dist/lib/components/artifact-viewer-panel.component.d.ts +3 -0
  11. package/dist/lib/components/artifact-viewer-panel.component.d.ts.map +1 -1
  12. package/dist/lib/components/artifact-viewer-panel.component.js +198 -112
  13. package/dist/lib/components/artifact-viewer-panel.component.js.map +1 -1
  14. package/dist/lib/components/plugins/audio-artifact-viewer.component.d.ts +11 -0
  15. package/dist/lib/components/plugins/audio-artifact-viewer.component.d.ts.map +1 -1
  16. package/dist/lib/components/plugins/audio-artifact-viewer.component.js +37 -12
  17. package/dist/lib/components/plugins/audio-artifact-viewer.component.js.map +1 -1
  18. package/dist/lib/components/plugins/component-feedback-panel/component-feedback-panel.component.d.ts.map +1 -1
  19. package/dist/lib/components/plugins/component-feedback-panel/component-feedback-panel.component.js +40 -51
  20. package/dist/lib/components/plugins/component-feedback-panel/component-feedback-panel.component.js.map +1 -1
  21. package/dist/lib/components/plugins/data-artifact-viewer.component.js +27 -47
  22. package/dist/lib/components/plugins/data-artifact-viewer.component.js.map +1 -1
  23. package/dist/lib/components/plugins/data-requirements-viewer/data-requirements-viewer.component.js +89 -95
  24. package/dist/lib/components/plugins/data-requirements-viewer/data-requirements-viewer.component.js.map +1 -1
  25. package/dist/lib/components/plugins/ml-experiment-results-viewer.component.d.ts +227 -0
  26. package/dist/lib/components/plugins/ml-experiment-results-viewer.component.d.ts.map +1 -0
  27. package/dist/lib/components/plugins/ml-experiment-results-viewer.component.js +630 -0
  28. package/dist/lib/components/plugins/ml-experiment-results-viewer.component.js.map +1 -0
  29. package/dist/lib/components/plugins/video-artifact-viewer.component.d.ts +11 -0
  30. package/dist/lib/components/plugins/video-artifact-viewer.component.d.ts.map +1 -1
  31. package/dist/lib/components/plugins/video-artifact-viewer.component.js +37 -12
  32. package/dist/lib/components/plugins/video-artifact-viewer.component.js.map +1 -1
  33. package/dist/lib/components/previews/audio-artifact-preview.component.d.ts +18 -4
  34. package/dist/lib/components/previews/audio-artifact-preview.component.d.ts.map +1 -1
  35. package/dist/lib/components/previews/audio-artifact-preview.component.js +54 -21
  36. package/dist/lib/components/previews/audio-artifact-preview.component.js.map +1 -1
  37. package/dist/lib/components/previews/video-artifact-preview.component.d.ts +19 -5
  38. package/dist/lib/components/previews/video-artifact-preview.component.d.ts.map +1 -1
  39. package/dist/lib/components/previews/video-artifact-preview.component.js +54 -22
  40. package/dist/lib/components/previews/video-artifact-preview.component.js.map +1 -1
  41. package/dist/public-api.d.ts +1 -0
  42. package/dist/public-api.d.ts.map +1 -1
  43. package/dist/public-api.js +1 -0
  44. package/dist/public-api.js.map +1 -1
  45. package/package.json +21 -18
  46. package/dist/__tests__/exports.test.d.ts +0 -2
  47. package/dist/__tests__/exports.test.d.ts.map +0 -1
  48. package/dist/__tests__/exports.test.js +0 -17
  49. package/dist/__tests__/exports.test.js.map +0 -1
  50. package/dist/__tests__/image-artifact-viewer.test.d.ts +0 -2
  51. package/dist/__tests__/image-artifact-viewer.test.d.ts.map +0 -1
  52. package/dist/__tests__/image-artifact-viewer.test.js +0 -62
  53. package/dist/__tests__/image-artifact-viewer.test.js.map +0 -1
  54. package/dist/__tests__/index.test.d.ts +0 -2
  55. package/dist/__tests__/index.test.d.ts.map +0 -1
  56. package/dist/__tests__/index.test.js +0 -7
  57. package/dist/__tests__/index.test.js.map +0 -1
  58. package/dist/lib/__tests__/artifact-snapshots.test.d.ts +0 -2
  59. package/dist/lib/__tests__/artifact-snapshots.test.d.ts.map +0 -1
  60. package/dist/lib/__tests__/artifact-snapshots.test.js +0 -155
  61. package/dist/lib/__tests__/artifact-snapshots.test.js.map +0 -1
  62. package/dist/lib/__tests__/interactive-form-apply.service.test.d.ts +0 -2
  63. package/dist/lib/__tests__/interactive-form-apply.service.test.d.ts.map +0 -1
  64. package/dist/lib/__tests__/interactive-form-apply.service.test.js +0 -211
  65. package/dist/lib/__tests__/interactive-form-apply.service.test.js.map +0 -1
package/README.md CHANGED
@@ -136,8 +136,13 @@ export class MyCustomViewerComponent extends BaseArtifactViewerComponent {
136
136
  | `MarkdownArtifactViewerComponent` | Markdown | Rendered markdown content |
137
137
  | `HtmlArtifactViewerComponent` | HTML | Sandboxed HTML rendering |
138
138
  | `SvgArtifactViewerComponent` | SVG | SVG image rendering |
139
+ | `AudioArtifactViewerComponent` | Audio | Audio playback via `mj-media-player` (transport, waveform scrubber, playback speed) |
140
+ | `VideoArtifactViewerComponent` | Video | Video playback via `mj-media-player` (transport, fullscreen, playback speed) |
139
141
  | `ComponentArtifactViewerComponent` | Component | Dynamic React/Angular component rendering |
140
142
 
143
+ > Audio and video artifacts (both the full viewer and the inline conversation **preview**) embed the
144
+ > generic `mj-media-player` from [@memberjunction/ng-media-player](../media-player/README.md).
145
+
141
146
  ## Services
142
147
 
143
148
  ### ArtifactIconService
@@ -165,6 +170,7 @@ getIcon() {
165
170
  | `@memberjunction/interactive-component-types` | Interactive component interfaces |
166
171
  | `@memberjunction/ng-base-types` | Base Angular component types |
167
172
  | `@memberjunction/ng-code-editor` | Code editor for code artifacts |
173
+ | `@memberjunction/ng-media-player` | Audio/video playback (`mj-media-player`) for audio & video artifacts |
168
174
  | `@memberjunction/ng-notifications` | Notification system |
169
175
  | `@memberjunction/ng-react` | React component bridge |
170
176
  | `@memberjunction/ng-shared-generic` | Shared generic components |
@@ -11,30 +11,33 @@ import * as i8 from "./components/plugins/html-artifact-viewer.component";
11
11
  import * as i9 from "./components/plugins/svg-artifact-viewer.component";
12
12
  import * as i10 from "./components/plugins/component-artifact-viewer.component";
13
13
  import * as i11 from "./components/plugins/data-artifact-viewer.component";
14
- import * as i12 from "./components/plugins/save-query-dialog.component";
15
- import * as i13 from "./components/plugins/data-requirements-viewer/data-requirements-viewer.component";
16
- import * as i14 from "./components/file-artifact-toolbar.component";
17
- import * as i15 from "./components/plugins/pdf-artifact-viewer.component";
18
- import * as i16 from "./components/plugins/xlsx-artifact-viewer.component";
19
- import * as i17 from "./components/plugins/docx-artifact-viewer.component";
20
- import * as i18 from "./components/plugins/image-artifact-viewer.component";
21
- import * as i19 from "./components/plugins/video-artifact-viewer.component";
22
- import * as i20 from "./components/plugins/audio-artifact-viewer.component";
23
- import * as i21 from "./components/previews/image-artifact-preview.component";
24
- import * as i22 from "./components/previews/video-artifact-preview.component";
25
- import * as i23 from "./components/previews/audio-artifact-preview.component";
26
- import * as i24 from "@angular/common";
27
- import * as i25 from "@angular/forms";
28
- import * as i26 from "@memberjunction/ng-markdown";
29
- import * as i27 from "@memberjunction/ng-code-editor";
30
- import * as i28 from "@memberjunction/ng-react";
31
- import * as i29 from "@memberjunction/ng-notifications";
32
- import * as i30 from "@memberjunction/ng-query-viewer";
33
- import * as i31 from "@memberjunction/ng-shared-generic";
34
- import * as i32 from "@memberjunction/ng-trees";
35
- import * as i33 from "@memberjunction/ng-base-forms";
36
- import * as i34 from "./components/plugins/component-feedback-panel/component-feedback-panel.component";
37
- import * as i35 from "ag-grid-angular";
14
+ import * as i12 from "./components/plugins/ml-experiment-results-viewer.component";
15
+ import * as i13 from "./components/plugins/save-query-dialog.component";
16
+ import * as i14 from "./components/plugins/data-requirements-viewer/data-requirements-viewer.component";
17
+ import * as i15 from "./components/file-artifact-toolbar.component";
18
+ import * as i16 from "./components/plugins/pdf-artifact-viewer.component";
19
+ import * as i17 from "./components/plugins/xlsx-artifact-viewer.component";
20
+ import * as i18 from "./components/plugins/docx-artifact-viewer.component";
21
+ import * as i19 from "./components/plugins/image-artifact-viewer.component";
22
+ import * as i20 from "./components/plugins/video-artifact-viewer.component";
23
+ import * as i21 from "./components/plugins/audio-artifact-viewer.component";
24
+ import * as i22 from "./components/previews/image-artifact-preview.component";
25
+ import * as i23 from "./components/previews/video-artifact-preview.component";
26
+ import * as i24 from "./components/previews/audio-artifact-preview.component";
27
+ import * as i25 from "@angular/common";
28
+ import * as i26 from "@angular/forms";
29
+ import * as i27 from "@memberjunction/ng-markdown";
30
+ import * as i28 from "@memberjunction/ng-code-editor";
31
+ import * as i29 from "@memberjunction/ng-react";
32
+ import * as i30 from "@memberjunction/ng-notifications";
33
+ import * as i31 from "@memberjunction/ng-query-viewer";
34
+ import * as i32 from "@memberjunction/ng-shared-generic";
35
+ import * as i33 from "@memberjunction/ng-trees";
36
+ import * as i34 from "@memberjunction/ng-base-forms";
37
+ import * as i35 from "./components/plugins/component-feedback-panel/component-feedback-panel.component";
38
+ import * as i36 from "@memberjunction/ng-media-player";
39
+ import * as i37 from "ag-grid-angular";
40
+ import * as i38 from "@memberjunction/ng-ui-components";
38
41
  /**
39
42
  * Module for artifact viewer plugin system.
40
43
  * Provides components for viewing different types of artifacts (JSON, Code, Markdown, HTML, SVG, Components).
@@ -54,7 +57,7 @@ export declare class ArtifactsModule {
54
57
  */
55
58
  private static warnOnPluginsWithoutRenderTarget;
56
59
  static ɵfac: i0.ɵɵFactoryDeclaration<ArtifactsModule, never>;
57
- static ɵmod: i0.ɵɵNgModuleDeclaration<ArtifactsModule, [typeof i1.ArtifactTypePluginViewerComponent, typeof i2.ArtifactViewerPanelComponent, typeof i3.ArtifactVersionHistoryComponent, typeof i4.ArtifactMessageCardComponent, typeof i5.JsonArtifactViewerComponent, typeof i6.CodeArtifactViewerComponent, typeof i7.MarkdownArtifactViewerComponent, typeof i8.HtmlArtifactViewerComponent, typeof i9.SvgArtifactViewerComponent, typeof i10.ComponentArtifactViewerComponent, typeof i11.DataArtifactViewerComponent, typeof i12.SaveQueryPanelComponent, typeof i13.DataRequirementsViewerComponent, typeof i14.FileArtifactToolbarComponent, typeof i15.PdfArtifactViewerComponent, typeof i16.XlsxArtifactViewerComponent, typeof i17.DocxArtifactViewerComponent, typeof i18.ImageArtifactViewerComponent, typeof i19.VideoArtifactViewerComponent, typeof i20.AudioArtifactViewerComponent, typeof i21.ImageArtifactPreviewComponent, typeof i22.VideoArtifactPreviewComponent, typeof i23.AudioArtifactPreviewComponent], [typeof i24.CommonModule, typeof i25.FormsModule, typeof i26.MarkdownModule, typeof i27.CodeEditorModule, typeof i28.MJReactModule, typeof i29.MJNotificationsModule, typeof i30.QueryViewerModule, typeof i31.SharedGenericModule, typeof i32.NgTreesModule, typeof i33.BaseFormsModule, typeof i34.ComponentFeedbackPanelComponent, typeof i35.AgGridModule], [typeof i1.ArtifactTypePluginViewerComponent, typeof i2.ArtifactViewerPanelComponent, typeof i3.ArtifactVersionHistoryComponent, typeof i4.ArtifactMessageCardComponent, typeof i5.JsonArtifactViewerComponent, typeof i6.CodeArtifactViewerComponent, typeof i7.MarkdownArtifactViewerComponent, typeof i8.HtmlArtifactViewerComponent, typeof i9.SvgArtifactViewerComponent, typeof i10.ComponentArtifactViewerComponent, typeof i11.DataArtifactViewerComponent, typeof i14.FileArtifactToolbarComponent, typeof i15.PdfArtifactViewerComponent, typeof i16.XlsxArtifactViewerComponent, typeof i17.DocxArtifactViewerComponent, typeof i18.ImageArtifactViewerComponent, typeof i19.VideoArtifactViewerComponent, typeof i20.AudioArtifactViewerComponent, typeof i21.ImageArtifactPreviewComponent, typeof i22.VideoArtifactPreviewComponent, typeof i23.AudioArtifactPreviewComponent]>;
60
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ArtifactsModule, [typeof i1.ArtifactTypePluginViewerComponent, typeof i2.ArtifactViewerPanelComponent, typeof i3.ArtifactVersionHistoryComponent, typeof i4.ArtifactMessageCardComponent, typeof i5.JsonArtifactViewerComponent, typeof i6.CodeArtifactViewerComponent, typeof i7.MarkdownArtifactViewerComponent, typeof i8.HtmlArtifactViewerComponent, typeof i9.SvgArtifactViewerComponent, typeof i10.ComponentArtifactViewerComponent, typeof i11.DataArtifactViewerComponent, typeof i12.MLExperimentResultsViewerComponent, typeof i13.SaveQueryPanelComponent, typeof i14.DataRequirementsViewerComponent, typeof i15.FileArtifactToolbarComponent, typeof i16.PdfArtifactViewerComponent, typeof i17.XlsxArtifactViewerComponent, typeof i18.DocxArtifactViewerComponent, typeof i19.ImageArtifactViewerComponent, typeof i20.VideoArtifactViewerComponent, typeof i21.AudioArtifactViewerComponent, typeof i22.ImageArtifactPreviewComponent, typeof i23.VideoArtifactPreviewComponent, typeof i24.AudioArtifactPreviewComponent], [typeof i25.CommonModule, typeof i26.FormsModule, typeof i27.MarkdownModule, typeof i28.CodeEditorModule, typeof i29.MJReactModule, typeof i30.MJNotificationsModule, typeof i31.QueryViewerModule, typeof i32.SharedGenericModule, typeof i33.NgTreesModule, typeof i34.BaseFormsModule, typeof i35.ComponentFeedbackPanelComponent, typeof i36.MJMediaPlayerComponent, typeof i37.AgGridModule, typeof i38.MJEmptyStateComponent, typeof i38.MJAlertComponent, typeof i38.MJButtonDirective], [typeof i1.ArtifactTypePluginViewerComponent, typeof i2.ArtifactViewerPanelComponent, typeof i3.ArtifactVersionHistoryComponent, typeof i4.ArtifactMessageCardComponent, typeof i5.JsonArtifactViewerComponent, typeof i6.CodeArtifactViewerComponent, typeof i7.MarkdownArtifactViewerComponent, typeof i8.HtmlArtifactViewerComponent, typeof i9.SvgArtifactViewerComponent, typeof i10.ComponentArtifactViewerComponent, typeof i11.DataArtifactViewerComponent, typeof i12.MLExperimentResultsViewerComponent, typeof i15.FileArtifactToolbarComponent, typeof i16.PdfArtifactViewerComponent, typeof i17.XlsxArtifactViewerComponent, typeof i18.DocxArtifactViewerComponent, typeof i19.ImageArtifactViewerComponent, typeof i20.VideoArtifactViewerComponent, typeof i21.AudioArtifactViewerComponent, typeof i22.ImageArtifactPreviewComponent, typeof i23.VideoArtifactPreviewComponent, typeof i24.AudioArtifactPreviewComponent]>;
58
61
  static ɵinj: i0.ɵɵInjectorDeclaration<ArtifactsModule>;
59
62
  }
60
63
  //# sourceMappingURL=artifacts.module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.module.d.ts","sourceRoot":"","sources":["../../src/lib/artifacts.module.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiB,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4ChF;;;;;;GAMG;AACH,qBAuFa,eAAe;IACd,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,qBAAqB;IAmClD;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,gCAAgC;yCA3CpC,eAAe;0CAAf,eAAe;0CAAf,eAAe;CA4D3B"}
1
+ {"version":3,"file":"artifacts.module.d.ts","sourceRoot":"","sources":["../../src/lib/artifacts.module.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiB,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDhF;;;;;;GAMG;AACH,qBA6Fa,eAAe;IACd,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,qBAAqB;IAoClD;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,gCAAgC;yCA5CpC,eAAe;0CAAf,eAAe;0CAAf,eAAe;CA6D3B"}
@@ -13,6 +13,9 @@ import { NgTreesModule } from '@memberjunction/ng-trees';
13
13
  // BaseFormsModule supplies `<mj-interactive-form>` for the form-aware
14
14
  // component-artifact viewer branch (componentRole === 'form').
15
15
  import { BaseFormsModule } from '@memberjunction/ng-base-forms';
16
+ // Generic media player — embedded by the audio/video artifact viewer plugins (standalone component).
17
+ import { MJMediaPlayerComponent } from '@memberjunction/ng-media-player';
18
+ import { MJEmptyStateComponent, MJAlertComponent, MJButtonDirective } from '@memberjunction/ng-ui-components';
16
19
  // Import plugin components (note: base component is abstract and NOT declared)
17
20
  import { JsonArtifactViewerComponent } from './components/plugins/json-artifact-viewer.component';
18
21
  import { CodeArtifactViewerComponent } from './components/plugins/code-artifact-viewer.component';
@@ -21,6 +24,7 @@ import { HtmlArtifactViewerComponent } from './components/plugins/html-artifact-
21
24
  import { SvgArtifactViewerComponent } from './components/plugins/svg-artifact-viewer.component';
22
25
  import { ComponentArtifactViewerComponent } from './components/plugins/component-artifact-viewer.component';
23
26
  import { DataArtifactViewerComponent } from './components/plugins/data-artifact-viewer.component';
27
+ import { MLExperimentResultsViewerComponent } from './components/plugins/ml-experiment-results-viewer.component';
24
28
  import { SaveQueryPanelComponent } from './components/plugins/save-query-dialog.component';
25
29
  import { DataRequirementsViewerComponent } from './components/plugins/data-requirements-viewer/data-requirements-viewer.component';
26
30
  import { ComponentFeedbackPanelComponent } from './components/plugins/component-feedback-panel/component-feedback-panel.component';
@@ -66,6 +70,7 @@ export class ArtifactsModule {
66
70
  SvgArtifactViewerComponent,
67
71
  ComponentArtifactViewerComponent,
68
72
  DataArtifactViewerComponent,
73
+ MLExperimentResultsViewerComponent,
69
74
  PdfArtifactViewerComponent,
70
75
  XlsxArtifactViewerComponent,
71
76
  DocxArtifactViewerComponent,
@@ -120,7 +125,10 @@ export class ArtifactsModule {
120
125
  NgTreesModule,
121
126
  BaseFormsModule,
122
127
  ComponentFeedbackPanelComponent,
123
- AgGridModule] });
128
+ MJMediaPlayerComponent,
129
+ AgGridModule,
130
+ MJEmptyStateComponent,
131
+ MJAlertComponent] });
124
132
  }
125
133
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArtifactsModule, [{
126
134
  type: NgModule,
@@ -140,6 +148,7 @@ export class ArtifactsModule {
140
148
  SvgArtifactViewerComponent,
141
149
  ComponentArtifactViewerComponent,
142
150
  DataArtifactViewerComponent,
151
+ MLExperimentResultsViewerComponent,
143
152
  SaveQueryPanelComponent,
144
153
  // Custom tab components (used by plugins via dynamic component tabs)
145
154
  DataRequirementsViewerComponent,
@@ -168,7 +177,11 @@ export class ArtifactsModule {
168
177
  NgTreesModule,
169
178
  BaseFormsModule,
170
179
  ComponentFeedbackPanelComponent,
180
+ MJMediaPlayerComponent,
171
181
  AgGridModule,
182
+ MJEmptyStateComponent,
183
+ MJAlertComponent,
184
+ MJButtonDirective,
172
185
  ],
173
186
  exports: [
174
187
  // Export artifact type plugin viewer
@@ -185,6 +198,7 @@ export class ArtifactsModule {
185
198
  SvgArtifactViewerComponent,
186
199
  ComponentArtifactViewerComponent,
187
200
  DataArtifactViewerComponent,
201
+ MLExperimentResultsViewerComponent,
188
202
  // File viewer toolbar and plugins
189
203
  FileArtifactToolbarComponent,
190
204
  PdfArtifactViewerComponent,
@@ -218,6 +232,7 @@ export class ArtifactsModule {
218
232
  SvgArtifactViewerComponent,
219
233
  ComponentArtifactViewerComponent,
220
234
  DataArtifactViewerComponent,
235
+ MLExperimentResultsViewerComponent,
221
236
  SaveQueryPanelComponent,
222
237
  // Custom tab components (used by plugins via dynamic component tabs)
223
238
  DataRequirementsViewerComponent,
@@ -243,7 +258,11 @@ export class ArtifactsModule {
243
258
  NgTreesModule,
244
259
  BaseFormsModule,
245
260
  ComponentFeedbackPanelComponent,
246
- AgGridModule], exports: [
261
+ MJMediaPlayerComponent,
262
+ AgGridModule,
263
+ MJEmptyStateComponent,
264
+ MJAlertComponent,
265
+ MJButtonDirective], exports: [
247
266
  // Export artifact type plugin viewer
248
267
  ArtifactTypePluginViewerComponent,
249
268
  // Export artifact viewer UI components
@@ -258,6 +277,7 @@ export class ArtifactsModule {
258
277
  SvgArtifactViewerComponent,
259
278
  ComponentArtifactViewerComponent,
260
279
  DataArtifactViewerComponent,
280
+ MLExperimentResultsViewerComponent,
261
281
  // File viewer toolbar and plugins
262
282
  FileArtifactToolbarComponent,
263
283
  PdfArtifactViewerComponent,
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.module.js","s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+B;QAC/B,2BAA2B;QAC3B,0BAA0B;QAC1B,gCAAgC;QAChC,2BAA2B;QAC3B,uBAAuB;QAEvB,qEAAqE;QACrE,+BAA+B;QAE/B,kCAAkC;QAClC,4BAA4B;QAC5B,0BAA0B;QAC1B,2BAA2B;QAC3B,2BAA2B;QAC3B,4BAA4B;QAC5B,4BAA4B;QAC5B,4BAA4B;QAE5B,4BAA4B;QAC5B,6BAA6B;QAC7B,6BAA6B;QAC7B,6BAA6B,aAG7B,YAAY;QACZ,WAAW;QACX,cAAc;QACd,gBAAgB;QAChB,aAAa;QACb,qBAAqB;QACrB,iBAAiB;QACjB,mBAAmB;QACnB,aAAa;QACb,eAAe;QACf,+BAA+B;QAC/B,YAAY;QAGZ,qCAAqC;QACrC,iCAAiC;QAEjC,uCAAuC;QACvC,4BAA4B;QAC5B,+BAA+B;QAC/B,4BAA4B;QAE5B,2BAA2B;QAC3B,2BAA2B;QAC3B,2BAA2B;QAC3B,+BAA+B;QAC/B,2BAA2B;QAC3B,0BAA0B;QAC1B,gCAAgC;QAChC,2BAA2B;QAE3B,kCAAkC;QAClC,4BAA4B;QAC5B,0BAA0B;QAC1B,2BAA2B;QAC3B,2BAA2B;QAC3B,4BAA4B;QAC5B,4BAA4B;QAC5B,4BAA4B;QAE5B,4BAA4B;QAC5B,6BAA6B;QAC7B,6BAA6B;QAC7B,6BAA6B","sourcesContent":["import { NgModule, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MarkdownModule } from '@memberjunction/ng-markdown';\nimport { AgGridModule } from 'ag-grid-angular';\n\n// Import MJ modules\nimport { CodeEditorModule } from '@memberjunction/ng-code-editor';\nimport { MJReactModule, AngularAdapterService } from '@memberjunction/ng-react';\nimport { MJNotificationsModule } from '@memberjunction/ng-notifications';\nimport { QueryViewerModule } from '@memberjunction/ng-query-viewer';\nimport { SharedGenericModule } from '@memberjunction/ng-shared-generic';\nimport { NgTreesModule } from '@memberjunction/ng-trees';\n// BaseFormsModule supplies `<mj-interactive-form>` for the form-aware\n// component-artifact viewer branch (componentRole === 'form').\nimport { BaseFormsModule } from '@memberjunction/ng-base-forms';\n\n// Import plugin components (note: base component is abstract and NOT declared)\nimport { JsonArtifactViewerComponent } from './components/plugins/json-artifact-viewer.component';\nimport { CodeArtifactViewerComponent } from './components/plugins/code-artifact-viewer.component';\nimport { MarkdownArtifactViewerComponent } from './components/plugins/markdown-artifact-viewer.component';\nimport { HtmlArtifactViewerComponent } from './components/plugins/html-artifact-viewer.component';\nimport { SvgArtifactViewerComponent } from './components/plugins/svg-artifact-viewer.component';\nimport { ComponentArtifactViewerComponent } from './components/plugins/component-artifact-viewer.component';\nimport { DataArtifactViewerComponent } from './components/plugins/data-artifact-viewer.component';\nimport { SaveQueryPanelComponent } from './components/plugins/save-query-dialog.component';\nimport { DataRequirementsViewerComponent } from './components/plugins/data-requirements-viewer/data-requirements-viewer.component';\nimport { ComponentFeedbackPanelComponent } from './components/plugins/component-feedback-panel/component-feedback-panel.component';\n\n// File viewer plugins\nimport { FileArtifactToolbarComponent } from './components/file-artifact-toolbar.component';\nimport { PdfArtifactViewerComponent } from './components/plugins/pdf-artifact-viewer.component';\nimport { XlsxArtifactViewerComponent } from './components/plugins/xlsx-artifact-viewer.component';\nimport { DocxArtifactViewerComponent } from './components/plugins/docx-artifact-viewer.component';\nimport { ImageArtifactViewerComponent } from './components/plugins/image-artifact-viewer.component';\nimport { VideoArtifactViewerComponent } from './components/plugins/video-artifact-viewer.component';\nimport { AudioArtifactViewerComponent } from './components/plugins/audio-artifact-viewer.component';\n\n// Inline preview components (lightweight, rendered inside conversation message cards)\nimport { ImageArtifactPreviewComponent } from './components/previews/image-artifact-preview.component';\nimport { VideoArtifactPreviewComponent } from './components/previews/video-artifact-preview.component';\nimport { AudioArtifactPreviewComponent } from './components/previews/audio-artifact-preview.component';\nimport { MJGlobal } from '@memberjunction/global';\nimport { BaseArtifactViewerPluginComponent } from './components/base-artifact-viewer.component';\nimport { IArtifactViewerPluginPreviewStatics } from './interfaces/artifact-viewer-plugin.interface';\n\n// Import artifact type plugin viewer component\nimport { ArtifactTypePluginViewerComponent } from './components/artifact-type-plugin-viewer.component';\nimport { ArtifactVersionHistoryComponent } from './components/artifact-version-history.component';\nimport { ArtifactViewerPanelComponent } from './components/artifact-viewer-panel.component';\nimport { ArtifactMessageCardComponent } from './components/artifact-message-card.component';\n\n/**\n * Module for artifact viewer plugin system.\n * Provides components for viewing different types of artifacts (JSON, Code, Markdown, HTML, SVG, Components).\n *\n * Plugins are automatically registered via @RegisterClass decorator and can be instantiated\n * using MJGlobal.Instance.ClassFactory.CreateInstance('PluginClassName').\n */\n@NgModule({\n declarations: [\n // Artifact type plugin viewer (loads appropriate plugin based on DriverClass)\n ArtifactTypePluginViewerComponent,\n\n // Artifact viewer UI components\n ArtifactViewerPanelComponent,\n ArtifactVersionHistoryComponent,\n ArtifactMessageCardComponent,\n\n // Plugin components\n JsonArtifactViewerComponent,\n CodeArtifactViewerComponent,\n MarkdownArtifactViewerComponent,\n HtmlArtifactViewerComponent,\n SvgArtifactViewerComponent,\n ComponentArtifactViewerComponent,\n DataArtifactViewerComponent,\n SaveQueryPanelComponent,\n\n // Custom tab components (used by plugins via dynamic component tabs)\n DataRequirementsViewerComponent,\n\n // File viewer toolbar and plugins\n FileArtifactToolbarComponent,\n PdfArtifactViewerComponent,\n XlsxArtifactViewerComponent,\n DocxArtifactViewerComponent,\n ImageArtifactViewerComponent,\n VideoArtifactViewerComponent,\n AudioArtifactViewerComponent,\n\n // Inline preview components\n ImageArtifactPreviewComponent,\n VideoArtifactPreviewComponent,\n AudioArtifactPreviewComponent,\n ],\n imports: [\n CommonModule,\n FormsModule,\n MarkdownModule,\n CodeEditorModule,\n MJReactModule,\n MJNotificationsModule,\n QueryViewerModule,\n SharedGenericModule,\n NgTreesModule,\n BaseFormsModule,\n ComponentFeedbackPanelComponent,\n AgGridModule,\n ],\n exports: [\n // Export artifact type plugin viewer\n ArtifactTypePluginViewerComponent,\n\n // Export artifact viewer UI components\n ArtifactViewerPanelComponent,\n ArtifactVersionHistoryComponent,\n ArtifactMessageCardComponent,\n\n // Export plugin components\n JsonArtifactViewerComponent,\n CodeArtifactViewerComponent,\n MarkdownArtifactViewerComponent,\n HtmlArtifactViewerComponent,\n SvgArtifactViewerComponent,\n ComponentArtifactViewerComponent,\n DataArtifactViewerComponent,\n\n // File viewer toolbar and plugins\n FileArtifactToolbarComponent,\n PdfArtifactViewerComponent,\n XlsxArtifactViewerComponent,\n DocxArtifactViewerComponent,\n ImageArtifactViewerComponent,\n VideoArtifactViewerComponent,\n AudioArtifactViewerComponent,\n\n // Inline preview components\n ImageArtifactPreviewComponent,\n VideoArtifactPreviewComponent,\n AudioArtifactPreviewComponent,\n ],\n providers: [\n // Plugins are registered via @RegisterClass decorator on component classes, no providers needed\n ]\n})\nexport class ArtifactsModule {\n constructor(private adapter: AngularAdapterService) {\n // Ensure plugin components are registered on module load by referencing their classes\n // The @RegisterClass decorator on each component handles the actual registration with MJGlobal\n [\n JsonArtifactViewerComponent,\n CodeArtifactViewerComponent,\n MarkdownArtifactViewerComponent,\n HtmlArtifactViewerComponent,\n SvgArtifactViewerComponent,\n ComponentArtifactViewerComponent,\n DataArtifactViewerComponent,\n PdfArtifactViewerComponent,\n XlsxArtifactViewerComponent,\n DocxArtifactViewerComponent,\n ImageArtifactViewerComponent,\n VideoArtifactViewerComponent,\n AudioArtifactViewerComponent,\n // Preview components are referenced via plugins' previewComponentType — list them here too\n // so the bundler can't tree-shake the dynamically-rendered preview classes.\n ImageArtifactPreviewComponent,\n VideoArtifactPreviewComponent,\n AudioArtifactPreviewComponent,\n ];\n\n // Registration-time guard: every registered artifact-viewer plugin must expose at least one of\n // componentType / previewComponentType. `componentType` is required by the interface (so this is\n // trivially satisfied today); the guard protects against future loosening of that invariant.\n ArtifactsModule.warnOnPluginsWithoutRenderTarget();\n\n // PERF: Eagerly start downloading React, ReactDOM, and Babel from CDN in the background.\n // By the time a user opens an interactive component artifact, the scripts will already\n // be cached. The adapter.preload() is non-blocking and deduplicates with initialize().\n this.adapter.preload();\n }\n\n /**\n * Logs a warning for any registered artifact-viewer plugin that has NO render target at all —\n * i.e. neither an implicit full viewer (the registered SubClass itself, which is the\n * `componentType`) nor an explicit `previewComponentType`. Today every registration is an\n * Angular component class, so the SubClass is always present and this never fires; the guard\n * exists to catch regressions if the render-target invariant is ever loosened.\n */\n private static warnOnPluginsWithoutRenderTarget(): void {\n const registrations = MJGlobal.Instance.ClassFactory.GetAllRegistrations(BaseArtifactViewerPluginComponent);\n for (const reg of registrations) {\n const subClass = reg.SubClass as\n | (Type<BaseArtifactViewerPluginComponent> & IArtifactViewerPluginPreviewStatics)\n | undefined;\n const hasFullViewer = !!subClass; // the registered class IS the componentType\n // Read the STATIC preview contract off the constructor — never instantiate (these are Angular\n // components with DI constructors; a bare `new` outside an injection context throws).\n const hasPreview = !!subClass?.PreviewComponentType;\n if (!hasFullViewer && !hasPreview) {\n console.warn(\n `ArtifactsModule: viewer plugin \"${reg.Key}\" has neither a componentType nor a previewComponentType — it can render nothing.`,\n );\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"artifacts.module.js","sourceRoot":"","sources":["../../src/lib/artifacts.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAQ,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAyB,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,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B,kCAAkC;QAClC,4BAA4B;QAC5B,0BAA0B;QAC1B,2BAA2B;QAC3B,2BAA2B;QAC3B,4BAA4B;QAC5B,4BAA4B;QAC5B,4BAA4B;QAE5B,4BAA4B;QAC5B,6BAA6B;QAC7B,6BAA6B;QAC7B,6BAA6B,aAG7B,YAAY;QACZ,WAAW;QACX,cAAc;QACd,gBAAgB;QAChB,aAAa;QACb,qBAAqB;QACrB,iBAAiB;QACjB,mBAAmB;QACnB,aAAa;QACb,eAAe;QACf,+BAA+B;QAC/B,sBAAsB;QACtB,YAAY;QACZ,qBAAqB;QACrB,gBAAgB;QAChB,iBAAiB;QAGjB,qCAAqC;QACrC,iCAAiC;QAEjC,uCAAuC;QACvC,4BAA4B;QAC5B,+BAA+B;QAC/B,4BAA4B;QAE5B,2BAA2B;QAC3B,2BAA2B;QAC3B,2BAA2B;QAC3B,+BAA+B;QAC/B,2BAA2B;QAC3B,0BAA0B;QAC1B,gCAAgC;QAChC,2BAA2B;QAC3B,kCAAkC;QAElC,kCAAkC;QAClC,4BAA4B;QAC5B,0BAA0B;QAC1B,2BAA2B;QAC3B,2BAA2B;QAC3B,4BAA4B;QAC5B,4BAA4B;QAC5B,4BAA4B;QAE5B,4BAA4B;QAC5B,6BAA6B;QAC7B,6BAA6B;QAC7B,6BAA6B","sourcesContent":["import { NgModule, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MarkdownModule } from '@memberjunction/ng-markdown';\nimport { AgGridModule } from 'ag-grid-angular';\n\n// Import MJ modules\nimport { CodeEditorModule } from '@memberjunction/ng-code-editor';\nimport { MJReactModule, AngularAdapterService } from '@memberjunction/ng-react';\nimport { MJNotificationsModule } from '@memberjunction/ng-notifications';\nimport { QueryViewerModule } from '@memberjunction/ng-query-viewer';\nimport { SharedGenericModule } from '@memberjunction/ng-shared-generic';\nimport { NgTreesModule } from '@memberjunction/ng-trees';\n// BaseFormsModule supplies `<mj-interactive-form>` for the form-aware\n// component-artifact viewer branch (componentRole === 'form').\nimport { BaseFormsModule } from '@memberjunction/ng-base-forms';\n// Generic media player — embedded by the audio/video artifact viewer plugins (standalone component).\nimport { MJMediaPlayerComponent } from '@memberjunction/ng-media-player';\nimport { MJEmptyStateComponent, MJAlertComponent, MJButtonDirective } from '@memberjunction/ng-ui-components';\n\n// Import plugin components (note: base component is abstract and NOT declared)\nimport { JsonArtifactViewerComponent } from './components/plugins/json-artifact-viewer.component';\nimport { CodeArtifactViewerComponent } from './components/plugins/code-artifact-viewer.component';\nimport { MarkdownArtifactViewerComponent } from './components/plugins/markdown-artifact-viewer.component';\nimport { HtmlArtifactViewerComponent } from './components/plugins/html-artifact-viewer.component';\nimport { SvgArtifactViewerComponent } from './components/plugins/svg-artifact-viewer.component';\nimport { ComponentArtifactViewerComponent } from './components/plugins/component-artifact-viewer.component';\nimport { DataArtifactViewerComponent } from './components/plugins/data-artifact-viewer.component';\nimport { MLExperimentResultsViewerComponent } from './components/plugins/ml-experiment-results-viewer.component';\nimport { SaveQueryPanelComponent } from './components/plugins/save-query-dialog.component';\nimport { DataRequirementsViewerComponent } from './components/plugins/data-requirements-viewer/data-requirements-viewer.component';\nimport { ComponentFeedbackPanelComponent } from './components/plugins/component-feedback-panel/component-feedback-panel.component';\n\n// File viewer plugins\nimport { FileArtifactToolbarComponent } from './components/file-artifact-toolbar.component';\nimport { PdfArtifactViewerComponent } from './components/plugins/pdf-artifact-viewer.component';\nimport { XlsxArtifactViewerComponent } from './components/plugins/xlsx-artifact-viewer.component';\nimport { DocxArtifactViewerComponent } from './components/plugins/docx-artifact-viewer.component';\nimport { ImageArtifactViewerComponent } from './components/plugins/image-artifact-viewer.component';\nimport { VideoArtifactViewerComponent } from './components/plugins/video-artifact-viewer.component';\nimport { AudioArtifactViewerComponent } from './components/plugins/audio-artifact-viewer.component';\n\n// Inline preview components (lightweight, rendered inside conversation message cards)\nimport { ImageArtifactPreviewComponent } from './components/previews/image-artifact-preview.component';\nimport { VideoArtifactPreviewComponent } from './components/previews/video-artifact-preview.component';\nimport { AudioArtifactPreviewComponent } from './components/previews/audio-artifact-preview.component';\nimport { MJGlobal } from '@memberjunction/global';\nimport { BaseArtifactViewerPluginComponent } from './components/base-artifact-viewer.component';\nimport { IArtifactViewerPluginPreviewStatics } from './interfaces/artifact-viewer-plugin.interface';\n\n// Import artifact type plugin viewer component\nimport { ArtifactTypePluginViewerComponent } from './components/artifact-type-plugin-viewer.component';\nimport { ArtifactVersionHistoryComponent } from './components/artifact-version-history.component';\nimport { ArtifactViewerPanelComponent } from './components/artifact-viewer-panel.component';\nimport { ArtifactMessageCardComponent } from './components/artifact-message-card.component';\n\n/**\n * Module for artifact viewer plugin system.\n * Provides components for viewing different types of artifacts (JSON, Code, Markdown, HTML, SVG, Components).\n *\n * Plugins are automatically registered via @RegisterClass decorator and can be instantiated\n * using MJGlobal.Instance.ClassFactory.CreateInstance('PluginClassName').\n */\n@NgModule({\n declarations: [\n // Artifact type plugin viewer (loads appropriate plugin based on DriverClass)\n ArtifactTypePluginViewerComponent,\n\n // Artifact viewer UI components\n ArtifactViewerPanelComponent,\n ArtifactVersionHistoryComponent,\n ArtifactMessageCardComponent,\n\n // Plugin components\n JsonArtifactViewerComponent,\n CodeArtifactViewerComponent,\n MarkdownArtifactViewerComponent,\n HtmlArtifactViewerComponent,\n SvgArtifactViewerComponent,\n ComponentArtifactViewerComponent,\n DataArtifactViewerComponent,\n MLExperimentResultsViewerComponent,\n SaveQueryPanelComponent,\n\n // Custom tab components (used by plugins via dynamic component tabs)\n DataRequirementsViewerComponent,\n\n // File viewer toolbar and plugins\n FileArtifactToolbarComponent,\n PdfArtifactViewerComponent,\n XlsxArtifactViewerComponent,\n DocxArtifactViewerComponent,\n ImageArtifactViewerComponent,\n VideoArtifactViewerComponent,\n AudioArtifactViewerComponent,\n\n // Inline preview components\n ImageArtifactPreviewComponent,\n VideoArtifactPreviewComponent,\n AudioArtifactPreviewComponent,\n ],\n imports: [\n CommonModule,\n FormsModule,\n MarkdownModule,\n CodeEditorModule,\n MJReactModule,\n MJNotificationsModule,\n QueryViewerModule,\n SharedGenericModule,\n NgTreesModule,\n BaseFormsModule,\n ComponentFeedbackPanelComponent,\n MJMediaPlayerComponent,\n AgGridModule,\n MJEmptyStateComponent,\n MJAlertComponent,\n MJButtonDirective,\n ],\n exports: [\n // Export artifact type plugin viewer\n ArtifactTypePluginViewerComponent,\n\n // Export artifact viewer UI components\n ArtifactViewerPanelComponent,\n ArtifactVersionHistoryComponent,\n ArtifactMessageCardComponent,\n\n // Export plugin components\n JsonArtifactViewerComponent,\n CodeArtifactViewerComponent,\n MarkdownArtifactViewerComponent,\n HtmlArtifactViewerComponent,\n SvgArtifactViewerComponent,\n ComponentArtifactViewerComponent,\n DataArtifactViewerComponent,\n MLExperimentResultsViewerComponent,\n\n // File viewer toolbar and plugins\n FileArtifactToolbarComponent,\n PdfArtifactViewerComponent,\n XlsxArtifactViewerComponent,\n DocxArtifactViewerComponent,\n ImageArtifactViewerComponent,\n VideoArtifactViewerComponent,\n AudioArtifactViewerComponent,\n\n // Inline preview components\n ImageArtifactPreviewComponent,\n VideoArtifactPreviewComponent,\n AudioArtifactPreviewComponent,\n ],\n providers: [\n // Plugins are registered via @RegisterClass decorator on component classes, no providers needed\n ]\n})\nexport class ArtifactsModule {\n constructor(private adapter: AngularAdapterService) {\n // Ensure plugin components are registered on module load by referencing their classes\n // The @RegisterClass decorator on each component handles the actual registration with MJGlobal\n [\n JsonArtifactViewerComponent,\n CodeArtifactViewerComponent,\n MarkdownArtifactViewerComponent,\n HtmlArtifactViewerComponent,\n SvgArtifactViewerComponent,\n ComponentArtifactViewerComponent,\n DataArtifactViewerComponent,\n MLExperimentResultsViewerComponent,\n PdfArtifactViewerComponent,\n XlsxArtifactViewerComponent,\n DocxArtifactViewerComponent,\n ImageArtifactViewerComponent,\n VideoArtifactViewerComponent,\n AudioArtifactViewerComponent,\n // Preview components are referenced via plugins' previewComponentType — list them here too\n // so the bundler can't tree-shake the dynamically-rendered preview classes.\n ImageArtifactPreviewComponent,\n VideoArtifactPreviewComponent,\n AudioArtifactPreviewComponent,\n ];\n\n // Registration-time guard: every registered artifact-viewer plugin must expose at least one of\n // componentType / previewComponentType. `componentType` is required by the interface (so this is\n // trivially satisfied today); the guard protects against future loosening of that invariant.\n ArtifactsModule.warnOnPluginsWithoutRenderTarget();\n\n // PERF: Eagerly start downloading React, ReactDOM, and Babel from CDN in the background.\n // By the time a user opens an interactive component artifact, the scripts will already\n // be cached. The adapter.preload() is non-blocking and deduplicates with initialize().\n this.adapter.preload();\n }\n\n /**\n * Logs a warning for any registered artifact-viewer plugin that has NO render target at all —\n * i.e. neither an implicit full viewer (the registered SubClass itself, which is the\n * `componentType`) nor an explicit `previewComponentType`. Today every registration is an\n * Angular component class, so the SubClass is always present and this never fires; the guard\n * exists to catch regressions if the render-target invariant is ever loosened.\n */\n private static warnOnPluginsWithoutRenderTarget(): void {\n const registrations = MJGlobal.Instance.ClassFactory.GetAllRegistrations(BaseArtifactViewerPluginComponent);\n for (const reg of registrations) {\n const subClass = reg.SubClass as\n | (Type<BaseArtifactViewerPluginComponent> & IArtifactViewerPluginPreviewStatics)\n | undefined;\n const hasFullViewer = !!subClass; // the registered class IS the componentType\n // Read the STATIC preview contract off the constructor — never instantiate (these are Angular\n // components with DI constructors; a bare `new` outside an injection context throws).\n const hasPreview = !!subClass?.PreviewComponentType;\n if (!hasFullViewer && !hasPreview) {\n console.warn(\n `ArtifactsModule: viewer plugin \"${reg.Key}\" has neither a componentType nor a previewComponentType — it can render nothing.`,\n );\n }\n }\n }\n}\n"]}
@@ -4,6 +4,7 @@ import { MJArtifactEntity, MJArtifactVersionEntity } from '@memberjunction/core-
4
4
  import { UserInfo } from '@memberjunction/core';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class ArtifactVersionHistoryComponent extends BaseAngularComponent implements OnInit {
7
+ private confirmService;
7
8
  artifact: MJArtifactEntity;
8
9
  currentUser: UserInfo;
9
10
  closed: EventEmitter<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"artifact-version-history.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/artifact-version-history.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAC;;AAEzD,qBA2Ga,+BAAgC,SAAQ,oBAAqB,YAAW,MAAM;IAChF,QAAQ,EAAG,gBAAgB,CAAC;IAC5B,WAAW,EAAG,QAAQ,CAAC;IAEtB,MAAM,qBAA4B;IAClC,eAAe,uBAA8B;IAC7C,eAAe,uBAA8B;IAEhD,QAAQ,EAAE,uBAAuB,EAAE,CAAM;IACzC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtC,QAAQ,EAAE,OAAO,CAAS;IAC1B,qBAAqB,EAAE,MAAM,CAAM;IACnC,sBAAsB,EAAE,MAAM,CAAM;IAE3C,QAAQ;YAIM,YAAY;IAkB1B,eAAe,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI;IAKjD,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAajE,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBvE,iBAAiB,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI;IAgBzD,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM;IAQ9C,cAAc,IAAI,MAAM;IAYxB,OAAO,IAAI,IAAI;yCA/GJ,+BAA+B;2CAA/B,+BAA+B;CAkH3C"}
1
+ {"version":3,"file":"artifact-version-history.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/artifact-version-history.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,MAAM,EAAU,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAC;;AAEzD,qBAuGa,+BAAgC,SAAQ,oBAAqB,YAAW,MAAM;IACzF,OAAO,CAAC,cAAc,CAA4B;IAEzC,QAAQ,EAAG,gBAAgB,CAAC;IAC5B,WAAW,EAAG,QAAQ,CAAC;IAEtB,MAAM,qBAA4B;IAClC,eAAe,uBAA8B;IAC7C,eAAe,uBAA8B;IAEhD,QAAQ,EAAE,uBAAuB,EAAE,CAAM;IACzC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtC,QAAQ,EAAE,OAAO,CAAS;IAC1B,qBAAqB,EAAE,MAAM,CAAM;IACnC,sBAAsB,EAAE,MAAM,CAAM;IAE3C,QAAQ;YAIM,YAAY;IAkB1B,eAAe,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI;IAKjD,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAajE,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBvE,iBAAiB,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI;IAgBzD,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM;IAQ9C,cAAc,IAAI,MAAM;IAYxB,OAAO,IAAI,IAAI;yCAjHJ,+BAA+B;2CAA/B,+BAA+B;CAoH3C"}
@@ -1,48 +1,46 @@
1
- import { Component, Input, Output, EventEmitter } from '@angular/core';
1
+ import { Component, Input, Output, EventEmitter, inject } from '@angular/core';
2
2
  import { BaseAngularComponent } from '@memberjunction/ng-base-types';
3
+ import { MJConfirmService } from '@memberjunction/ng-ui-components';
3
4
  import { RunView } from '@memberjunction/core';
4
5
  import * as i0 from "@angular/core";
5
- import * as i1 from "@angular/common";
6
+ import * as i1 from "@memberjunction/ng-ui-components";
7
+ import * as i2 from "@angular/common";
6
8
  function ArtifactVersionHistoryComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
7
- i0.ɵɵelementStart(0, "div", 5);
8
- i0.ɵɵelement(1, "i", 8);
9
- i0.ɵɵelementStart(2, "p");
10
- i0.ɵɵtext(3, "No version history available");
11
- i0.ɵɵelementEnd()();
9
+ i0.ɵɵelement(0, "mj-empty-state", 5);
12
10
  } }
13
11
  function ArtifactVersionHistoryComponent_For_9_Conditional_11_Template(rf, ctx) { if (rf & 1) {
14
12
  const _r4 = i0.ɵɵgetCurrentView();
15
- i0.ɵɵelementStart(0, "div", 16)(1, "button", 17);
13
+ i0.ɵɵelementStart(0, "div", 15)(1, "button", 16);
16
14
  i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_For_9_Conditional_11_Template_button_click_1_listener($event) { i0.ɵɵrestoreView(_r4); const version_r2 = i0.ɵɵnextContext().$implicit; const ctx_r2 = i0.ɵɵnextContext(); ctx_r2.onRestoreVersion(version_r2); return i0.ɵɵresetView($event.stopPropagation()); });
17
- i0.ɵɵelement(2, "i", 18);
15
+ i0.ɵɵelement(2, "i", 17);
18
16
  i0.ɵɵtext(3, " Restore ");
19
17
  i0.ɵɵelementEnd();
20
- i0.ɵɵelementStart(4, "button", 17);
18
+ i0.ɵɵelementStart(4, "button", 16);
21
19
  i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_For_9_Conditional_11_Template_button_click_4_listener($event) { i0.ɵɵrestoreView(_r4); const version_r2 = i0.ɵɵnextContext().$implicit; const ctx_r2 = i0.ɵɵnextContext(); ctx_r2.onCompareVersion(version_r2); return i0.ɵɵresetView($event.stopPropagation()); });
22
- i0.ɵɵelement(5, "i", 19);
20
+ i0.ɵɵelement(5, "i", 18);
23
21
  i0.ɵɵtext(6, " Compare ");
24
22
  i0.ɵɵelementEnd();
25
- i0.ɵɵelementStart(7, "button", 17);
23
+ i0.ɵɵelementStart(7, "button", 16);
26
24
  i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_For_9_Conditional_11_Template_button_click_7_listener($event) { i0.ɵɵrestoreView(_r4); const version_r2 = i0.ɵɵnextContext().$implicit; const ctx_r2 = i0.ɵɵnextContext(); ctx_r2.onDownloadVersion(version_r2); return i0.ɵɵresetView($event.stopPropagation()); });
27
- i0.ɵɵelement(8, "i", 20);
25
+ i0.ɵɵelement(8, "i", 19);
28
26
  i0.ɵɵtext(9, " Download ");
29
27
  i0.ɵɵelementEnd()();
30
28
  } }
31
29
  function ArtifactVersionHistoryComponent_For_9_Template(rf, ctx) { if (rf & 1) {
32
30
  const _r1 = i0.ɵɵgetCurrentView();
33
- i0.ɵɵelementStart(0, "div", 9);
31
+ i0.ɵɵelementStart(0, "div", 8);
34
32
  i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_For_9_Template_div_click_0_listener() { const version_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onSelectVersion(version_r2)); });
35
- i0.ɵɵelementStart(1, "div", 10)(2, "div", 11)(3, "span", 12);
33
+ i0.ɵɵelementStart(1, "div", 9)(2, "div", 10)(3, "span", 11);
36
34
  i0.ɵɵtext(4);
37
35
  i0.ɵɵelementEnd();
38
- i0.ɵɵelementStart(5, "span", 13);
36
+ i0.ɵɵelementStart(5, "span", 12);
39
37
  i0.ɵɵtext(6);
40
38
  i0.ɵɵpipe(7, "date");
41
39
  i0.ɵɵelementEnd()();
42
- i0.ɵɵelementStart(8, "div", 14)(9, "span", 15);
40
+ i0.ɵɵelementStart(8, "div", 13)(9, "span", 14);
43
41
  i0.ɵɵtext(10);
44
42
  i0.ɵɵelementEnd()()();
45
- i0.ɵɵconditionalCreate(11, ArtifactVersionHistoryComponent_For_9_Conditional_11_Template, 10, 0, "div", 16);
43
+ i0.ɵɵconditionalCreate(11, ArtifactVersionHistoryComponent_For_9_Conditional_11_Template, 10, 0, "div", 15);
46
44
  i0.ɵɵelementEnd();
47
45
  } if (rf & 2) {
48
46
  const version_r2 = ctx.$implicit;
@@ -59,14 +57,14 @@ function ArtifactVersionHistoryComponent_For_9_Template(rf, ctx) { if (rf & 1) {
59
57
  } }
60
58
  function ArtifactVersionHistoryComponent_Conditional_10_Template(rf, ctx) { if (rf & 1) {
61
59
  const _r5 = i0.ɵɵgetCurrentView();
62
- i0.ɵɵelementStart(0, "div", 7)(1, "div", 21)(2, "h4");
60
+ i0.ɵɵelementStart(0, "div", 7)(1, "div", 20)(2, "h4");
63
61
  i0.ɵɵtext(3);
64
62
  i0.ɵɵelementEnd();
65
- i0.ɵɵelementStart(4, "button", 22);
63
+ i0.ɵɵelementStart(4, "button", 21);
66
64
  i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_Conditional_10_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r5); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.showDiff = false); });
67
65
  i0.ɵɵelement(5, "i", 3);
68
66
  i0.ɵɵelementEnd()();
69
- i0.ɵɵelementStart(6, "div", 23)(7, "pre");
67
+ i0.ɵɵelementStart(6, "div", 22)(7, "pre");
70
68
  i0.ɵɵtext(8);
71
69
  i0.ɵɵelementEnd()()();
72
70
  } if (rf & 2) {
@@ -77,6 +75,7 @@ function ArtifactVersionHistoryComponent_Conditional_10_Template(rf, ctx) { if (
77
75
  i0.ɵɵtextInterpolate(ctx_r2.getDiffSummary());
78
76
  } }
79
77
  export class ArtifactVersionHistoryComponent extends BaseAngularComponent {
78
+ confirmService = inject(MJConfirmService);
80
79
  artifact;
81
80
  currentUser;
82
81
  closed = new EventEmitter();
@@ -112,7 +111,7 @@ export class ArtifactVersionHistoryComponent extends BaseAngularComponent {
112
111
  this.versionSelected.emit(version.VersionNumber);
113
112
  }
114
113
  async onRestoreVersion(version) {
115
- if (!confirm(`Restore to version ${version.VersionNumber}? This will create a new version.`))
114
+ if (!(await this.confirmService.Confirm({ title: 'Restore version', message: `Restore to version ${version.VersionNumber}?`, detail: 'This will create a new version.' })))
116
115
  return;
117
116
  try {
118
117
  // Restoring creates a new version with the old content
@@ -182,7 +181,7 @@ export class ArtifactVersionHistoryComponent extends BaseAngularComponent {
182
181
  this.closed.emit();
183
182
  }
184
183
  static ɵfac = /*@__PURE__*/ (() => { let ɵArtifactVersionHistoryComponent_BaseFactory; return function ArtifactVersionHistoryComponent_Factory(__ngFactoryType__) { return (ɵArtifactVersionHistoryComponent_BaseFactory || (ɵArtifactVersionHistoryComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ArtifactVersionHistoryComponent)))(__ngFactoryType__ || ArtifactVersionHistoryComponent); }; })();
185
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArtifactVersionHistoryComponent, selectors: [["mj-artifact-version-history"]], inputs: { artifact: "artifact", currentUser: "currentUser" }, outputs: { closed: "closed", versionRestored: "versionRestored", versionSelected: "versionSelected" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 2, consts: [[1, "version-history"], [1, "history-header"], ["title", "Close", 1, "btn-close", 3, "click"], [1, "fas", "fa-times"], [1, "version-list"], [1, "empty-state"], [1, "version-item", 3, "selected"], [1, "diff-panel"], [1, "fas", "fa-history"], [1, "version-item", 3, "click"], [1, "version-header"], [1, "version-info"], [1, "version-number"], [1, "version-date"], [1, "version-meta"], [1, "version-size"], [1, "version-actions"], [1, "btn-action", 3, "click"], [1, "fas", "fa-undo"], [1, "fas", "fa-code-compare"], [1, "fas", "fa-download"], [1, "diff-header"], [1, "btn-close-diff", 3, "click"], [1, "diff-content"]], template: function ArtifactVersionHistoryComponent_Template(rf, ctx) { if (rf & 1) {
184
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArtifactVersionHistoryComponent, selectors: [["mj-artifact-version-history"]], inputs: { artifact: "artifact", currentUser: "currentUser" }, outputs: { closed: "closed", versionRestored: "versionRestored", versionSelected: "versionSelected" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 2, consts: [[1, "version-history"], [1, "history-header"], ["title", "Close", 1, "btn-close", 3, "click"], [1, "fas", "fa-times"], [1, "version-list"], ["Icon", "fa-solid fa-clock-rotate-left", "Title", "No version history available", "Size", "compact"], [1, "version-item", 3, "selected"], [1, "diff-panel"], [1, "version-item", 3, "click"], [1, "version-header"], [1, "version-info"], [1, "version-number"], [1, "version-date"], [1, "version-meta"], [1, "version-size"], [1, "version-actions"], [1, "btn-action", 3, "click"], [1, "fas", "fa-undo"], [1, "fas", "fa-code-compare"], [1, "fas", "fa-download"], [1, "diff-header"], [1, "btn-close-diff", 3, "click"], [1, "diff-content"]], template: function ArtifactVersionHistoryComponent_Template(rf, ctx) { if (rf & 1) {
186
185
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h3");
187
186
  i0.ɵɵtext(3, "Version History");
188
187
  i0.ɵɵelementEnd();
@@ -191,7 +190,7 @@ export class ArtifactVersionHistoryComponent extends BaseAngularComponent {
191
190
  i0.ɵɵelement(5, "i", 3);
192
191
  i0.ɵɵelementEnd()();
193
192
  i0.ɵɵelementStart(6, "div", 4);
194
- i0.ɵɵconditionalCreate(7, ArtifactVersionHistoryComponent_Conditional_7_Template, 4, 0, "div", 5);
193
+ i0.ɵɵconditionalCreate(7, ArtifactVersionHistoryComponent_Conditional_7_Template, 1, 0, "mj-empty-state", 5);
195
194
  i0.ɵɵrepeaterCreate(8, ArtifactVersionHistoryComponent_For_9_Template, 12, 9, "div", 6, i0.ɵɵrepeaterTrackByIdentity);
196
195
  i0.ɵɵelementEnd();
197
196
  i0.ɵɵconditionalCreate(10, ArtifactVersionHistoryComponent_Conditional_10_Template, 9, 3, "div", 7);
@@ -203,7 +202,7 @@ export class ArtifactVersionHistoryComponent extends BaseAngularComponent {
203
202
  i0.ɵɵrepeater(ctx.versions);
204
203
  i0.ɵɵadvance(2);
205
204
  i0.ɵɵconditional(ctx.showDiff && ctx.currentVersionContent && ctx.previousVersionContent && ctx.selectedVersion ? 10 : -1);
206
- } }, dependencies: [i1.DatePipe], styles: [".version-history[_ngcontent-%COMP%] { display: flex; flex-direction: column; height: 100%; background: white; }\n .history-header[_ngcontent-%COMP%] { padding: 16px; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .history-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] { margin: 0; font-size: 16px; }\n .btn-close[_ngcontent-%COMP%] { padding: 6px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close[_ngcontent-%COMP%]:hover { background: rgba(0,0,0,0.1); }\n\n .version-list[_ngcontent-%COMP%] { flex: 1; overflow-y: auto; }\n .version-item[_ngcontent-%COMP%] { padding: 16px; border-bottom: 1px solid #E8E8E8; cursor: pointer; transition: background 150ms ease; }\n .version-item[_ngcontent-%COMP%]:hover { background: #F9F9F9; }\n .version-item.selected[_ngcontent-%COMP%] { background: #E3F2FD; border-left: 3px solid #1976D2; }\n\n .version-header[_ngcontent-%COMP%] { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }\n .version-info[_ngcontent-%COMP%] { display: flex; flex-direction: column; gap: 4px; }\n .version-number[_ngcontent-%COMP%] { font-size: 14px; font-weight: 600; }\n .version-date[_ngcontent-%COMP%] { font-size: 12px; color: #666; }\n .version-meta[_ngcontent-%COMP%] { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: #666; }\n .version-author[_ngcontent-%COMP%] { display: flex; align-items: center; gap: 4px; }\n .version-size[_ngcontent-%COMP%] { color: #999; }\n\n .version-notes[_ngcontent-%COMP%] { font-size: 13px; color: #333; margin-bottom: 8px; }\n\n .version-actions[_ngcontent-%COMP%] { display: flex; gap: 8px; margin-top: 12px; }\n .btn-action[_ngcontent-%COMP%] { padding: 6px 12px; background: #0076B6; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 6px; }\n .btn-action[_ngcontent-%COMP%]:hover { background: #005A8C; }\n\n .empty-state[_ngcontent-%COMP%] { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; color: #999; }\n .empty-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] { font-size: 48px; margin-bottom: 16px; }\n .empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%] { margin: 0; font-size: 14px; }\n\n .diff-panel[_ngcontent-%COMP%] { border-top: 2px solid #D9D9D9; max-height: 50%; overflow: hidden; display: flex; flex-direction: column; }\n .diff-header[_ngcontent-%COMP%] { padding: 12px 16px; background: #F8F8F8; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .diff-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%] { margin: 0; font-size: 13px; font-weight: 600; }\n .btn-close-diff[_ngcontent-%COMP%] { padding: 4px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close-diff[_ngcontent-%COMP%]:hover { background: rgba(0,0,0,0.1); }\n .diff-content[_ngcontent-%COMP%] { flex: 1; overflow-y: auto; padding: 16px; }\n .diff-content[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] { margin: 0; font-family: 'Courier New', monospace; font-size: 12px; white-space: pre-wrap; }"] });
205
+ } }, dependencies: [i1.MJEmptyStateComponent, i2.DatePipe], styles: [".version-history[_ngcontent-%COMP%] { display: flex; flex-direction: column; height: 100%; background: white; }\n .history-header[_ngcontent-%COMP%] { padding: 16px; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .history-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] { margin: 0; font-size: 16px; }\n .btn-close[_ngcontent-%COMP%] { padding: 6px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close[_ngcontent-%COMP%]:hover { background: rgba(0,0,0,0.1); }\n\n .version-list[_ngcontent-%COMP%] { flex: 1; overflow-y: auto; }\n .version-item[_ngcontent-%COMP%] { padding: 16px; border-bottom: 1px solid #E8E8E8; cursor: pointer; transition: background 150ms ease; }\n .version-item[_ngcontent-%COMP%]:hover { background: #F9F9F9; }\n .version-item.selected[_ngcontent-%COMP%] { background: #E3F2FD; border-left: 3px solid #1976D2; }\n\n .version-header[_ngcontent-%COMP%] { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }\n .version-info[_ngcontent-%COMP%] { display: flex; flex-direction: column; gap: 4px; }\n .version-number[_ngcontent-%COMP%] { font-size: 14px; font-weight: 600; }\n .version-date[_ngcontent-%COMP%] { font-size: 12px; color: #666; }\n .version-meta[_ngcontent-%COMP%] { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: #666; }\n .version-author[_ngcontent-%COMP%] { display: flex; align-items: center; gap: 4px; }\n .version-size[_ngcontent-%COMP%] { color: #999; }\n\n .version-notes[_ngcontent-%COMP%] { font-size: 13px; color: #333; margin-bottom: 8px; }\n\n .version-actions[_ngcontent-%COMP%] { display: flex; gap: 8px; margin-top: 12px; }\n .btn-action[_ngcontent-%COMP%] { padding: 6px 12px; background: #0076B6; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 6px; }\n .btn-action[_ngcontent-%COMP%]:hover { background: #005A8C; }\n\n .diff-panel[_ngcontent-%COMP%] { border-top: 2px solid #D9D9D9; max-height: 50%; overflow: hidden; display: flex; flex-direction: column; }\n .diff-header[_ngcontent-%COMP%] { padding: 12px 16px; background: #F8F8F8; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .diff-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%] { margin: 0; font-size: 13px; font-weight: 600; }\n .btn-close-diff[_ngcontent-%COMP%] { padding: 4px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close-diff[_ngcontent-%COMP%]:hover { background: rgba(0,0,0,0.1); }\n .diff-content[_ngcontent-%COMP%] { flex: 1; overflow-y: auto; padding: 16px; }\n .diff-content[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] { margin: 0; font-family: 'Courier New', monospace; font-size: 12px; white-space: pre-wrap; }"] });
207
206
  }
208
207
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArtifactVersionHistoryComponent, [{
209
208
  type: Component,
@@ -218,10 +217,10 @@ export class ArtifactVersionHistoryComponent extends BaseAngularComponent {
218
217
 
219
218
  <div class="version-list">
220
219
  @if (versions.length === 0) {
221
- <div class="empty-state">
222
- <i class="fas fa-history"></i>
223
- <p>No version history available</p>
224
- </div>
220
+ <mj-empty-state
221
+ Icon="fa-solid fa-clock-rotate-left"
222
+ Title="No version history available"
223
+ Size="compact" />
225
224
  }
226
225
 
227
226
  @for (version of versions; track version) {
@@ -271,7 +270,7 @@ export class ArtifactVersionHistoryComponent extends BaseAngularComponent {
271
270
  </div>
272
271
  }
273
272
  </div>
274
- `, styles: ["\n .version-history { display: flex; flex-direction: column; height: 100%; background: white; }\n .history-header { padding: 16px; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .history-header h3 { margin: 0; font-size: 16px; }\n .btn-close { padding: 6px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close:hover { background: rgba(0,0,0,0.1); }\n\n .version-list { flex: 1; overflow-y: auto; }\n .version-item { padding: 16px; border-bottom: 1px solid #E8E8E8; cursor: pointer; transition: background 150ms ease; }\n .version-item:hover { background: #F9F9F9; }\n .version-item.selected { background: #E3F2FD; border-left: 3px solid #1976D2; }\n\n .version-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }\n .version-info { display: flex; flex-direction: column; gap: 4px; }\n .version-number { font-size: 14px; font-weight: 600; }\n .version-date { font-size: 12px; color: #666; }\n .version-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: #666; }\n .version-author { display: flex; align-items: center; gap: 4px; }\n .version-size { color: #999; }\n\n .version-notes { font-size: 13px; color: #333; margin-bottom: 8px; }\n\n .version-actions { display: flex; gap: 8px; margin-top: 12px; }\n .btn-action { padding: 6px 12px; background: #0076B6; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 6px; }\n .btn-action:hover { background: #005A8C; }\n\n .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; color: #999; }\n .empty-state i { font-size: 48px; margin-bottom: 16px; }\n .empty-state p { margin: 0; font-size: 14px; }\n\n .diff-panel { border-top: 2px solid #D9D9D9; max-height: 50%; overflow: hidden; display: flex; flex-direction: column; }\n .diff-header { padding: 12px 16px; background: #F8F8F8; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .diff-header h4 { margin: 0; font-size: 13px; font-weight: 600; }\n .btn-close-diff { padding: 4px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close-diff:hover { background: rgba(0,0,0,0.1); }\n .diff-content { flex: 1; overflow-y: auto; padding: 16px; }\n .diff-content pre { margin: 0; font-family: 'Courier New', monospace; font-size: 12px; white-space: pre-wrap; }\n "] }]
273
+ `, styles: ["\n .version-history { display: flex; flex-direction: column; height: 100%; background: white; }\n .history-header { padding: 16px; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .history-header h3 { margin: 0; font-size: 16px; }\n .btn-close { padding: 6px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close:hover { background: rgba(0,0,0,0.1); }\n\n .version-list { flex: 1; overflow-y: auto; }\n .version-item { padding: 16px; border-bottom: 1px solid #E8E8E8; cursor: pointer; transition: background 150ms ease; }\n .version-item:hover { background: #F9F9F9; }\n .version-item.selected { background: #E3F2FD; border-left: 3px solid #1976D2; }\n\n .version-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }\n .version-info { display: flex; flex-direction: column; gap: 4px; }\n .version-number { font-size: 14px; font-weight: 600; }\n .version-date { font-size: 12px; color: #666; }\n .version-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: #666; }\n .version-author { display: flex; align-items: center; gap: 4px; }\n .version-size { color: #999; }\n\n .version-notes { font-size: 13px; color: #333; margin-bottom: 8px; }\n\n .version-actions { display: flex; gap: 8px; margin-top: 12px; }\n .btn-action { padding: 6px 12px; background: #0076B6; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 6px; }\n .btn-action:hover { background: #005A8C; }\n\n .diff-panel { border-top: 2px solid #D9D9D9; max-height: 50%; overflow: hidden; display: flex; flex-direction: column; }\n .diff-header { padding: 12px 16px; background: #F8F8F8; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .diff-header h4 { margin: 0; font-size: 13px; font-weight: 600; }\n .btn-close-diff { padding: 4px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close-diff:hover { background: rgba(0,0,0,0.1); }\n .diff-content { flex: 1; overflow-y: auto; padding: 16px; }\n .diff-content pre { margin: 0; font-family: 'Courier New', monospace; font-size: 12px; white-space: pre-wrap; }\n "] }]
275
274
  }], null, { artifact: [{
276
275
  type: Input
277
276
  }], currentUser: [{
@@ -283,5 +282,5 @@ export class ArtifactVersionHistoryComponent extends BaseAngularComponent {
283
282
  }], versionSelected: [{
284
283
  type: Output
285
284
  }] }); })();
286
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactVersionHistoryComponent, { className: "ArtifactVersionHistoryComponent", filePath: "src/lib/components/artifact-version-history.component.ts", lineNumber: 113 }); })();
285
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactVersionHistoryComponent, { className: "ArtifactVersionHistoryComponent", filePath: "src/lib/components/artifact-version-history.component.ts", lineNumber: 110 }); })();
287
286
  //# sourceMappingURL=artifact-version-history.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"artifact-version-history.component.js","sourceRoot":"","sources":["../../../src/lib/components/artifact-version-history.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAY,OAAO,EAAE,MAAM,sBAAsB,CAAC;;;;IAgB/C,8BAAyB;IACvB,uBAA8B;IAC9B,yBAAG;IAAA,4CAA4B;IACjC,AADiC,iBAAI,EAC/B;;;;IAqBA,AADF,+BAA6B,iBAC8D;IAA9D,2OAAS,mCAAyB,wBAAE,wBAAwB,KAAC;IACtF,wBAA2B;IAAC,yBAC9B;IAAA,iBAAS;IACT,kCAAyF;IAA9D,2OAAS,mCAAyB,wBAAE,wBAAwB,KAAC;IACtF,wBAAmC;IAAC,yBACtC;IAAA,iBAAS;IACT,kCAA0F;IAA/D,2OAAS,oCAA0B,wBAAE,wBAAwB,KAAC;IACvF,wBAA+B;IAAC,0BAClC;IACF,AADE,iBAAS,EACL;;;;IA1BV,8BAGqC;IAAnC,qNAAS,kCAAwB,KAAC;IAG9B,AADF,AADF,+BAA4B,cACA,eACK;IAAA,YAA4B;IAAA,iBAAO;IAChE,gCAA2B;IAAA,YAA2C;;IACxE,AADwE,iBAAO,EACzE;IAEJ,AADF,+BAA0B,eACG;IACzB,aACF;IAEJ,AADE,AADE,iBAAO,EACH,EACF;IACN,2GAAiD;IAanD,iBAAM;;;;IA1BJ,+EAA4D;IAI3B,eAA4B;IAA5B,oDAA4B;IAC9B,eAA2C;IAA3C,8EAA2C;IAIpE,eACF;IADE,0EACF;IAGJ,cAYC;IAZD,+EAYC;;;;IAQD,AADF,AADF,8BAAwB,cACG,SACnB;IAAA,YAAwE;IAAA,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;;;;;;;;;;;;KAgEP;;kBAyCF,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kFANI,+BAA+B","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJArtifactEntity, MJArtifactVersionEntity } from '@memberjunction/core-entities';\nimport { UserInfo, RunView } from '@memberjunction/core';\n\n@Component({\n standalone: false,\n selector: 'mj-artifact-version-history',\n template: `\n <div class=\"version-history\">\n <div class=\"history-header\">\n <h3>Version History</h3>\n <button class=\"btn-close\" (click)=\"onClose()\" title=\"Close\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n \n <div class=\"version-list\">\n @if (versions.length === 0) {\n <div class=\"empty-state\">\n <i class=\"fas fa-history\"></i>\n <p>No version history available</p>\n </div>\n }\n \n @for (version of versions; track version) {\n <div\n class=\"version-item\"\n [class.selected]=\"version.VersionNumber === selectedVersion\"\n (click)=\"onSelectVersion(version)\">\n <div class=\"version-header\">\n <div class=\"version-info\">\n <span class=\"version-number\">v{{ version.VersionNumber }}</span>\n <span class=\"version-date\">{{ version.__mj_CreatedAt | date:'short' }}</span>\n </div>\n <div class=\"version-meta\">\n <span class=\"version-size\">\n {{ getContentSize(version.Content) }}\n </span>\n </div>\n </div>\n @if (version.VersionNumber === selectedVersion) {\n <div class=\"version-actions\">\n <button class=\"btn-action\" (click)=\"onRestoreVersion(version); $event.stopPropagation()\">\n <i class=\"fas fa-undo\"></i> Restore\n </button>\n <button class=\"btn-action\" (click)=\"onCompareVersion(version); $event.stopPropagation()\">\n <i class=\"fas fa-code-compare\"></i> Compare\n </button>\n <button class=\"btn-action\" (click)=\"onDownloadVersion(version); $event.stopPropagation()\">\n <i class=\"fas fa-download\"></i> Download\n </button>\n </div>\n }\n </div>\n }\n </div>\n \n @if (showDiff && currentVersionContent && previousVersionContent && selectedVersion) {\n <div class=\"diff-panel\">\n <div class=\"diff-header\">\n <h4>Changes from v{{ (selectedVersion || 1) - 1 }} to v{{ selectedVersion }}</h4>\n <button class=\"btn-close-diff\" (click)=\"showDiff = false\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n <div class=\"diff-content\">\n <pre>{{ getDiffSummary() }}</pre>\n </div>\n </div>\n }\n </div>\n `,\n styles: [`\n .version-history { display: flex; flex-direction: column; height: 100%; background: white; }\n .history-header { padding: 16px; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .history-header h3 { margin: 0; font-size: 16px; }\n .btn-close { padding: 6px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close:hover { background: rgba(0,0,0,0.1); }\n\n .version-list { flex: 1; overflow-y: auto; }\n .version-item { padding: 16px; border-bottom: 1px solid #E8E8E8; cursor: pointer; transition: background 150ms ease; }\n .version-item:hover { background: #F9F9F9; }\n .version-item.selected { background: #E3F2FD; border-left: 3px solid #1976D2; }\n\n .version-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }\n .version-info { display: flex; flex-direction: column; gap: 4px; }\n .version-number { font-size: 14px; font-weight: 600; }\n .version-date { font-size: 12px; color: #666; }\n .version-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: #666; }\n .version-author { display: flex; align-items: center; gap: 4px; }\n .version-size { color: #999; }\n\n .version-notes { font-size: 13px; color: #333; margin-bottom: 8px; }\n\n .version-actions { display: flex; gap: 8px; margin-top: 12px; }\n .btn-action { padding: 6px 12px; background: #0076B6; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 6px; }\n .btn-action:hover { background: #005A8C; }\n\n .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; color: #999; }\n .empty-state i { font-size: 48px; margin-bottom: 16px; }\n .empty-state p { margin: 0; font-size: 14px; }\n\n .diff-panel { border-top: 2px solid #D9D9D9; max-height: 50%; overflow: hidden; display: flex; flex-direction: column; }\n .diff-header { padding: 12px 16px; background: #F8F8F8; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .diff-header h4 { margin: 0; font-size: 13px; font-weight: 600; }\n .btn-close-diff { padding: 4px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close-diff:hover { background: rgba(0,0,0,0.1); }\n .diff-content { flex: 1; overflow-y: auto; padding: 16px; }\n .diff-content pre { margin: 0; font-family: 'Courier New', monospace; font-size: 12px; white-space: pre-wrap; }\n `]\n})\nexport class ArtifactVersionHistoryComponent extends BaseAngularComponent implements OnInit {\n @Input() artifact!: MJArtifactEntity;\n @Input() currentUser!: UserInfo;\n\n @Output() closed = new EventEmitter<void>();\n @Output() versionRestored = new EventEmitter<number>();\n @Output() versionSelected = new EventEmitter<number>();\n\n public versions: MJArtifactVersionEntity[] = [];\n public selectedVersion: number | null = null;\n public showDiff: boolean = false;\n public currentVersionContent: string = '';\n public previousVersionContent: string = '';\n\n ngOnInit() {\n this.loadVersions();\n }\n\n private async loadVersions(): Promise<void> {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ArtifactID='${this.artifact.ID}'`,\n OrderBy: 'VersionNumber DESC',\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (result.Success) {\n this.versions = result.Results || [];\n }\n } catch (error) {\n console.error('Failed to load version history:', error);\n }\n }\n\n onSelectVersion(version: MJArtifactVersionEntity): void {\n this.selectedVersion = version.VersionNumber;\n this.versionSelected.emit(version.VersionNumber);\n }\n\n async onRestoreVersion(version: MJArtifactVersionEntity): Promise<void> {\n if (!confirm(`Restore to version ${version.VersionNumber}? This will create a new version.`)) return;\n\n try {\n // Restoring creates a new version with the old content\n this.versionRestored.emit(version.VersionNumber);\n alert(`Version ${version.VersionNumber} has been restored as the latest version`);\n } catch (error) {\n console.error('Failed to restore version:', error);\n alert('Failed to restore version');\n }\n }\n\n async onCompareVersion(version: MJArtifactVersionEntity): Promise<void> {\n if (version.VersionNumber === 1) {\n alert('Cannot compare: this is the first version');\n return;\n }\n\n try {\n this.currentVersionContent = version.Content || '';\n\n // Load previous version\n const previousVersion = this.versions.find(v => v.VersionNumber === version.VersionNumber - 1);\n if (previousVersion) {\n this.previousVersionContent = previousVersion.Content || '';\n this.showDiff = true;\n }\n } catch (error) {\n console.error('Failed to load version for comparison:', error);\n alert('Failed to compare versions');\n }\n }\n\n onDownloadVersion(version: MJArtifactVersionEntity): void {\n try {\n const content = version.Content || '';\n const blob = new Blob([content], { type: 'text/plain' });\n const url = window.URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = `${this.artifact.Name}_v${version.VersionNumber}.txt`;\n link.click();\n window.URL.revokeObjectURL(url);\n } catch (error) {\n console.error('Failed to download version:', error);\n alert('Failed to download version');\n }\n }\n\n getContentSize(content: string | null): string {\n if (!content) return '0 B';\n const bytes = new Blob([content]).size;\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n }\n\n getDiffSummary(): string {\n // Simple line-based diff summary\n const currentLines = this.currentVersionContent.split('\\n');\n const previousLines = this.previousVersionContent.split('\\n');\n\n const added = currentLines.length - previousLines.length;\n const summary = `Lines: ${previousLines.length} → ${currentLines.length} (${added > 0 ? '+' : ''}${added})\\n\\n`;\n\n // Show a simple comparison\n return summary + '(Full diff view would require a diff library)';\n }\n\n onClose(): void {\n this.closed.emit();\n }\n}"]}
1
+ {"version":3,"file":"artifact-version-history.component.js","sourceRoot":"","sources":["../../../src/lib/components/artifact-version-history.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE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Init, inject } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\nimport { MJArtifactEntity, MJArtifactVersionEntity } from '@memberjunction/core-entities';\nimport { UserInfo, RunView } from '@memberjunction/core';\n\n@Component({\n standalone: false,\n selector: 'mj-artifact-version-history',\n template: `\n <div class=\"version-history\">\n <div class=\"history-header\">\n <h3>Version History</h3>\n <button class=\"btn-close\" (click)=\"onClose()\" title=\"Close\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n \n <div class=\"version-list\">\n @if (versions.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-clock-rotate-left\"\n Title=\"No version history available\"\n Size=\"compact\" />\n }\n \n @for (version of versions; track version) {\n <div\n class=\"version-item\"\n [class.selected]=\"version.VersionNumber === selectedVersion\"\n (click)=\"onSelectVersion(version)\">\n <div class=\"version-header\">\n <div class=\"version-info\">\n <span class=\"version-number\">v{{ version.VersionNumber }}</span>\n <span class=\"version-date\">{{ version.__mj_CreatedAt | date:'short' }}</span>\n </div>\n <div class=\"version-meta\">\n <span class=\"version-size\">\n {{ getContentSize(version.Content) }}\n </span>\n </div>\n </div>\n @if (version.VersionNumber === selectedVersion) {\n <div class=\"version-actions\">\n <button class=\"btn-action\" (click)=\"onRestoreVersion(version); $event.stopPropagation()\">\n <i class=\"fas fa-undo\"></i> Restore\n </button>\n <button class=\"btn-action\" (click)=\"onCompareVersion(version); $event.stopPropagation()\">\n <i class=\"fas fa-code-compare\"></i> Compare\n </button>\n <button class=\"btn-action\" (click)=\"onDownloadVersion(version); $event.stopPropagation()\">\n <i class=\"fas fa-download\"></i> Download\n </button>\n </div>\n }\n </div>\n }\n </div>\n \n @if (showDiff && currentVersionContent && previousVersionContent && selectedVersion) {\n <div class=\"diff-panel\">\n <div class=\"diff-header\">\n <h4>Changes from v{{ (selectedVersion || 1) - 1 }} to v{{ selectedVersion }}</h4>\n <button class=\"btn-close-diff\" (click)=\"showDiff = false\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n <div class=\"diff-content\">\n <pre>{{ getDiffSummary() }}</pre>\n </div>\n </div>\n }\n </div>\n `,\n styles: [`\n .version-history { display: flex; flex-direction: column; height: 100%; background: white; }\n .history-header { padding: 16px; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .history-header h3 { margin: 0; font-size: 16px; }\n .btn-close { padding: 6px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close:hover { background: rgba(0,0,0,0.1); }\n\n .version-list { flex: 1; overflow-y: auto; }\n .version-item { padding: 16px; border-bottom: 1px solid #E8E8E8; cursor: pointer; transition: background 150ms ease; }\n .version-item:hover { background: #F9F9F9; }\n .version-item.selected { background: #E3F2FD; border-left: 3px solid #1976D2; }\n\n .version-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }\n .version-info { display: flex; flex-direction: column; gap: 4px; }\n .version-number { font-size: 14px; font-weight: 600; }\n .version-date { font-size: 12px; color: #666; }\n .version-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: #666; }\n .version-author { display: flex; align-items: center; gap: 4px; }\n .version-size { color: #999; }\n\n .version-notes { font-size: 13px; color: #333; margin-bottom: 8px; }\n\n .version-actions { display: flex; gap: 8px; margin-top: 12px; }\n .btn-action { padding: 6px 12px; background: #0076B6; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 6px; }\n .btn-action:hover { background: #005A8C; }\n\n .diff-panel { border-top: 2px solid #D9D9D9; max-height: 50%; overflow: hidden; display: flex; flex-direction: column; }\n .diff-header { padding: 12px 16px; background: #F8F8F8; border-bottom: 1px solid #D9D9D9; display: flex; justify-content: space-between; align-items: center; }\n .diff-header h4 { margin: 0; font-size: 13px; font-weight: 600; }\n .btn-close-diff { padding: 4px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: #666; }\n .btn-close-diff:hover { background: rgba(0,0,0,0.1); }\n .diff-content { flex: 1; overflow-y: auto; padding: 16px; }\n .diff-content pre { margin: 0; font-family: 'Courier New', monospace; font-size: 12px; white-space: pre-wrap; }\n `]\n})\nexport class ArtifactVersionHistoryComponent extends BaseAngularComponent implements OnInit {\n private confirmService = inject(MJConfirmService);\n\n @Input() artifact!: MJArtifactEntity;\n @Input() currentUser!: UserInfo;\n\n @Output() closed = new EventEmitter<void>();\n @Output() versionRestored = new EventEmitter<number>();\n @Output() versionSelected = new EventEmitter<number>();\n\n public versions: MJArtifactVersionEntity[] = [];\n public selectedVersion: number | null = null;\n public showDiff: boolean = false;\n public currentVersionContent: string = '';\n public previousVersionContent: string = '';\n\n ngOnInit() {\n this.loadVersions();\n }\n\n private async loadVersions(): Promise<void> {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ArtifactID='${this.artifact.ID}'`,\n OrderBy: 'VersionNumber DESC',\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (result.Success) {\n this.versions = result.Results || [];\n }\n } catch (error) {\n console.error('Failed to load version history:', error);\n }\n }\n\n onSelectVersion(version: MJArtifactVersionEntity): void {\n this.selectedVersion = version.VersionNumber;\n this.versionSelected.emit(version.VersionNumber);\n }\n\n async onRestoreVersion(version: MJArtifactVersionEntity): Promise<void> {\n if (!(await this.confirmService.Confirm({ title: 'Restore version', message: `Restore to version ${version.VersionNumber}?`, detail: 'This will create a new version.' }))) return;\n\n try {\n // Restoring creates a new version with the old content\n this.versionRestored.emit(version.VersionNumber);\n alert(`Version ${version.VersionNumber} has been restored as the latest version`);\n } catch (error) {\n console.error('Failed to restore version:', error);\n alert('Failed to restore version');\n }\n }\n\n async onCompareVersion(version: MJArtifactVersionEntity): Promise<void> {\n if (version.VersionNumber === 1) {\n alert('Cannot compare: this is the first version');\n return;\n }\n\n try {\n this.currentVersionContent = version.Content || '';\n\n // Load previous version\n const previousVersion = this.versions.find(v => v.VersionNumber === version.VersionNumber - 1);\n if (previousVersion) {\n this.previousVersionContent = previousVersion.Content || '';\n this.showDiff = true;\n }\n } catch (error) {\n console.error('Failed to load version for comparison:', error);\n alert('Failed to compare versions');\n }\n }\n\n onDownloadVersion(version: MJArtifactVersionEntity): void {\n try {\n const content = version.Content || '';\n const blob = new Blob([content], { type: 'text/plain' });\n const url = window.URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = `${this.artifact.Name}_v${version.VersionNumber}.txt`;\n link.click();\n window.URL.revokeObjectURL(url);\n } catch (error) {\n console.error('Failed to download version:', error);\n alert('Failed to download version');\n }\n }\n\n getContentSize(content: string | null): string {\n if (!content) return '0 B';\n const bytes = new Blob([content]).size;\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n }\n\n getDiffSummary(): string {\n // Simple line-based diff summary\n const currentLines = this.currentVersionContent.split('\\n');\n const previousLines = this.previousVersionContent.split('\\n');\n\n const added = currentLines.length - previousLines.length;\n const summary = `Lines: ${previousLines.length} → ${currentLines.length} (${added > 0 ? '+' : ''}${added})\\n\\n`;\n\n // Show a simple comparison\n return summary + '(Full diff view would require a diff library)';\n }\n\n onClose(): void {\n this.closed.emit();\n }\n}"]}
@@ -66,6 +66,7 @@ export declare class ArtifactViewerPanelComponent extends BaseAngularComponent i
66
66
  }>;
67
67
  pluginViewer?: ArtifactTypePluginViewerComponent;
68
68
  private destroy$;
69
+ private artifactLoadToken;
69
70
  artifact: MJArtifactEntity | null;
70
71
  artifactVersion: MJArtifactVersionEntity | null;
71
72
  allVersions: MJArtifactVersionEntity[];
@@ -122,6 +123,8 @@ export declare class ArtifactViewerPanelComponent extends BaseAngularComponent i
122
123
  ngOnInit(): Promise<void>;
123
124
  ngOnChanges(changes: SimpleChanges): Promise<void>;
124
125
  ngOnDestroy(): void;
126
+ private isCurrentArtifactLoad;
127
+ private clearLoadedArtifactState;
125
128
  private loadArtifact;
126
129
  /**
127
130
  * Load full content for a single version by ID.