@memberjunction/ng-artifacts 2.105.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.
- package/dist/lib/artifacts.module.d.ts +30 -0
- package/dist/lib/artifacts.module.d.ts.map +1 -0
- package/dist/lib/artifacts.module.js +124 -0
- package/dist/lib/artifacts.module.js.map +1 -0
- package/dist/lib/components/artifact-message-card.component.d.ts +47 -0
- package/dist/lib/components/artifact-message-card.component.d.ts.map +1 -0
- package/dist/lib/components/artifact-message-card.component.js +270 -0
- package/dist/lib/components/artifact-message-card.component.js.map +1 -0
- package/dist/lib/components/artifact-type-plugin-viewer.component.d.ts +42 -0
- package/dist/lib/components/artifact-type-plugin-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/artifact-type-plugin-viewer.component.js +213 -0
- package/dist/lib/components/artifact-type-plugin-viewer.component.js.map +1 -0
- package/dist/lib/components/artifact-version-history.component.d.ts +28 -0
- package/dist/lib/components/artifact-version-history.component.d.ts.map +1 -0
- package/dist/lib/components/artifact-version-history.component.js +280 -0
- package/dist/lib/components/artifact-version-history.component.js.map +1 -0
- package/dist/lib/components/artifact-viewer-panel.component.d.ts +73 -0
- package/dist/lib/components/artifact-viewer-panel.component.d.ts.map +1 -0
- package/dist/lib/components/artifact-viewer-panel.component.js +942 -0
- package/dist/lib/components/artifact-viewer-panel.component.js.map +1 -0
- package/dist/lib/components/base-artifact-viewer.component.d.ts +70 -0
- package/dist/lib/components/base-artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/base-artifact-viewer.component.js +110 -0
- package/dist/lib/components/base-artifact-viewer.component.js.map +1 -0
- package/dist/lib/components/plugins/code-artifact-viewer.component.d.ts +17 -0
- package/dist/lib/components/plugins/code-artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/plugins/code-artifact-viewer.component.js +125 -0
- package/dist/lib/components/plugins/code-artifact-viewer.component.js.map +1 -0
- package/dist/lib/components/plugins/component-artifact-viewer.component.d.ts +41 -0
- package/dist/lib/components/plugins/component-artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/plugins/component-artifact-viewer.component.js +293 -0
- package/dist/lib/components/plugins/component-artifact-viewer.component.js.map +1 -0
- package/dist/lib/components/plugins/html-artifact-viewer.component.d.ts +18 -0
- package/dist/lib/components/plugins/html-artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/plugins/html-artifact-viewer.component.js +128 -0
- package/dist/lib/components/plugins/html-artifact-viewer.component.js.map +1 -0
- package/dist/lib/components/plugins/json-artifact-viewer.component.d.ts +37 -0
- package/dist/lib/components/plugins/json-artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/plugins/json-artifact-viewer.component.js +208 -0
- package/dist/lib/components/plugins/json-artifact-viewer.component.js.map +1 -0
- package/dist/lib/components/plugins/markdown-artifact-viewer.component.d.ts +14 -0
- package/dist/lib/components/plugins/markdown-artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/plugins/markdown-artifact-viewer.component.js +121 -0
- package/dist/lib/components/plugins/markdown-artifact-viewer.component.js.map +1 -0
- package/dist/lib/components/plugins/svg-artifact-viewer.component.d.ts +18 -0
- package/dist/lib/components/plugins/svg-artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/plugins/svg-artifact-viewer.component.js +129 -0
- package/dist/lib/components/plugins/svg-artifact-viewer.component.js.map +1 -0
- package/dist/lib/interfaces/artifact-viewer-plugin.interface.d.ts +44 -0
- package/dist/lib/interfaces/artifact-viewer-plugin.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/artifact-viewer-plugin.interface.js +2 -0
- package/dist/lib/interfaces/artifact-viewer-plugin.interface.js.map +1 -0
- package/dist/public-api.d.ts +14 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +23 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { Component, Input, ViewChild, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { LogError, RunView } from '@memberjunction/core';
|
|
3
|
+
import { MJGlobal } from '@memberjunction/global';
|
|
4
|
+
import { BaseArtifactViewerPluginComponent } from './base-artifact-viewer.component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
const _c0 = ["viewerContainer"];
|
|
7
|
+
function ArtifactTypePluginViewerComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
8
|
+
i0.ɵɵelementStart(0, "div", 2);
|
|
9
|
+
i0.ɵɵelement(1, "i", 4);
|
|
10
|
+
i0.ɵɵelementStart(2, "span");
|
|
11
|
+
i0.ɵɵtext(3, "Loading artifact viewer...");
|
|
12
|
+
i0.ɵɵelementEnd()();
|
|
13
|
+
} }
|
|
14
|
+
function ArtifactTypePluginViewerComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
15
|
+
i0.ɵɵelementStart(0, "div", 3);
|
|
16
|
+
i0.ɵɵelement(1, "i", 5);
|
|
17
|
+
i0.ɵɵelementStart(2, "span");
|
|
18
|
+
i0.ɵɵtext(3);
|
|
19
|
+
i0.ɵɵelementEnd()();
|
|
20
|
+
} if (rf & 2) {
|
|
21
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
22
|
+
i0.ɵɵadvance(3);
|
|
23
|
+
i0.ɵɵtextInterpolate(ctx_r0.error);
|
|
24
|
+
} }
|
|
25
|
+
/**
|
|
26
|
+
* Artifact type plugin viewer that loads the appropriate plugin based on the artifact's DriverClass.
|
|
27
|
+
* Uses MJGlobal.Instance.ClassFactory.CreateInstance() to dynamically load viewer plugins.
|
|
28
|
+
*/
|
|
29
|
+
export class ArtifactTypePluginViewerComponent {
|
|
30
|
+
artifactVersion;
|
|
31
|
+
artifactTypeName;
|
|
32
|
+
contentType;
|
|
33
|
+
height;
|
|
34
|
+
readonly = true;
|
|
35
|
+
cssClass;
|
|
36
|
+
viewerContainer;
|
|
37
|
+
isLoading = true;
|
|
38
|
+
error = null;
|
|
39
|
+
componentRef = null;
|
|
40
|
+
/**
|
|
41
|
+
* Get the loaded plugin instance (if available)
|
|
42
|
+
*/
|
|
43
|
+
get pluginInstance() {
|
|
44
|
+
return this.componentRef?.instance || null;
|
|
45
|
+
}
|
|
46
|
+
async ngOnInit() {
|
|
47
|
+
await this.loadViewer();
|
|
48
|
+
}
|
|
49
|
+
async ngOnChanges(changes) {
|
|
50
|
+
if ((changes['artifactVersion'] || changes['artifactTypeName']) &&
|
|
51
|
+
!changes['artifactVersion']?.firstChange) {
|
|
52
|
+
await this.loadViewer();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
ngOnDestroy() {
|
|
56
|
+
this.destroyCurrentViewer();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Load the appropriate viewer plugin for the artifact
|
|
60
|
+
*/
|
|
61
|
+
async loadViewer() {
|
|
62
|
+
try {
|
|
63
|
+
this.isLoading = true;
|
|
64
|
+
this.error = null;
|
|
65
|
+
if (!this.artifactVersion) {
|
|
66
|
+
this.error = 'No artifact version provided';
|
|
67
|
+
this.isLoading = false;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (!this.artifactTypeName) {
|
|
71
|
+
this.error = 'No artifact type name provided';
|
|
72
|
+
this.isLoading = false;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// Get the artifact type entity to find the DriverClass
|
|
76
|
+
const artifactType = await this.getArtifactType();
|
|
77
|
+
if (!artifactType) {
|
|
78
|
+
this.error = `Artifact type "${this.artifactTypeName}" not found`;
|
|
79
|
+
this.isLoading = false;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const driverClass = artifactType.DriverClass;
|
|
83
|
+
if (!driverClass) {
|
|
84
|
+
this.error = `No DriverClass configured for artifact type "${this.artifactTypeName}"`;
|
|
85
|
+
this.isLoading = false;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
// Get the component type using MJGlobal ClassFactory
|
|
89
|
+
// CreateInstance returns the registered component class for the given DriverClass key
|
|
90
|
+
const tempInstance = MJGlobal.Instance.ClassFactory.CreateInstance(BaseArtifactViewerPluginComponent, driverClass);
|
|
91
|
+
if (!tempInstance) {
|
|
92
|
+
this.error = `Component "${driverClass}" not found. Make sure the component is registered with @RegisterClass decorator.`;
|
|
93
|
+
this.isLoading = false;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
// Get the component type from the instance
|
|
97
|
+
const componentType = tempInstance.constructor;
|
|
98
|
+
// Destroy previous viewer if exists
|
|
99
|
+
this.destroyCurrentViewer();
|
|
100
|
+
// Create and configure the viewer component
|
|
101
|
+
this.componentRef = this.viewerContainer.createComponent(componentType);
|
|
102
|
+
const componentInstance = this.componentRef.instance;
|
|
103
|
+
// Set inputs
|
|
104
|
+
componentInstance.artifactVersion = this.artifactVersion;
|
|
105
|
+
if (this.height !== undefined) {
|
|
106
|
+
componentInstance.height = this.height;
|
|
107
|
+
}
|
|
108
|
+
if (this.readonly !== undefined) {
|
|
109
|
+
componentInstance.readonly = this.readonly;
|
|
110
|
+
}
|
|
111
|
+
if (this.cssClass !== undefined) {
|
|
112
|
+
componentInstance.cssClass = this.cssClass;
|
|
113
|
+
}
|
|
114
|
+
if (this.contentType !== undefined) {
|
|
115
|
+
componentInstance.contentType = this.contentType;
|
|
116
|
+
}
|
|
117
|
+
// Trigger change detection
|
|
118
|
+
this.componentRef.changeDetectorRef.detectChanges();
|
|
119
|
+
this.isLoading = false;
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
console.error('Error loading artifact viewer:', err);
|
|
123
|
+
LogError(err);
|
|
124
|
+
this.error = 'Failed to load artifact viewer: ' + (err instanceof Error ? err.message : String(err));
|
|
125
|
+
this.isLoading = false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Get the artifact type entity for the current artifact
|
|
130
|
+
*/
|
|
131
|
+
async getArtifactType() {
|
|
132
|
+
try {
|
|
133
|
+
const rv = new RunView();
|
|
134
|
+
const result = await rv.RunView({
|
|
135
|
+
EntityName: 'MJ: Artifact Types',
|
|
136
|
+
ExtraFilter: `Name='${this.artifactTypeName}'`,
|
|
137
|
+
ResultType: 'entity_object'
|
|
138
|
+
});
|
|
139
|
+
if (result.Success && result.Results && result.Results.length > 0) {
|
|
140
|
+
return result.Results[0];
|
|
141
|
+
}
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
console.error('Error loading artifact type:', err);
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Destroy the current viewer component
|
|
151
|
+
*/
|
|
152
|
+
destroyCurrentViewer() {
|
|
153
|
+
if (this.componentRef) {
|
|
154
|
+
this.componentRef.destroy();
|
|
155
|
+
this.componentRef = null;
|
|
156
|
+
}
|
|
157
|
+
this.viewerContainer.clear();
|
|
158
|
+
}
|
|
159
|
+
static ɵfac = function ArtifactTypePluginViewerComponent_Factory(t) { return new (t || ArtifactTypePluginViewerComponent)(); };
|
|
160
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArtifactTypePluginViewerComponent, selectors: [["mj-artifact-type-plugin-viewer"]], viewQuery: function ArtifactTypePluginViewerComponent_Query(rf, ctx) { if (rf & 1) {
|
|
161
|
+
i0.ɵɵviewQuery(_c0, 7, ViewContainerRef);
|
|
162
|
+
} if (rf & 2) {
|
|
163
|
+
let _t;
|
|
164
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.viewerContainer = _t.first);
|
|
165
|
+
} }, inputs: { artifactVersion: "artifactVersion", artifactTypeName: "artifactTypeName", contentType: "contentType", height: "height", readonly: "readonly", cssClass: "cssClass" }, features: [i0.ɵɵNgOnChangesFeature], decls: 5, vars: 2, consts: [["viewerContainer", ""], [1, "artifact-type-plugin-viewer"], [1, "loading-state"], [1, "error-state"], [1, "fas", "fa-spinner", "fa-spin"], [1, "fas", "fa-exclamation-triangle"]], template: function ArtifactTypePluginViewerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
166
|
+
i0.ɵɵelementStart(0, "div", 1);
|
|
167
|
+
i0.ɵɵtemplate(1, ArtifactTypePluginViewerComponent_Conditional_1_Template, 4, 0, "div", 2)(2, ArtifactTypePluginViewerComponent_Conditional_2_Template, 4, 1, "div", 3);
|
|
168
|
+
i0.ɵɵelementContainer(3, null, 0);
|
|
169
|
+
i0.ɵɵelementEnd();
|
|
170
|
+
} if (rf & 2) {
|
|
171
|
+
i0.ɵɵadvance();
|
|
172
|
+
i0.ɵɵconditional(ctx.isLoading ? 1 : -1);
|
|
173
|
+
i0.ɵɵadvance();
|
|
174
|
+
i0.ɵɵconditional(ctx.error ? 2 : -1);
|
|
175
|
+
} }, styles: [".artifact-type-plugin-viewer[_ngcontent-%COMP%] {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .loading-state[_ngcontent-%COMP%], \n .error-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n gap: 16px;\n color: #6c757d;\n }\n\n .loading-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 32px;\n }\n\n .error-state[_ngcontent-%COMP%] {\n color: #dc3545;\n }\n\n .error-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 32px;\n }"] });
|
|
176
|
+
}
|
|
177
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArtifactTypePluginViewerComponent, [{
|
|
178
|
+
type: Component,
|
|
179
|
+
args: [{ selector: 'mj-artifact-type-plugin-viewer', template: `
|
|
180
|
+
<div class="artifact-type-plugin-viewer">
|
|
181
|
+
@if (isLoading) {
|
|
182
|
+
<div class="loading-state">
|
|
183
|
+
<i class="fas fa-spinner fa-spin"></i>
|
|
184
|
+
<span>Loading artifact viewer...</span>
|
|
185
|
+
</div>
|
|
186
|
+
}
|
|
187
|
+
@if (error) {
|
|
188
|
+
<div class="error-state">
|
|
189
|
+
<i class="fas fa-exclamation-triangle"></i>
|
|
190
|
+
<span>{{ error }}</span>
|
|
191
|
+
</div>
|
|
192
|
+
}
|
|
193
|
+
<ng-container #viewerContainer></ng-container>
|
|
194
|
+
</div>
|
|
195
|
+
`, styles: ["\n .artifact-type-plugin-viewer {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .loading-state,\n .error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n gap: 16px;\n color: #6c757d;\n }\n\n .loading-state i {\n font-size: 32px;\n }\n\n .error-state {\n color: #dc3545;\n }\n\n .error-state i {\n font-size: 32px;\n }\n "] }]
|
|
196
|
+
}], null, { artifactVersion: [{
|
|
197
|
+
type: Input
|
|
198
|
+
}], artifactTypeName: [{
|
|
199
|
+
type: Input
|
|
200
|
+
}], contentType: [{
|
|
201
|
+
type: Input
|
|
202
|
+
}], height: [{
|
|
203
|
+
type: Input
|
|
204
|
+
}], readonly: [{
|
|
205
|
+
type: Input
|
|
206
|
+
}], cssClass: [{
|
|
207
|
+
type: Input
|
|
208
|
+
}], viewerContainer: [{
|
|
209
|
+
type: ViewChild,
|
|
210
|
+
args: ['viewerContainer', { read: ViewContainerRef, static: true }]
|
|
211
|
+
}] }); })();
|
|
212
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactTypePluginViewerComponent, { className: "ArtifactTypePluginViewerComponent", filePath: "src/lib/components/artifact-type-plugin-viewer.component.ts", lineNumber: 73 }); })();
|
|
213
|
+
//# sourceMappingURL=artifact-type-plugin-viewer.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-type-plugin-viewer.component.js","sourceRoot":"","sources":["../../../src/lib/components/artifact-type-plugin-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EAIL,SAAS,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B;kBAAxB,KAAK;YACG,WAAW;kBAAnB,KAAK;YACG,MAAM;kBAAd,KAAK;YACG,QAAQ;kBAAhB,KAAK;YACG,QAAQ;kBAAhB,KAAK;YAGN,eAAe;kBADd,SAAS;mBAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAR3D,iCAAiC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { ArtifactEntity, ArtifactVersionEntity } from '@memberjunction/core-entities';
|
|
3
|
+
import { UserInfo } from '@memberjunction/core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ArtifactVersionHistoryComponent implements OnInit {
|
|
6
|
+
artifact: ArtifactEntity;
|
|
7
|
+
currentUser: UserInfo;
|
|
8
|
+
closed: EventEmitter<void>;
|
|
9
|
+
versionRestored: EventEmitter<number>;
|
|
10
|
+
versionSelected: EventEmitter<number>;
|
|
11
|
+
versions: ArtifactVersionEntity[];
|
|
12
|
+
selectedVersion: number | null;
|
|
13
|
+
showDiff: boolean;
|
|
14
|
+
currentVersionContent: string;
|
|
15
|
+
previousVersionContent: string;
|
|
16
|
+
ngOnInit(): void;
|
|
17
|
+
private loadVersions;
|
|
18
|
+
onSelectVersion(version: ArtifactVersionEntity): void;
|
|
19
|
+
onRestoreVersion(version: ArtifactVersionEntity): Promise<void>;
|
|
20
|
+
onCompareVersion(version: ArtifactVersionEntity): Promise<void>;
|
|
21
|
+
onDownloadVersion(version: ArtifactVersionEntity): void;
|
|
22
|
+
getContentSize(content: string | null): string;
|
|
23
|
+
getDiffSummary(): string;
|
|
24
|
+
onClose(): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ArtifactVersionHistoryComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ArtifactVersionHistoryComponent, "mj-artifact-version-history", never, { "artifact": { "alias": "artifact"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; }, { "closed": "closed"; "versionRestored": "versionRestored"; "versionSelected": "versionSelected"; }, never, never, false, never>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=artifact-version-history.component.d.ts.map
|
|
@@ -0,0 +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,cAAc,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAC;;AAEzD,qBAqGa,+BAAgC,YAAW,MAAM;IACnD,QAAQ,EAAG,cAAc,CAAC;IAC1B,WAAW,EAAG,QAAQ,CAAC;IAEtB,MAAM,qBAA4B;IAClC,eAAe,uBAA8B;IAC7C,eAAe,uBAA8B;IAEhD,QAAQ,EAAE,qBAAqB,EAAE,CAAM;IACvC,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,qBAAqB,GAAG,IAAI;IAK/C,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAa/D,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBrE,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAgBvD,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"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
+
import { RunView } from '@memberjunction/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/common";
|
|
5
|
+
function ArtifactVersionHistoryComponent_div_7_Template(rf, ctx) { if (rf & 1) {
|
|
6
|
+
i0.ɵɵelementStart(0, "div", 8);
|
|
7
|
+
i0.ɵɵelement(1, "i", 9);
|
|
8
|
+
i0.ɵɵelementStart(2, "p");
|
|
9
|
+
i0.ɵɵtext(3, "No version history available");
|
|
10
|
+
i0.ɵɵelementEnd()();
|
|
11
|
+
} }
|
|
12
|
+
function ArtifactVersionHistoryComponent_div_8_div_11_Template(rf, ctx) { if (rf & 1) {
|
|
13
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
14
|
+
i0.ɵɵelementStart(0, "div", 18)(1, "button", 19);
|
|
15
|
+
i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_div_8_div_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()); });
|
|
16
|
+
i0.ɵɵelement(2, "i", 20);
|
|
17
|
+
i0.ɵɵtext(3, " Restore ");
|
|
18
|
+
i0.ɵɵelementEnd();
|
|
19
|
+
i0.ɵɵelementStart(4, "button", 19);
|
|
20
|
+
i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_div_8_div_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()); });
|
|
21
|
+
i0.ɵɵelement(5, "i", 21);
|
|
22
|
+
i0.ɵɵtext(6, " Compare ");
|
|
23
|
+
i0.ɵɵelementEnd();
|
|
24
|
+
i0.ɵɵelementStart(7, "button", 19);
|
|
25
|
+
i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_div_8_div_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()); });
|
|
26
|
+
i0.ɵɵelement(8, "i", 22);
|
|
27
|
+
i0.ɵɵtext(9, " Download ");
|
|
28
|
+
i0.ɵɵelementEnd()();
|
|
29
|
+
} }
|
|
30
|
+
function ArtifactVersionHistoryComponent_div_8_Template(rf, ctx) { if (rf & 1) {
|
|
31
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
32
|
+
i0.ɵɵelementStart(0, "div", 10);
|
|
33
|
+
i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_div_8_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)); });
|
|
34
|
+
i0.ɵɵelementStart(1, "div", 11)(2, "div", 12)(3, "span", 13);
|
|
35
|
+
i0.ɵɵtext(4);
|
|
36
|
+
i0.ɵɵelementEnd();
|
|
37
|
+
i0.ɵɵelementStart(5, "span", 14);
|
|
38
|
+
i0.ɵɵtext(6);
|
|
39
|
+
i0.ɵɵpipe(7, "date");
|
|
40
|
+
i0.ɵɵelementEnd()();
|
|
41
|
+
i0.ɵɵelementStart(8, "div", 15)(9, "span", 16);
|
|
42
|
+
i0.ɵɵtext(10);
|
|
43
|
+
i0.ɵɵelementEnd()()();
|
|
44
|
+
i0.ɵɵtemplate(11, ArtifactVersionHistoryComponent_div_8_div_11_Template, 10, 0, "div", 17);
|
|
45
|
+
i0.ɵɵelementEnd();
|
|
46
|
+
} if (rf & 2) {
|
|
47
|
+
const version_r2 = ctx.$implicit;
|
|
48
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
49
|
+
i0.ɵɵclassProp("selected", version_r2.VersionNumber === ctx_r2.selectedVersion);
|
|
50
|
+
i0.ɵɵadvance(4);
|
|
51
|
+
i0.ɵɵtextInterpolate1("v", version_r2.VersionNumber, "");
|
|
52
|
+
i0.ɵɵadvance(2);
|
|
53
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(7, 6, version_r2.__mj_CreatedAt, "short"));
|
|
54
|
+
i0.ɵɵadvance(4);
|
|
55
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r2.getContentSize(version_r2.Content), " ");
|
|
56
|
+
i0.ɵɵadvance();
|
|
57
|
+
i0.ɵɵproperty("ngIf", version_r2.VersionNumber === ctx_r2.selectedVersion);
|
|
58
|
+
} }
|
|
59
|
+
function ArtifactVersionHistoryComponent_div_9_Template(rf, ctx) { if (rf & 1) {
|
|
60
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
61
|
+
i0.ɵɵelementStart(0, "div", 23)(1, "div", 24)(2, "h4");
|
|
62
|
+
i0.ɵɵtext(3);
|
|
63
|
+
i0.ɵɵelementEnd();
|
|
64
|
+
i0.ɵɵelementStart(4, "button", 25);
|
|
65
|
+
i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_div_9_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r5); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.showDiff = false); });
|
|
66
|
+
i0.ɵɵelement(5, "i", 3);
|
|
67
|
+
i0.ɵɵelementEnd()();
|
|
68
|
+
i0.ɵɵelementStart(6, "div", 26)(7, "pre");
|
|
69
|
+
i0.ɵɵtext(8);
|
|
70
|
+
i0.ɵɵelementEnd()()();
|
|
71
|
+
} if (rf & 2) {
|
|
72
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
73
|
+
i0.ɵɵadvance(3);
|
|
74
|
+
i0.ɵɵtextInterpolate2("Changes from v", (ctx_r2.selectedVersion || 1) - 1, " to v", ctx_r2.selectedVersion, "");
|
|
75
|
+
i0.ɵɵadvance(5);
|
|
76
|
+
i0.ɵɵtextInterpolate(ctx_r2.getDiffSummary());
|
|
77
|
+
} }
|
|
78
|
+
export class ArtifactVersionHistoryComponent {
|
|
79
|
+
artifact;
|
|
80
|
+
currentUser;
|
|
81
|
+
closed = new EventEmitter();
|
|
82
|
+
versionRestored = new EventEmitter();
|
|
83
|
+
versionSelected = new EventEmitter();
|
|
84
|
+
versions = [];
|
|
85
|
+
selectedVersion = null;
|
|
86
|
+
showDiff = false;
|
|
87
|
+
currentVersionContent = '';
|
|
88
|
+
previousVersionContent = '';
|
|
89
|
+
ngOnInit() {
|
|
90
|
+
this.loadVersions();
|
|
91
|
+
}
|
|
92
|
+
async loadVersions() {
|
|
93
|
+
try {
|
|
94
|
+
const rv = new RunView();
|
|
95
|
+
const result = await rv.RunView({
|
|
96
|
+
EntityName: 'MJ: Artifact Versions',
|
|
97
|
+
ExtraFilter: `ArtifactID='${this.artifact.ID}'`,
|
|
98
|
+
OrderBy: 'VersionNumber DESC',
|
|
99
|
+
ResultType: 'entity_object'
|
|
100
|
+
}, this.currentUser);
|
|
101
|
+
if (result.Success) {
|
|
102
|
+
this.versions = result.Results || [];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
console.error('Failed to load version history:', error);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
onSelectVersion(version) {
|
|
110
|
+
this.selectedVersion = version.VersionNumber;
|
|
111
|
+
this.versionSelected.emit(version.VersionNumber);
|
|
112
|
+
}
|
|
113
|
+
async onRestoreVersion(version) {
|
|
114
|
+
if (!confirm(`Restore to version ${version.VersionNumber}? This will create a new version.`))
|
|
115
|
+
return;
|
|
116
|
+
try {
|
|
117
|
+
// Restoring creates a new version with the old content
|
|
118
|
+
this.versionRestored.emit(version.VersionNumber);
|
|
119
|
+
alert(`Version ${version.VersionNumber} has been restored as the latest version`);
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
console.error('Failed to restore version:', error);
|
|
123
|
+
alert('Failed to restore version');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
async onCompareVersion(version) {
|
|
127
|
+
if (version.VersionNumber === 1) {
|
|
128
|
+
alert('Cannot compare: this is the first version');
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
this.currentVersionContent = version.Content || '';
|
|
133
|
+
// Load previous version
|
|
134
|
+
const previousVersion = this.versions.find(v => v.VersionNumber === version.VersionNumber - 1);
|
|
135
|
+
if (previousVersion) {
|
|
136
|
+
this.previousVersionContent = previousVersion.Content || '';
|
|
137
|
+
this.showDiff = true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
console.error('Failed to load version for comparison:', error);
|
|
142
|
+
alert('Failed to compare versions');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
onDownloadVersion(version) {
|
|
146
|
+
try {
|
|
147
|
+
const content = version.Content || '';
|
|
148
|
+
const blob = new Blob([content], { type: 'text/plain' });
|
|
149
|
+
const url = window.URL.createObjectURL(blob);
|
|
150
|
+
const link = document.createElement('a');
|
|
151
|
+
link.href = url;
|
|
152
|
+
link.download = `${this.artifact.Name}_v${version.VersionNumber}.txt`;
|
|
153
|
+
link.click();
|
|
154
|
+
window.URL.revokeObjectURL(url);
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
console.error('Failed to download version:', error);
|
|
158
|
+
alert('Failed to download version');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
getContentSize(content) {
|
|
162
|
+
if (!content)
|
|
163
|
+
return '0 B';
|
|
164
|
+
const bytes = new Blob([content]).size;
|
|
165
|
+
if (bytes < 1024)
|
|
166
|
+
return `${bytes} B`;
|
|
167
|
+
if (bytes < 1024 * 1024)
|
|
168
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
169
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
170
|
+
}
|
|
171
|
+
getDiffSummary() {
|
|
172
|
+
// Simple line-based diff summary
|
|
173
|
+
const currentLines = this.currentVersionContent.split('\n');
|
|
174
|
+
const previousLines = this.previousVersionContent.split('\n');
|
|
175
|
+
const added = currentLines.length - previousLines.length;
|
|
176
|
+
const summary = `Lines: ${previousLines.length} → ${currentLines.length} (${added > 0 ? '+' : ''}${added})\n\n`;
|
|
177
|
+
// Show a simple comparison
|
|
178
|
+
return summary + '(Full diff view would require a diff library)';
|
|
179
|
+
}
|
|
180
|
+
onClose() {
|
|
181
|
+
this.closed.emit();
|
|
182
|
+
}
|
|
183
|
+
static ɵfac = function ArtifactVersionHistoryComponent_Factory(t) { return new (t || ArtifactVersionHistoryComponent)(); };
|
|
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" }, decls: 10, vars: 3, consts: [[1, "version-history"], [1, "history-header"], ["title", "Close", 1, "btn-close", 3, "click"], [1, "fas", "fa-times"], [1, "version-list"], ["class", "empty-state", 4, "ngIf"], ["class", "version-item", 3, "selected", "click", 4, "ngFor", "ngForOf"], ["class", "diff-panel", 4, "ngIf"], [1, "empty-state"], [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"], ["class", "version-actions", 4, "ngIf"], [1, "version-actions"], [1, "btn-action", 3, "click"], [1, "fas", "fa-undo"], [1, "fas", "fa-code-compare"], [1, "fas", "fa-download"], [1, "diff-panel"], [1, "diff-header"], [1, "btn-close-diff", 3, "click"], [1, "diff-content"]], template: function ArtifactVersionHistoryComponent_Template(rf, ctx) { if (rf & 1) {
|
|
185
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h3");
|
|
186
|
+
i0.ɵɵtext(3, "Version History");
|
|
187
|
+
i0.ɵɵelementEnd();
|
|
188
|
+
i0.ɵɵelementStart(4, "button", 2);
|
|
189
|
+
i0.ɵɵlistener("click", function ArtifactVersionHistoryComponent_Template_button_click_4_listener() { return ctx.onClose(); });
|
|
190
|
+
i0.ɵɵelement(5, "i", 3);
|
|
191
|
+
i0.ɵɵelementEnd()();
|
|
192
|
+
i0.ɵɵelementStart(6, "div", 4);
|
|
193
|
+
i0.ɵɵtemplate(7, ArtifactVersionHistoryComponent_div_7_Template, 4, 0, "div", 5)(8, ArtifactVersionHistoryComponent_div_8_Template, 12, 9, "div", 6);
|
|
194
|
+
i0.ɵɵelementEnd();
|
|
195
|
+
i0.ɵɵtemplate(9, ArtifactVersionHistoryComponent_div_9_Template, 9, 3, "div", 7);
|
|
196
|
+
i0.ɵɵelementEnd();
|
|
197
|
+
} if (rf & 2) {
|
|
198
|
+
i0.ɵɵadvance(7);
|
|
199
|
+
i0.ɵɵproperty("ngIf", ctx.versions.length === 0);
|
|
200
|
+
i0.ɵɵadvance();
|
|
201
|
+
i0.ɵɵproperty("ngForOf", ctx.versions);
|
|
202
|
+
i0.ɵɵadvance();
|
|
203
|
+
i0.ɵɵproperty("ngIf", ctx.showDiff && ctx.currentVersionContent && ctx.previousVersionContent && ctx.selectedVersion);
|
|
204
|
+
} }, dependencies: [i1.NgForOf, i1.NgIf, 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
|
+
}
|
|
206
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArtifactVersionHistoryComponent, [{
|
|
207
|
+
type: Component,
|
|
208
|
+
args: [{ selector: 'mj-artifact-version-history', template: `
|
|
209
|
+
<div class="version-history">
|
|
210
|
+
<div class="history-header">
|
|
211
|
+
<h3>Version History</h3>
|
|
212
|
+
<button class="btn-close" (click)="onClose()" title="Close">
|
|
213
|
+
<i class="fas fa-times"></i>
|
|
214
|
+
</button>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<div class="version-list">
|
|
218
|
+
<div *ngIf="versions.length === 0" class="empty-state">
|
|
219
|
+
<i class="fas fa-history"></i>
|
|
220
|
+
<p>No version history available</p>
|
|
221
|
+
</div>
|
|
222
|
+
|
|
223
|
+
<div
|
|
224
|
+
*ngFor="let version of versions"
|
|
225
|
+
class="version-item"
|
|
226
|
+
[class.selected]="version.VersionNumber === selectedVersion"
|
|
227
|
+
(click)="onSelectVersion(version)">
|
|
228
|
+
|
|
229
|
+
<div class="version-header">
|
|
230
|
+
<div class="version-info">
|
|
231
|
+
<span class="version-number">v{{ version.VersionNumber }}</span>
|
|
232
|
+
<span class="version-date">{{ version.__mj_CreatedAt | date:'short' }}</span>
|
|
233
|
+
</div>
|
|
234
|
+
<div class="version-meta">
|
|
235
|
+
<span class="version-size">
|
|
236
|
+
{{ getContentSize(version.Content) }}
|
|
237
|
+
</span>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
<div class="version-actions" *ngIf="version.VersionNumber === selectedVersion">
|
|
242
|
+
<button class="btn-action" (click)="onRestoreVersion(version); $event.stopPropagation()">
|
|
243
|
+
<i class="fas fa-undo"></i> Restore
|
|
244
|
+
</button>
|
|
245
|
+
<button class="btn-action" (click)="onCompareVersion(version); $event.stopPropagation()">
|
|
246
|
+
<i class="fas fa-code-compare"></i> Compare
|
|
247
|
+
</button>
|
|
248
|
+
<button class="btn-action" (click)="onDownloadVersion(version); $event.stopPropagation()">
|
|
249
|
+
<i class="fas fa-download"></i> Download
|
|
250
|
+
</button>
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
<div class="diff-panel" *ngIf="showDiff && currentVersionContent && previousVersionContent && selectedVersion">
|
|
256
|
+
<div class="diff-header">
|
|
257
|
+
<h4>Changes from v{{ (selectedVersion || 1) - 1 }} to v{{ selectedVersion }}</h4>
|
|
258
|
+
<button class="btn-close-diff" (click)="showDiff = false">
|
|
259
|
+
<i class="fas fa-times"></i>
|
|
260
|
+
</button>
|
|
261
|
+
</div>
|
|
262
|
+
<div class="diff-content">
|
|
263
|
+
<pre>{{ getDiffSummary() }}</pre>
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
`, 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 "] }]
|
|
268
|
+
}], null, { artifact: [{
|
|
269
|
+
type: Input
|
|
270
|
+
}], currentUser: [{
|
|
271
|
+
type: Input
|
|
272
|
+
}], closed: [{
|
|
273
|
+
type: Output
|
|
274
|
+
}], versionRestored: [{
|
|
275
|
+
type: Output
|
|
276
|
+
}], versionSelected: [{
|
|
277
|
+
type: Output
|
|
278
|
+
}] }); })();
|
|
279
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactVersionHistoryComponent, { className: "ArtifactVersionHistoryComponent", filePath: "src/lib/components/artifact-version-history.component.ts", lineNumber: 106 }); })();
|
|
280
|
+
//# sourceMappingURL=artifact-version-history.component.js.map
|
|
@@ -0,0 +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;AAE/E,OAAO,EAAY,OAAO,EAAE,MAAM,sBAAsB,CAAC;;;;IAcjD,8BAAuD;IACrD,uBAA8B;IAC9B,yBAAG;IAAA,4CAA4B;IACjC,AADiC,iBAAI,EAC/B;;;;IAqBF,AADF,+BAA+E,iBACY;IAA9D,mOAAS,mCAAyB,wBAAE,wBAAwB,KAAC;IACtF,wBAA2B;IAAC,yBAC9B;IAAA,iBAAS;IACT,kCAAyF;IAA9D,mOAAS,mCAAyB,wBAAE,wBAAwB,KAAC;IACtF,wBAAmC;IAAC,yBACtC;IAAA,iBAAS;IACT,kCAA0F;IAA/D,mOAAS,oCAA0B,wBAAE,wBAAwB,KAAC;IACvF,wBAA+B;IAAC,0BAClC;IACF,AADE,iBAAS,EACL;;;;IA5BR,+BAIqC;IAAnC,qNAAS,kCAAwB,KAAC;IAI9B,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;IAEN,0FAA+E;IAWjF,iBAAM;;;;IA1B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F;;;iFAoDtG,+BAA+B;cArG3C,SAAS;2BACE,6BAA6B,YAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DT;gBAyCQ,QAAQ;kBAAhB,KAAK;YACG,WAAW;kBAAnB,KAAK;YAEI,MAAM;kBAAf,MAAM;YACG,eAAe;kBAAxB,MAAM;YACG,eAAe;kBAAxB,MAAM;;kFANI,+BAA+B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { UserInfo } from '@memberjunction/core';
|
|
3
|
+
import { ArtifactEntity, ArtifactVersionEntity, ArtifactVersionAttributeEntity, CollectionEntity, CollectionArtifactEntity } from '@memberjunction/core-entities';
|
|
4
|
+
import { Subject } from 'rxjs';
|
|
5
|
+
import { ArtifactTypePluginViewerComponent } from './artifact-type-plugin-viewer.component';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class ArtifactViewerPanelComponent implements OnInit, OnChanges, OnDestroy {
|
|
8
|
+
artifactId: string;
|
|
9
|
+
currentUser: UserInfo;
|
|
10
|
+
environmentId: string;
|
|
11
|
+
versionNumber?: number;
|
|
12
|
+
showSaveToCollection: boolean;
|
|
13
|
+
refreshTrigger?: Subject<{
|
|
14
|
+
artifactId: string;
|
|
15
|
+
versionNumber: number;
|
|
16
|
+
}>;
|
|
17
|
+
closed: EventEmitter<void>;
|
|
18
|
+
pluginViewer?: ArtifactTypePluginViewerComponent;
|
|
19
|
+
private destroy$;
|
|
20
|
+
artifact: ArtifactEntity | null;
|
|
21
|
+
artifactVersion: ArtifactVersionEntity | null;
|
|
22
|
+
allVersions: ArtifactVersionEntity[];
|
|
23
|
+
selectedVersionNumber: number;
|
|
24
|
+
isLoading: boolean;
|
|
25
|
+
error: string | null;
|
|
26
|
+
jsonContent: string;
|
|
27
|
+
showVersionDropdown: boolean;
|
|
28
|
+
showLibraryDialog: boolean;
|
|
29
|
+
collections: CollectionEntity[];
|
|
30
|
+
selectedCollectionId: string | null;
|
|
31
|
+
newCollectionName: string;
|
|
32
|
+
isCreatingCollection: boolean;
|
|
33
|
+
isSavingToLibrary: boolean;
|
|
34
|
+
artifactCollections: CollectionArtifactEntity[];
|
|
35
|
+
primaryCollection: CollectionEntity | null;
|
|
36
|
+
activeTab: 'display' | 'json' | 'details';
|
|
37
|
+
displayMarkdown: string | null;
|
|
38
|
+
displayHtml: string | null;
|
|
39
|
+
versionAttributes: ArtifactVersionAttributeEntity[];
|
|
40
|
+
private artifactTypeDriverClass;
|
|
41
|
+
private cachedPluginShouldShowRaw;
|
|
42
|
+
private cachedPluginIsElevated;
|
|
43
|
+
ngOnInit(): Promise<void>;
|
|
44
|
+
ngOnChanges(changes: SimpleChanges): Promise<void>;
|
|
45
|
+
ngOnDestroy(): void;
|
|
46
|
+
private loadArtifact;
|
|
47
|
+
private loadArtifactType;
|
|
48
|
+
private loadVersionAttributes;
|
|
49
|
+
get displayName(): string;
|
|
50
|
+
get displayDescription(): string | null;
|
|
51
|
+
get hasDisplayTab(): boolean;
|
|
52
|
+
get hasPlugin(): boolean;
|
|
53
|
+
get hasJsonTab(): boolean;
|
|
54
|
+
get artifactTypeName(): string;
|
|
55
|
+
get contentType(): string | undefined;
|
|
56
|
+
get filteredAttributes(): ArtifactVersionAttributeEntity[];
|
|
57
|
+
setActiveTab(tab: 'display' | 'json' | 'details'): void;
|
|
58
|
+
private parseAttributeValue;
|
|
59
|
+
private loadCollectionAssociations;
|
|
60
|
+
get isInCollection(): boolean;
|
|
61
|
+
onCopyToClipboard(): void;
|
|
62
|
+
onCopyDisplayContent(): void;
|
|
63
|
+
toggleVersionDropdown(): void;
|
|
64
|
+
selectVersion(version: ArtifactVersionEntity): Promise<void>;
|
|
65
|
+
onSaveToLibrary(): Promise<void>;
|
|
66
|
+
createNewCollection(): Promise<void>;
|
|
67
|
+
saveToSelectedCollection(): Promise<void>;
|
|
68
|
+
cancelLibraryDialog(): void;
|
|
69
|
+
onClose(): void;
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ArtifactViewerPanelComponent, never>;
|
|
71
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ArtifactViewerPanelComponent, "mj-artifact-viewer-panel", never, { "artifactId": { "alias": "artifactId"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; "environmentId": { "alias": "environmentId"; "required": false; }; "versionNumber": { "alias": "versionNumber"; "required": false; }; "showSaveToCollection": { "alias": "showSaveToCollection"; "required": false; }; "refreshTrigger": { "alias": "refreshTrigger"; "required": false; }; }, { "closed": "closed"; }, never, never, false, never>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=artifact-viewer-panel.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-viewer-panel.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/artifact-viewer-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAa,MAAM,eAAe,CAAC;AAC/H,OAAO,EAAE,QAAQ,EAA+B,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,8BAA8B,EAAsB,gBAAgB,EAAE,wBAAwB,EAA0B,MAAM,+BAA+B,CAAC;AAE9M,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;;AAE5F,qBAKa,4BAA6B,YAAW,MAAM,EAAE,SAAS,EAAE,SAAS;IACtE,UAAU,EAAG,MAAM,CAAC;IACpB,WAAW,EAAG,QAAQ,CAAC;IACvB,aAAa,EAAG,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAQ;IACrC,cAAc,CAAC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