@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,942 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core';
|
|
2
|
+
import { Metadata, RunView, LogError } from '@memberjunction/core';
|
|
3
|
+
import { ArtifactMetadataEngine } from '@memberjunction/core-entities';
|
|
4
|
+
import { MJNotificationService } from '@memberjunction/ng-notifications';
|
|
5
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
import { takeUntil } from 'rxjs/operators';
|
|
7
|
+
import { ArtifactTypePluginViewerComponent } from './artifact-type-plugin-viewer.component';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "@angular/common";
|
|
10
|
+
import * as i2 from "@angular/forms";
|
|
11
|
+
import * as i3 from "ngx-markdown";
|
|
12
|
+
import * as i4 from "@memberjunction/ng-code-editor";
|
|
13
|
+
import * as i5 from "./artifact-type-plugin-viewer.component";
|
|
14
|
+
const _forTrack0 = ($index, $item) => $item.ID;
|
|
15
|
+
function ArtifactViewerPanelComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
16
|
+
i0.ɵɵelementStart(0, "p", 4);
|
|
17
|
+
i0.ɵɵtext(1);
|
|
18
|
+
i0.ɵɵelementEnd();
|
|
19
|
+
} if (rf & 2) {
|
|
20
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
21
|
+
i0.ɵɵadvance();
|
|
22
|
+
i0.ɵɵtextInterpolate(ctx_r0.displayDescription);
|
|
23
|
+
} }
|
|
24
|
+
function ArtifactViewerPanelComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
25
|
+
i0.ɵɵelement(0, "i", 19);
|
|
26
|
+
} if (rf & 2) {
|
|
27
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
28
|
+
i0.ɵɵclassProp("open", ctx_r0.showVersionDropdown);
|
|
29
|
+
} }
|
|
30
|
+
function ArtifactViewerPanelComponent_Conditional_13_For_2_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
31
|
+
i0.ɵɵelement(0, "i", 25);
|
|
32
|
+
} }
|
|
33
|
+
function ArtifactViewerPanelComponent_Conditional_13_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
34
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
35
|
+
i0.ɵɵelementStart(0, "div", 22);
|
|
36
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_13_For_2_Template_div_click_0_listener($event) { const version_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r0 = i0.ɵɵnextContext(2); ctx_r0.selectVersion(version_r4); return i0.ɵɵresetView($event.stopPropagation()); });
|
|
37
|
+
i0.ɵɵelementStart(1, "span", 23);
|
|
38
|
+
i0.ɵɵtext(2);
|
|
39
|
+
i0.ɵɵelementEnd();
|
|
40
|
+
i0.ɵɵelementStart(3, "span", 24);
|
|
41
|
+
i0.ɵɵtext(4);
|
|
42
|
+
i0.ɵɵpipe(5, "date");
|
|
43
|
+
i0.ɵɵelementEnd();
|
|
44
|
+
i0.ɵɵtemplate(6, ArtifactViewerPanelComponent_Conditional_13_For_2_Conditional_6_Template, 1, 0, "i", 25);
|
|
45
|
+
i0.ɵɵelementEnd();
|
|
46
|
+
} if (rf & 2) {
|
|
47
|
+
const version_r4 = ctx.$implicit;
|
|
48
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
49
|
+
i0.ɵɵclassProp("selected", version_r4.VersionNumber === ctx_r0.selectedVersionNumber);
|
|
50
|
+
i0.ɵɵadvance(2);
|
|
51
|
+
i0.ɵɵtextInterpolate1("v", version_r4.VersionNumber, "");
|
|
52
|
+
i0.ɵɵadvance(2);
|
|
53
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(5, 5, version_r4.__mj_CreatedAt, "short"));
|
|
54
|
+
i0.ɵɵadvance(2);
|
|
55
|
+
i0.ɵɵconditional(version_r4.VersionNumber === ctx_r0.selectedVersionNumber ? 6 : -1);
|
|
56
|
+
} }
|
|
57
|
+
function ArtifactViewerPanelComponent_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
58
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
59
|
+
i0.ɵɵelementStart(0, "div", 20);
|
|
60
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_13_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r2); return i0.ɵɵresetView($event.stopPropagation()); });
|
|
61
|
+
i0.ɵɵrepeaterCreate(1, ArtifactViewerPanelComponent_Conditional_13_For_2_Template, 7, 8, "div", 21, _forTrack0);
|
|
62
|
+
i0.ɵɵelementEnd();
|
|
63
|
+
} if (rf & 2) {
|
|
64
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
65
|
+
i0.ɵɵadvance();
|
|
66
|
+
i0.ɵɵrepeater(ctx_r0.allVersions);
|
|
67
|
+
} }
|
|
68
|
+
function ArtifactViewerPanelComponent_Conditional_14_Template(rf, ctx) { if (rf & 1) {
|
|
69
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
70
|
+
i0.ɵɵelementStart(0, "button", 26);
|
|
71
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_14_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onSaveToLibrary()); });
|
|
72
|
+
i0.ɵɵelement(1, "i", 27);
|
|
73
|
+
i0.ɵɵelementEnd();
|
|
74
|
+
} if (rf & 2) {
|
|
75
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
76
|
+
i0.ɵɵclassProp("in-collection", ctx_r0.isInCollection);
|
|
77
|
+
i0.ɵɵproperty("title", ctx_r0.isInCollection ? "View in Collection" : "Save to Collection");
|
|
78
|
+
i0.ɵɵadvance();
|
|
79
|
+
i0.ɵɵproperty("ngClass", ctx_r0.isInCollection ? "fas fa-bookmark" : "far fa-bookmark");
|
|
80
|
+
} }
|
|
81
|
+
function ArtifactViewerPanelComponent_Conditional_18_Template(rf, ctx) { if (rf & 1) {
|
|
82
|
+
i0.ɵɵelementStart(0, "div", 15);
|
|
83
|
+
i0.ɵɵelement(1, "i", 28);
|
|
84
|
+
i0.ɵɵelementStart(2, "span");
|
|
85
|
+
i0.ɵɵtext(3, "Loading artifact...");
|
|
86
|
+
i0.ɵɵelementEnd()();
|
|
87
|
+
} }
|
|
88
|
+
function ArtifactViewerPanelComponent_Conditional_19_Template(rf, ctx) { if (rf & 1) {
|
|
89
|
+
i0.ɵɵelementStart(0, "div", 16);
|
|
90
|
+
i0.ɵɵelement(1, "i", 29);
|
|
91
|
+
i0.ɵɵelementStart(2, "span");
|
|
92
|
+
i0.ɵɵtext(3);
|
|
93
|
+
i0.ɵɵelementEnd()();
|
|
94
|
+
} if (rf & 2) {
|
|
95
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
96
|
+
i0.ɵɵadvance(3);
|
|
97
|
+
i0.ɵɵtextInterpolate(ctx_r0.error);
|
|
98
|
+
} }
|
|
99
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
100
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
101
|
+
i0.ɵɵelementStart(0, "button", 32);
|
|
102
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_20_Conditional_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.setActiveTab("display")); });
|
|
103
|
+
i0.ɵɵelement(1, "i", 38);
|
|
104
|
+
i0.ɵɵtext(2, " Display ");
|
|
105
|
+
i0.ɵɵelementEnd();
|
|
106
|
+
} if (rf & 2) {
|
|
107
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
108
|
+
i0.ɵɵclassProp("active", ctx_r0.activeTab === "display");
|
|
109
|
+
} }
|
|
110
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
111
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
112
|
+
i0.ɵɵelementStart(0, "button", 32);
|
|
113
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_20_Conditional_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.setActiveTab("json")); });
|
|
114
|
+
i0.ɵɵelement(1, "i", 39);
|
|
115
|
+
i0.ɵɵtext(2, " JSON ");
|
|
116
|
+
i0.ɵɵelementEnd();
|
|
117
|
+
} if (rf & 2) {
|
|
118
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
119
|
+
i0.ɵɵclassProp("active", ctx_r0.activeTab === "json");
|
|
120
|
+
} }
|
|
121
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
122
|
+
i0.ɵɵelement(0, "mj-artifact-type-plugin-viewer", 40);
|
|
123
|
+
} if (rf & 2) {
|
|
124
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
125
|
+
i0.ɵɵproperty("artifactVersion", ctx_r0.artifactVersion)("artifactTypeName", ctx_r0.artifactTypeName)("contentType", ctx_r0.contentType)("readonly", true);
|
|
126
|
+
} }
|
|
127
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Conditional_2_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
128
|
+
i0.ɵɵelementStart(0, "div", 44);
|
|
129
|
+
i0.ɵɵelement(1, "markdown", 46);
|
|
130
|
+
i0.ɵɵelementEnd();
|
|
131
|
+
} if (rf & 2) {
|
|
132
|
+
const ctx_r0 = i0.ɵɵnextContext(4);
|
|
133
|
+
i0.ɵɵadvance();
|
|
134
|
+
i0.ɵɵproperty("data", ctx_r0.displayMarkdown);
|
|
135
|
+
} }
|
|
136
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Conditional_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
137
|
+
i0.ɵɵelement(0, "div", 45);
|
|
138
|
+
} if (rf & 2) {
|
|
139
|
+
const ctx_r0 = i0.ɵɵnextContext(4);
|
|
140
|
+
i0.ɵɵproperty("innerHTML", ctx_r0.displayHtml, i0.ɵɵsanitizeHtml);
|
|
141
|
+
} }
|
|
142
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
143
|
+
const _r9 = i0.ɵɵgetCurrentView();
|
|
144
|
+
i0.ɵɵelementStart(0, "div", 41)(1, "button", 42);
|
|
145
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Conditional_2_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.onCopyDisplayContent()); });
|
|
146
|
+
i0.ɵɵelement(2, "i", 43);
|
|
147
|
+
i0.ɵɵtext(3, " Copy ");
|
|
148
|
+
i0.ɵɵelementEnd()();
|
|
149
|
+
i0.ɵɵtemplate(4, ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Conditional_2_Conditional_4_Template, 2, 1, "div", 44)(5, ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Conditional_2_Conditional_5_Template, 1, 1, "div", 45);
|
|
150
|
+
} if (rf & 2) {
|
|
151
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
152
|
+
i0.ɵɵadvance(4);
|
|
153
|
+
i0.ɵɵconditional(ctx_r0.displayMarkdown ? 4 : ctx_r0.displayHtml ? 5 : -1);
|
|
154
|
+
} }
|
|
155
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
156
|
+
i0.ɵɵelementStart(0, "div", 35);
|
|
157
|
+
i0.ɵɵtemplate(1, ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Conditional_1_Template, 1, 4, "mj-artifact-type-plugin-viewer", 40)(2, ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Conditional_2_Template, 6, 1);
|
|
158
|
+
i0.ɵɵelementEnd();
|
|
159
|
+
} if (rf & 2) {
|
|
160
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
161
|
+
i0.ɵɵadvance();
|
|
162
|
+
i0.ɵɵconditional(ctx_r0.hasPlugin && ctx_r0.artifactVersion && ctx_r0.artifactTypeName ? 1 : ctx_r0.displayMarkdown || ctx_r0.displayHtml ? 2 : -1);
|
|
163
|
+
} }
|
|
164
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
165
|
+
const _r10 = i0.ɵɵgetCurrentView();
|
|
166
|
+
i0.ɵɵelementStart(0, "div", 36)(1, "div", 47)(2, "button", 48);
|
|
167
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_20_Conditional_9_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r10); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onCopyToClipboard()); });
|
|
168
|
+
i0.ɵɵelement(3, "i", 43);
|
|
169
|
+
i0.ɵɵtext(4, " Copy ");
|
|
170
|
+
i0.ɵɵelementEnd()();
|
|
171
|
+
i0.ɵɵelementStart(5, "div", 49)(6, "mj-code-editor", 50);
|
|
172
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ArtifactViewerPanelComponent_Conditional_20_Conditional_9_Template_mj_code_editor_ngModelChange_6_listener($event) { i0.ɵɵrestoreView(_r10); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.jsonContent, $event) || (ctx_r0.jsonContent = $event); return i0.ɵɵresetView($event); });
|
|
173
|
+
i0.ɵɵelementEnd()()();
|
|
174
|
+
} if (rf & 2) {
|
|
175
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
176
|
+
i0.ɵɵadvance(6);
|
|
177
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.jsonContent);
|
|
178
|
+
i0.ɵɵproperty("language", "json")("readonly", true);
|
|
179
|
+
} }
|
|
180
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_24_Template(rf, ctx) { if (rf & 1) {
|
|
181
|
+
i0.ɵɵelementStart(0, "div", 53)(1, "label");
|
|
182
|
+
i0.ɵɵtext(2, "Artifact Description");
|
|
183
|
+
i0.ɵɵelementEnd();
|
|
184
|
+
i0.ɵɵelementStart(3, "span");
|
|
185
|
+
i0.ɵɵtext(4);
|
|
186
|
+
i0.ɵɵelementEnd()();
|
|
187
|
+
} if (rf & 2) {
|
|
188
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
189
|
+
i0.ɵɵadvance(4);
|
|
190
|
+
i0.ɵɵtextInterpolate(ctx_r0.artifact.Description);
|
|
191
|
+
} }
|
|
192
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_25_Template(rf, ctx) { if (rf & 1) {
|
|
193
|
+
i0.ɵɵelementStart(0, "div", 53)(1, "label");
|
|
194
|
+
i0.ɵɵtext(2, "Version Description");
|
|
195
|
+
i0.ɵɵelementEnd();
|
|
196
|
+
i0.ɵɵelementStart(3, "span");
|
|
197
|
+
i0.ɵɵtext(4);
|
|
198
|
+
i0.ɵɵelementEnd()();
|
|
199
|
+
} if (rf & 2) {
|
|
200
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
201
|
+
i0.ɵɵadvance(4);
|
|
202
|
+
i0.ɵɵtextInterpolate(ctx_r0.artifactVersion == null ? null : ctx_r0.artifactVersion.Description);
|
|
203
|
+
} }
|
|
204
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_26_For_5_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
205
|
+
i0.ɵɵelementStart(0, "span");
|
|
206
|
+
i0.ɵɵtext(1);
|
|
207
|
+
i0.ɵɵelementEnd();
|
|
208
|
+
} if (rf & 2) {
|
|
209
|
+
const attr_r11 = i0.ɵɵnextContext().$implicit;
|
|
210
|
+
i0.ɵɵadvance();
|
|
211
|
+
i0.ɵɵtextInterpolate(attr_r11.Value);
|
|
212
|
+
} }
|
|
213
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_26_For_5_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
214
|
+
i0.ɵɵelementStart(0, "span", 57);
|
|
215
|
+
i0.ɵɵtext(1, "Empty");
|
|
216
|
+
i0.ɵɵelementEnd();
|
|
217
|
+
} }
|
|
218
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_26_For_5_Template(rf, ctx) { if (rf & 1) {
|
|
219
|
+
i0.ɵɵelementStart(0, "div", 56)(1, "label");
|
|
220
|
+
i0.ɵɵtext(2);
|
|
221
|
+
i0.ɵɵelementEnd();
|
|
222
|
+
i0.ɵɵtemplate(3, ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_26_For_5_Conditional_3_Template, 2, 1, "span")(4, ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_26_For_5_Conditional_4_Template, 2, 0, "span", 57);
|
|
223
|
+
i0.ɵɵelementEnd();
|
|
224
|
+
} if (rf & 2) {
|
|
225
|
+
const attr_r11 = ctx.$implicit;
|
|
226
|
+
i0.ɵɵadvance(2);
|
|
227
|
+
i0.ɵɵtextInterpolate(attr_r11.Name);
|
|
228
|
+
i0.ɵɵadvance();
|
|
229
|
+
i0.ɵɵconditional(attr_r11.Value ? 3 : 4);
|
|
230
|
+
} }
|
|
231
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_26_Template(rf, ctx) { if (rf & 1) {
|
|
232
|
+
i0.ɵɵelementStart(0, "div", 54)(1, "h4");
|
|
233
|
+
i0.ɵɵtext(2, "Version Attributes");
|
|
234
|
+
i0.ɵɵelementEnd();
|
|
235
|
+
i0.ɵɵelementStart(3, "div", 55);
|
|
236
|
+
i0.ɵɵrepeaterCreate(4, ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_26_For_5_Template, 5, 2, "div", 56, _forTrack0);
|
|
237
|
+
i0.ɵɵelementEnd()();
|
|
238
|
+
} if (rf & 2) {
|
|
239
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
240
|
+
i0.ɵɵadvance(4);
|
|
241
|
+
i0.ɵɵrepeater(ctx_r0.filteredAttributes);
|
|
242
|
+
} }
|
|
243
|
+
function ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
244
|
+
i0.ɵɵelementStart(0, "div", 37)(1, "div", 51)(2, "div", 52)(3, "label");
|
|
245
|
+
i0.ɵɵtext(4, "Type");
|
|
246
|
+
i0.ɵɵelementEnd();
|
|
247
|
+
i0.ɵɵelementStart(5, "span");
|
|
248
|
+
i0.ɵɵtext(6);
|
|
249
|
+
i0.ɵɵelementEnd()();
|
|
250
|
+
i0.ɵɵelementStart(7, "div", 52)(8, "label");
|
|
251
|
+
i0.ɵɵtext(9, "Version");
|
|
252
|
+
i0.ɵɵelementEnd();
|
|
253
|
+
i0.ɵɵelementStart(10, "span");
|
|
254
|
+
i0.ɵɵtext(11);
|
|
255
|
+
i0.ɵɵelementEnd()();
|
|
256
|
+
i0.ɵɵelementStart(12, "div", 52)(13, "label");
|
|
257
|
+
i0.ɵɵtext(14, "Created");
|
|
258
|
+
i0.ɵɵelementEnd();
|
|
259
|
+
i0.ɵɵelementStart(15, "span");
|
|
260
|
+
i0.ɵɵtext(16);
|
|
261
|
+
i0.ɵɵpipe(17, "date");
|
|
262
|
+
i0.ɵɵelementEnd()();
|
|
263
|
+
i0.ɵɵelementStart(18, "div", 52)(19, "label");
|
|
264
|
+
i0.ɵɵtext(20, "Updated");
|
|
265
|
+
i0.ɵɵelementEnd();
|
|
266
|
+
i0.ɵɵelementStart(21, "span");
|
|
267
|
+
i0.ɵɵtext(22);
|
|
268
|
+
i0.ɵɵpipe(23, "date");
|
|
269
|
+
i0.ɵɵelementEnd()();
|
|
270
|
+
i0.ɵɵtemplate(24, ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_24_Template, 5, 1, "div", 53)(25, ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_25_Template, 5, 1, "div", 53);
|
|
271
|
+
i0.ɵɵelementEnd();
|
|
272
|
+
i0.ɵɵtemplate(26, ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Conditional_26_Template, 6, 0, "div", 54);
|
|
273
|
+
i0.ɵɵelementEnd();
|
|
274
|
+
} if (rf & 2) {
|
|
275
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
276
|
+
i0.ɵɵadvance(6);
|
|
277
|
+
i0.ɵɵtextInterpolate(ctx_r0.artifact.Type);
|
|
278
|
+
i0.ɵɵadvance(5);
|
|
279
|
+
i0.ɵɵtextInterpolate((ctx_r0.artifactVersion == null ? null : ctx_r0.artifactVersion.VersionNumber) || 1);
|
|
280
|
+
i0.ɵɵadvance(5);
|
|
281
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(17, 7, ctx_r0.artifact.__mj_CreatedAt, "short"));
|
|
282
|
+
i0.ɵɵadvance(6);
|
|
283
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(23, 10, ctx_r0.artifactVersion == null ? null : ctx_r0.artifactVersion.__mj_UpdatedAt, "short"));
|
|
284
|
+
i0.ɵɵadvance(2);
|
|
285
|
+
i0.ɵɵconditional(ctx_r0.artifact.Description ? 24 : -1);
|
|
286
|
+
i0.ɵɵadvance();
|
|
287
|
+
i0.ɵɵconditional((ctx_r0.artifactVersion == null ? null : ctx_r0.artifactVersion.Description) && ctx_r0.artifact.Description && (ctx_r0.artifactVersion == null ? null : ctx_r0.artifactVersion.Description) !== ctx_r0.artifact.Description ? 25 : -1);
|
|
288
|
+
i0.ɵɵadvance();
|
|
289
|
+
i0.ɵɵconditional(ctx_r0.filteredAttributes.length > 0 ? 26 : -1);
|
|
290
|
+
} }
|
|
291
|
+
function ArtifactViewerPanelComponent_Conditional_20_Template(rf, ctx) { if (rf & 1) {
|
|
292
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
293
|
+
i0.ɵɵelementStart(0, "div", 17)(1, "div", 30);
|
|
294
|
+
i0.ɵɵtemplate(2, ArtifactViewerPanelComponent_Conditional_20_Conditional_2_Template, 3, 2, "button", 31)(3, ArtifactViewerPanelComponent_Conditional_20_Conditional_3_Template, 3, 2, "button", 31);
|
|
295
|
+
i0.ɵɵelementStart(4, "button", 32);
|
|
296
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_20_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.setActiveTab("details")); });
|
|
297
|
+
i0.ɵɵelement(5, "i", 33);
|
|
298
|
+
i0.ɵɵtext(6, " Details ");
|
|
299
|
+
i0.ɵɵelementEnd()();
|
|
300
|
+
i0.ɵɵelementStart(7, "div", 34);
|
|
301
|
+
i0.ɵɵtemplate(8, ArtifactViewerPanelComponent_Conditional_20_Conditional_8_Template, 3, 1, "div", 35)(9, ArtifactViewerPanelComponent_Conditional_20_Conditional_9_Template, 7, 3, "div", 36)(10, ArtifactViewerPanelComponent_Conditional_20_Conditional_10_Template, 27, 13, "div", 37);
|
|
302
|
+
i0.ɵɵelementEnd()();
|
|
303
|
+
} if (rf & 2) {
|
|
304
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
305
|
+
i0.ɵɵadvance(2);
|
|
306
|
+
i0.ɵɵconditional(ctx_r0.hasDisplayTab ? 2 : -1);
|
|
307
|
+
i0.ɵɵadvance();
|
|
308
|
+
i0.ɵɵconditional(ctx_r0.hasJsonTab ? 3 : -1);
|
|
309
|
+
i0.ɵɵadvance();
|
|
310
|
+
i0.ɵɵclassProp("active", ctx_r0.activeTab === "details");
|
|
311
|
+
i0.ɵɵadvance(4);
|
|
312
|
+
i0.ɵɵconditional(ctx_r0.activeTab === "display" && ctx_r0.hasDisplayTab ? 8 : -1);
|
|
313
|
+
i0.ɵɵadvance();
|
|
314
|
+
i0.ɵɵconditional(ctx_r0.activeTab === "json" && ctx_r0.hasJsonTab ? 9 : -1);
|
|
315
|
+
i0.ɵɵadvance();
|
|
316
|
+
i0.ɵɵconditional(ctx_r0.activeTab === "details" ? 10 : -1);
|
|
317
|
+
} }
|
|
318
|
+
function ArtifactViewerPanelComponent_Conditional_21_For_16_Template(rf, ctx) { if (rf & 1) {
|
|
319
|
+
i0.ɵɵelementStart(0, "option", 66);
|
|
320
|
+
i0.ɵɵtext(1);
|
|
321
|
+
i0.ɵɵelementEnd();
|
|
322
|
+
} if (rf & 2) {
|
|
323
|
+
const collection_r13 = ctx.$implicit;
|
|
324
|
+
i0.ɵɵproperty("ngValue", collection_r13.ID);
|
|
325
|
+
i0.ɵɵadvance();
|
|
326
|
+
i0.ɵɵtextInterpolate(collection_r13.Name);
|
|
327
|
+
} }
|
|
328
|
+
function ArtifactViewerPanelComponent_Conditional_21_Conditional_26_Template(rf, ctx) { if (rf & 1) {
|
|
329
|
+
i0.ɵɵelement(0, "i", 28);
|
|
330
|
+
} }
|
|
331
|
+
function ArtifactViewerPanelComponent_Conditional_21_Conditional_27_Template(rf, ctx) { if (rf & 1) {
|
|
332
|
+
i0.ɵɵelement(0, "i", 71);
|
|
333
|
+
} }
|
|
334
|
+
function ArtifactViewerPanelComponent_Conditional_21_Conditional_33_Template(rf, ctx) { if (rf & 1) {
|
|
335
|
+
i0.ɵɵelement(0, "i", 28);
|
|
336
|
+
i0.ɵɵtext(1, " Saving... ");
|
|
337
|
+
} }
|
|
338
|
+
function ArtifactViewerPanelComponent_Conditional_21_Conditional_34_Template(rf, ctx) { if (rf & 1) {
|
|
339
|
+
i0.ɵɵelement(0, "i", 75);
|
|
340
|
+
i0.ɵɵtext(1, " Save to Collection ");
|
|
341
|
+
} }
|
|
342
|
+
function ArtifactViewerPanelComponent_Conditional_21_Template(rf, ctx) { if (rf & 1) {
|
|
343
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
344
|
+
i0.ɵɵelementStart(0, "div", 58);
|
|
345
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_21_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.cancelLibraryDialog()); });
|
|
346
|
+
i0.ɵɵelementStart(1, "div", 59);
|
|
347
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_21_Template_div_click_1_listener($event) { i0.ɵɵrestoreView(_r12); return i0.ɵɵresetView($event.stopPropagation()); });
|
|
348
|
+
i0.ɵɵelementStart(2, "div", 60)(3, "h3");
|
|
349
|
+
i0.ɵɵelement(4, "i", 61);
|
|
350
|
+
i0.ɵɵtext(5, " Save to Collection ");
|
|
351
|
+
i0.ɵɵelementEnd();
|
|
352
|
+
i0.ɵɵelementStart(6, "button", 62);
|
|
353
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_21_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.cancelLibraryDialog()); });
|
|
354
|
+
i0.ɵɵelement(7, "i", 13);
|
|
355
|
+
i0.ɵɵelementEnd()();
|
|
356
|
+
i0.ɵɵelementStart(8, "div", 63)(9, "div", 64)(10, "label");
|
|
357
|
+
i0.ɵɵtext(11, "Select Collection");
|
|
358
|
+
i0.ɵɵelementEnd();
|
|
359
|
+
i0.ɵɵelementStart(12, "select", 65);
|
|
360
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ArtifactViewerPanelComponent_Conditional_21_Template_select_ngModelChange_12_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.selectedCollectionId, $event) || (ctx_r0.selectedCollectionId = $event); return i0.ɵɵresetView($event); });
|
|
361
|
+
i0.ɵɵelementStart(13, "option", 66);
|
|
362
|
+
i0.ɵɵtext(14, "-- Choose a collection --");
|
|
363
|
+
i0.ɵɵelementEnd();
|
|
364
|
+
i0.ɵɵrepeaterCreate(15, ArtifactViewerPanelComponent_Conditional_21_For_16_Template, 2, 2, "option", 66, _forTrack0);
|
|
365
|
+
i0.ɵɵelementEnd()();
|
|
366
|
+
i0.ɵɵelementStart(17, "div", 67)(18, "span");
|
|
367
|
+
i0.ɵɵtext(19, "OR");
|
|
368
|
+
i0.ɵɵelementEnd()();
|
|
369
|
+
i0.ɵɵelementStart(20, "div", 64)(21, "label");
|
|
370
|
+
i0.ɵɵtext(22, "Create New Collection");
|
|
371
|
+
i0.ɵɵelementEnd();
|
|
372
|
+
i0.ɵɵelementStart(23, "div", 68)(24, "input", 69);
|
|
373
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ArtifactViewerPanelComponent_Conditional_21_Template_input_ngModelChange_24_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.newCollectionName, $event) || (ctx_r0.newCollectionName = $event); return i0.ɵɵresetView($event); });
|
|
374
|
+
i0.ɵɵlistener("keyup.enter", function ArtifactViewerPanelComponent_Conditional_21_Template_input_keyup_enter_24_listener() { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.createNewCollection()); });
|
|
375
|
+
i0.ɵɵelementEnd();
|
|
376
|
+
i0.ɵɵelementStart(25, "button", 70);
|
|
377
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_21_Template_button_click_25_listener() { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.createNewCollection()); });
|
|
378
|
+
i0.ɵɵtemplate(26, ArtifactViewerPanelComponent_Conditional_21_Conditional_26_Template, 1, 0, "i", 28)(27, ArtifactViewerPanelComponent_Conditional_21_Conditional_27_Template, 1, 0, "i", 71);
|
|
379
|
+
i0.ɵɵtext(28, " Create ");
|
|
380
|
+
i0.ɵɵelementEnd()()()();
|
|
381
|
+
i0.ɵɵelementStart(29, "div", 72)(30, "button", 73);
|
|
382
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_21_Template_button_click_30_listener() { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.cancelLibraryDialog()); });
|
|
383
|
+
i0.ɵɵtext(31, " Cancel ");
|
|
384
|
+
i0.ɵɵelementEnd();
|
|
385
|
+
i0.ɵɵelementStart(32, "button", 74);
|
|
386
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Conditional_21_Template_button_click_32_listener() { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.saveToSelectedCollection()); });
|
|
387
|
+
i0.ɵɵtemplate(33, ArtifactViewerPanelComponent_Conditional_21_Conditional_33_Template, 2, 0)(34, ArtifactViewerPanelComponent_Conditional_21_Conditional_34_Template, 2, 0);
|
|
388
|
+
i0.ɵɵelementEnd()()()();
|
|
389
|
+
} if (rf & 2) {
|
|
390
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
391
|
+
i0.ɵɵadvance(12);
|
|
392
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.selectedCollectionId);
|
|
393
|
+
i0.ɵɵadvance();
|
|
394
|
+
i0.ɵɵproperty("ngValue", null);
|
|
395
|
+
i0.ɵɵadvance(2);
|
|
396
|
+
i0.ɵɵrepeater(ctx_r0.collections);
|
|
397
|
+
i0.ɵɵadvance(9);
|
|
398
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.newCollectionName);
|
|
399
|
+
i0.ɵɵadvance();
|
|
400
|
+
i0.ɵɵproperty("disabled", ctx_r0.isCreatingCollection || !ctx_r0.newCollectionName.trim());
|
|
401
|
+
i0.ɵɵadvance();
|
|
402
|
+
i0.ɵɵconditional(ctx_r0.isCreatingCollection ? 26 : 27);
|
|
403
|
+
i0.ɵɵadvance(6);
|
|
404
|
+
i0.ɵɵproperty("disabled", !ctx_r0.selectedCollectionId || ctx_r0.isSavingToLibrary);
|
|
405
|
+
i0.ɵɵadvance();
|
|
406
|
+
i0.ɵɵconditional(ctx_r0.isSavingToLibrary ? 33 : 34);
|
|
407
|
+
} }
|
|
408
|
+
export class ArtifactViewerPanelComponent {
|
|
409
|
+
artifactId;
|
|
410
|
+
currentUser;
|
|
411
|
+
environmentId;
|
|
412
|
+
versionNumber; // Version to display
|
|
413
|
+
showSaveToCollection = true; // Control whether Save to Collection button is shown
|
|
414
|
+
refreshTrigger;
|
|
415
|
+
closed = new EventEmitter();
|
|
416
|
+
pluginViewer;
|
|
417
|
+
destroy$ = new Subject();
|
|
418
|
+
artifact = null;
|
|
419
|
+
artifactVersion = null;
|
|
420
|
+
allVersions = [];
|
|
421
|
+
selectedVersionNumber = 1;
|
|
422
|
+
isLoading = true;
|
|
423
|
+
error = null;
|
|
424
|
+
jsonContent = '';
|
|
425
|
+
showVersionDropdown = false;
|
|
426
|
+
showLibraryDialog = false;
|
|
427
|
+
collections = [];
|
|
428
|
+
selectedCollectionId = null;
|
|
429
|
+
newCollectionName = '';
|
|
430
|
+
isCreatingCollection = false;
|
|
431
|
+
isSavingToLibrary = false;
|
|
432
|
+
artifactCollections = [];
|
|
433
|
+
primaryCollection = null;
|
|
434
|
+
// Tabbed interface
|
|
435
|
+
activeTab = 'display';
|
|
436
|
+
displayMarkdown = null;
|
|
437
|
+
displayHtml = null;
|
|
438
|
+
versionAttributes = [];
|
|
439
|
+
artifactTypeDriverClass = null;
|
|
440
|
+
// Cache plugin state to avoid losing it when switching tabs
|
|
441
|
+
cachedPluginShouldShowRaw = false;
|
|
442
|
+
cachedPluginIsElevated = false;
|
|
443
|
+
async ngOnInit() {
|
|
444
|
+
// Subscribe to refresh trigger for dynamic version changes
|
|
445
|
+
if (this.refreshTrigger) {
|
|
446
|
+
this.refreshTrigger.pipe(takeUntil(this.destroy$)).subscribe(async (data) => {
|
|
447
|
+
if (data.artifactId === this.artifactId) {
|
|
448
|
+
console.log(`📦 Refreshing artifact viewer to version ${data.versionNumber}`);
|
|
449
|
+
// Reload all versions to get any new ones
|
|
450
|
+
await this.loadArtifact(data.versionNumber);
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
// Load artifact with specified version if provided
|
|
455
|
+
await this.loadArtifact(this.versionNumber);
|
|
456
|
+
}
|
|
457
|
+
async ngOnChanges(changes) {
|
|
458
|
+
// Reload artifact when artifactId changes
|
|
459
|
+
if (changes['artifactId'] && !changes['artifactId'].firstChange) {
|
|
460
|
+
await this.loadArtifact(this.versionNumber);
|
|
461
|
+
}
|
|
462
|
+
// Switch to new version when versionNumber changes (but artifactId stays the same)
|
|
463
|
+
if (changes['versionNumber'] && !changes['versionNumber'].firstChange) {
|
|
464
|
+
const newVersionNumber = changes['versionNumber'].currentValue;
|
|
465
|
+
if (newVersionNumber != null) {
|
|
466
|
+
console.log(`📦 Version number changed to ${newVersionNumber}, switching version`);
|
|
467
|
+
// Check if we already have this version loaded (avoid reload if possible)
|
|
468
|
+
const targetVersion = this.allVersions.find(v => v.VersionNumber === newVersionNumber);
|
|
469
|
+
if (targetVersion) {
|
|
470
|
+
// Just switch to the version we already have
|
|
471
|
+
this.artifactVersion = targetVersion;
|
|
472
|
+
this.selectedVersionNumber = targetVersion.VersionNumber || 1;
|
|
473
|
+
this.jsonContent = targetVersion.Content || '{}';
|
|
474
|
+
console.log(`📦 Switched to cached version ${this.selectedVersionNumber}`);
|
|
475
|
+
// Load version attributes
|
|
476
|
+
await this.loadVersionAttributes();
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
// Need to reload to get this version (shouldn't normally happen)
|
|
480
|
+
await this.loadArtifact(newVersionNumber);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
ngOnDestroy() {
|
|
486
|
+
this.destroy$.next();
|
|
487
|
+
this.destroy$.complete();
|
|
488
|
+
}
|
|
489
|
+
async loadArtifact(targetVersionNumber) {
|
|
490
|
+
try {
|
|
491
|
+
this.isLoading = true;
|
|
492
|
+
this.error = null;
|
|
493
|
+
// Reset cached plugin state when loading new artifact
|
|
494
|
+
this.cachedPluginShouldShowRaw = false;
|
|
495
|
+
this.cachedPluginIsElevated = false;
|
|
496
|
+
const md = new Metadata();
|
|
497
|
+
// Load artifact
|
|
498
|
+
this.artifact = await md.GetEntityObject('MJ: Artifacts', this.currentUser);
|
|
499
|
+
const loaded = await this.artifact.Load(this.artifactId);
|
|
500
|
+
if (!loaded) {
|
|
501
|
+
this.error = 'Failed to load artifact';
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
// Load artifact type to check for DriverClass
|
|
505
|
+
await this.loadArtifactType();
|
|
506
|
+
// Load ALL versions
|
|
507
|
+
const rv = new RunView();
|
|
508
|
+
const result = await rv.RunView({
|
|
509
|
+
EntityName: 'MJ: Artifact Versions',
|
|
510
|
+
ExtraFilter: `ArtifactID='${this.artifactId}'`,
|
|
511
|
+
OrderBy: 'VersionNumber DESC',
|
|
512
|
+
ResultType: 'entity_object'
|
|
513
|
+
}, this.currentUser);
|
|
514
|
+
if (result.Success && result.Results && result.Results.length > 0) {
|
|
515
|
+
this.allVersions = result.Results;
|
|
516
|
+
// If target version specified, try to load it
|
|
517
|
+
if (targetVersionNumber) {
|
|
518
|
+
const targetVersion = this.allVersions.find(v => v.VersionNumber === targetVersionNumber);
|
|
519
|
+
if (targetVersion) {
|
|
520
|
+
console.log(`📦 Loading specified version ${targetVersionNumber}`);
|
|
521
|
+
this.artifactVersion = targetVersion;
|
|
522
|
+
this.selectedVersionNumber = targetVersion.VersionNumber || 1;
|
|
523
|
+
this.jsonContent = targetVersion.Content || '{}';
|
|
524
|
+
}
|
|
525
|
+
else {
|
|
526
|
+
console.warn(`📦 Version ${targetVersionNumber} not found, defaulting to latest`);
|
|
527
|
+
// Target version not found, default to latest
|
|
528
|
+
this.artifactVersion = result.Results[0];
|
|
529
|
+
this.selectedVersionNumber = this.artifactVersion.VersionNumber || 1;
|
|
530
|
+
this.jsonContent = this.artifactVersion.Content || '{}';
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
// No target version, default to latest version (first in DESC order)
|
|
535
|
+
this.artifactVersion = result.Results[0];
|
|
536
|
+
this.selectedVersionNumber = this.artifactVersion.VersionNumber || 1;
|
|
537
|
+
this.jsonContent = this.artifactVersion.Content || '{}';
|
|
538
|
+
}
|
|
539
|
+
// Load version attributes
|
|
540
|
+
await this.loadVersionAttributes();
|
|
541
|
+
// Load collection associations
|
|
542
|
+
await this.loadCollectionAssociations();
|
|
543
|
+
console.log(`📦 Loaded ${this.allVersions.length} versions for artifact ${this.artifactId}, showing v${this.selectedVersionNumber}`);
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
this.error = 'No artifact version found';
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
catch (err) {
|
|
550
|
+
console.error('Error loading artifact:', err);
|
|
551
|
+
this.error = 'Error loading artifact: ' + err.message;
|
|
552
|
+
}
|
|
553
|
+
finally {
|
|
554
|
+
this.isLoading = false;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
async loadArtifactType() {
|
|
558
|
+
if (!this.artifact?.Type) {
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
try {
|
|
562
|
+
await ArtifactMetadataEngine.Instance.Config(false, this.currentUser);
|
|
563
|
+
const artifactType = ArtifactMetadataEngine.Instance.FindArtifactType(this.artifact.Type);
|
|
564
|
+
if (artifactType) {
|
|
565
|
+
this.artifactTypeDriverClass = artifactType.DriverClass;
|
|
566
|
+
console.log(`📦 Loaded artifact type "${this.artifact.Type}", DriverClass: ${this.artifactTypeDriverClass || 'none'}`);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
catch (err) {
|
|
570
|
+
console.error('Error loading artifact type:', err);
|
|
571
|
+
// Don't fail the whole load if we can't get the artifact type
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
async loadVersionAttributes() {
|
|
575
|
+
if (!this.artifactVersion)
|
|
576
|
+
return;
|
|
577
|
+
try {
|
|
578
|
+
const rv = new RunView();
|
|
579
|
+
const result = await rv.RunView({
|
|
580
|
+
EntityName: 'MJ: Artifact Version Attributes',
|
|
581
|
+
ExtraFilter: `ArtifactVersionID='${this.artifactVersion.ID}'`,
|
|
582
|
+
ResultType: 'entity_object'
|
|
583
|
+
}, this.currentUser);
|
|
584
|
+
if (result.Success && result.Results) {
|
|
585
|
+
this.versionAttributes = result.Results;
|
|
586
|
+
// Check for displayMarkdown or displayHtml attributes
|
|
587
|
+
const displayMarkdownAttr = this.versionAttributes.find(a => a.Name?.toLowerCase() === 'displaymarkdown');
|
|
588
|
+
const displayHtmlAttr = this.versionAttributes.find(a => a.Name?.toLowerCase() === 'displayhtml');
|
|
589
|
+
// Parse values - they might be JSON-encoded strings
|
|
590
|
+
this.displayMarkdown = this.parseAttributeValue(displayMarkdownAttr?.Value);
|
|
591
|
+
this.displayHtml = this.parseAttributeValue(displayHtmlAttr?.Value);
|
|
592
|
+
// Default to display tab if we have a plugin or extracted display content
|
|
593
|
+
// Otherwise default to JSON tab for JSON types, or Details tab as last resort
|
|
594
|
+
if (this.hasDisplayTab) {
|
|
595
|
+
this.activeTab = 'display';
|
|
596
|
+
}
|
|
597
|
+
else if (this.jsonContent) {
|
|
598
|
+
this.activeTab = 'json';
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
this.activeTab = 'details';
|
|
602
|
+
}
|
|
603
|
+
console.log(`📦 Loaded ${this.versionAttributes.length} attributes, displayMarkdown=${!!this.displayMarkdown}, displayHtml=${!!this.displayHtml}, hasDisplayTab=${this.hasDisplayTab}, activeTab=${this.activeTab}`);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
catch (err) {
|
|
607
|
+
console.error('Error loading version attributes:', err);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
get displayName() {
|
|
611
|
+
if (this.artifactVersion?.Name) {
|
|
612
|
+
return this.artifactVersion.Name;
|
|
613
|
+
}
|
|
614
|
+
return this.artifact?.Name || 'Artifact';
|
|
615
|
+
}
|
|
616
|
+
get displayDescription() {
|
|
617
|
+
if (this.artifactVersion?.Description) {
|
|
618
|
+
return this.artifactVersion.Description;
|
|
619
|
+
}
|
|
620
|
+
return this.artifact?.Description || null;
|
|
621
|
+
}
|
|
622
|
+
get hasDisplayTab() {
|
|
623
|
+
// Show Display tab if:
|
|
624
|
+
// 1. We have a plugin for this artifact type (check if artifact type exists), OR
|
|
625
|
+
// 2. We have displayMarkdown or displayHtml attributes from extract rules
|
|
626
|
+
return this.hasPlugin || !!this.displayMarkdown || !!this.displayHtml;
|
|
627
|
+
}
|
|
628
|
+
get hasPlugin() {
|
|
629
|
+
// Check if the artifact type has a DriverClass configured
|
|
630
|
+
// If DriverClass is set, we have a plugin available
|
|
631
|
+
return !!this.artifactTypeDriverClass;
|
|
632
|
+
}
|
|
633
|
+
get hasJsonTab() {
|
|
634
|
+
// Try to get fresh plugin state if plugin viewer is available
|
|
635
|
+
const pluginInstance = this.pluginViewer?.pluginInstance;
|
|
636
|
+
if (pluginInstance) {
|
|
637
|
+
// Update cache with current values
|
|
638
|
+
this.cachedPluginShouldShowRaw = pluginInstance.parentShouldShowRawContent;
|
|
639
|
+
this.cachedPluginIsElevated = pluginInstance.isShowingElevatedDisplay;
|
|
640
|
+
}
|
|
641
|
+
// Use cached value (or current value if plugin is available)
|
|
642
|
+
// This ensures the JSON tab doesn't disappear when switching to it
|
|
643
|
+
return this.cachedPluginShouldShowRaw;
|
|
644
|
+
}
|
|
645
|
+
get artifactTypeName() {
|
|
646
|
+
return this.artifact?.Type || '';
|
|
647
|
+
}
|
|
648
|
+
get contentType() {
|
|
649
|
+
// Try to get content type from artifact type or attributes
|
|
650
|
+
const contentTypeAttr = this.versionAttributes.find(a => a.Name?.toLowerCase() === 'contenttype');
|
|
651
|
+
return contentTypeAttr?.Value || undefined;
|
|
652
|
+
}
|
|
653
|
+
get filteredAttributes() {
|
|
654
|
+
// Filter out displayMarkdown and displayHtml as they're shown in the Display tab
|
|
655
|
+
return this.versionAttributes.filter(attr => {
|
|
656
|
+
const name = attr.Name?.toLowerCase();
|
|
657
|
+
return name !== 'displaymarkdown' && name !== 'displayhtml';
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
setActiveTab(tab) {
|
|
661
|
+
this.activeTab = tab;
|
|
662
|
+
}
|
|
663
|
+
parseAttributeValue(value) {
|
|
664
|
+
if (!value)
|
|
665
|
+
return null;
|
|
666
|
+
// Check if it's a JSON-encoded string (starts and ends with quotes)
|
|
667
|
+
if (value.startsWith('"') && value.endsWith('"')) {
|
|
668
|
+
try {
|
|
669
|
+
return JSON.parse(value);
|
|
670
|
+
}
|
|
671
|
+
catch (e) {
|
|
672
|
+
console.warn('Failed to parse attribute value as JSON:', e);
|
|
673
|
+
return value;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return value;
|
|
677
|
+
}
|
|
678
|
+
async loadCollectionAssociations() {
|
|
679
|
+
if (!this.artifactId)
|
|
680
|
+
return;
|
|
681
|
+
try {
|
|
682
|
+
const rv = new RunView();
|
|
683
|
+
const result = await rv.RunView({
|
|
684
|
+
EntityName: 'MJ: Collection Artifacts',
|
|
685
|
+
ExtraFilter: `ArtifactID='${this.artifactId}'`,
|
|
686
|
+
ResultType: 'entity_object'
|
|
687
|
+
}, this.currentUser);
|
|
688
|
+
if (result.Success && result.Results) {
|
|
689
|
+
this.artifactCollections = result.Results;
|
|
690
|
+
// Load the primary collection details if exists
|
|
691
|
+
if (this.artifactCollections.length > 0) {
|
|
692
|
+
const collectionId = this.artifactCollections[0].CollectionID;
|
|
693
|
+
const md = new Metadata();
|
|
694
|
+
this.primaryCollection = await md.GetEntityObject('MJ: Collections', this.currentUser);
|
|
695
|
+
await this.primaryCollection.Load(collectionId);
|
|
696
|
+
console.log(`📦 Artifact is in ${this.artifactCollections.length} collection(s)`);
|
|
697
|
+
}
|
|
698
|
+
else {
|
|
699
|
+
this.primaryCollection = null;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
catch (err) {
|
|
704
|
+
console.error('Error loading collection associations:', err);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
get isInCollection() {
|
|
708
|
+
return this.artifactCollections.length > 0;
|
|
709
|
+
}
|
|
710
|
+
onCopyToClipboard() {
|
|
711
|
+
if (this.jsonContent) {
|
|
712
|
+
navigator.clipboard.writeText(this.jsonContent);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
onCopyDisplayContent() {
|
|
716
|
+
const content = this.displayMarkdown || this.displayHtml;
|
|
717
|
+
if (content) {
|
|
718
|
+
navigator.clipboard.writeText(content).then(() => {
|
|
719
|
+
console.log('✅ Copied display content to clipboard');
|
|
720
|
+
}).catch(err => {
|
|
721
|
+
console.error('Failed to copy to clipboard:', err);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
toggleVersionDropdown() {
|
|
726
|
+
if (this.allVersions.length > 1) {
|
|
727
|
+
this.showVersionDropdown = !this.showVersionDropdown;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
async selectVersion(version) {
|
|
731
|
+
this.artifactVersion = version;
|
|
732
|
+
this.selectedVersionNumber = version.VersionNumber || 1;
|
|
733
|
+
this.jsonContent = version.Content || '{}';
|
|
734
|
+
this.showVersionDropdown = false;
|
|
735
|
+
// Load attributes for the selected version
|
|
736
|
+
await this.loadVersionAttributes();
|
|
737
|
+
console.log(`📦 Switched to version ${this.selectedVersionNumber}`);
|
|
738
|
+
}
|
|
739
|
+
async onSaveToLibrary() {
|
|
740
|
+
// If already in a collection, navigate to that collection
|
|
741
|
+
if (this.isInCollection && this.primaryCollection) {
|
|
742
|
+
// TODO: Implement navigation to collection view
|
|
743
|
+
// For now, just log - will need ConversationStateService or similar to navigate
|
|
744
|
+
console.log('Navigate to collection:', this.primaryCollection.Name, this.primaryCollection.ID);
|
|
745
|
+
MJNotificationService.Instance.CreateSimpleNotification(`This artifact is saved in collection: ${this.primaryCollection.Name}`, 'info', 3000);
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
// If not in a collection, show the save dialog
|
|
749
|
+
try {
|
|
750
|
+
// Load user's collections
|
|
751
|
+
const rv = new RunView();
|
|
752
|
+
const result = await rv.RunView({
|
|
753
|
+
EntityName: 'MJ: Collections',
|
|
754
|
+
ExtraFilter: `EnvironmentID='${this.environmentId}'`,
|
|
755
|
+
OrderBy: 'Name',
|
|
756
|
+
ResultType: 'entity_object'
|
|
757
|
+
}, this.currentUser);
|
|
758
|
+
if (result.Success) {
|
|
759
|
+
this.collections = result.Results || [];
|
|
760
|
+
this.showLibraryDialog = true;
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
console.error('Failed to load collections:', result.ErrorMessage);
|
|
764
|
+
MJNotificationService.Instance.CreateSimpleNotification('Failed to load collections. Please try again.', 'error');
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
catch (err) {
|
|
768
|
+
console.error('Error loading collections:', err);
|
|
769
|
+
MJNotificationService.Instance.CreateSimpleNotification('Error loading collections. Please try again.', 'error');
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
async createNewCollection() {
|
|
773
|
+
if (!this.newCollectionName.trim()) {
|
|
774
|
+
MJNotificationService.Instance.CreateSimpleNotification('Please enter a collection name', 'warning', 2000);
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
try {
|
|
778
|
+
this.isCreatingCollection = true;
|
|
779
|
+
const md = new Metadata();
|
|
780
|
+
const collection = await md.GetEntityObject('MJ: Collections', this.currentUser);
|
|
781
|
+
collection.EnvironmentID = this.environmentId;
|
|
782
|
+
collection.Name = this.newCollectionName.trim();
|
|
783
|
+
collection.Description = 'Created from conversation';
|
|
784
|
+
const saved = await collection.Save();
|
|
785
|
+
if (saved) {
|
|
786
|
+
this.collections.push(collection);
|
|
787
|
+
this.selectedCollectionId = collection.ID;
|
|
788
|
+
this.newCollectionName = '';
|
|
789
|
+
console.log('✅ Created new collection:', collection.Name);
|
|
790
|
+
MJNotificationService.Instance.CreateSimpleNotification(`Collection "${collection.Name}" created successfully!`, 'success', 3000);
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
MJNotificationService.Instance.CreateSimpleNotification('Failed to create collection. Please try again.', 'error');
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
catch (err) {
|
|
797
|
+
console.error('Error creating collection:', err);
|
|
798
|
+
LogError(err);
|
|
799
|
+
MJNotificationService.Instance.CreateSimpleNotification('Error creating collection. Please try again.', 'error');
|
|
800
|
+
}
|
|
801
|
+
finally {
|
|
802
|
+
this.isCreatingCollection = false;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
async saveToSelectedCollection() {
|
|
806
|
+
if (!this.selectedCollectionId) {
|
|
807
|
+
MJNotificationService.Instance.CreateSimpleNotification('Please select a collection', 'warning', 2000);
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
if (!this.artifactId) {
|
|
811
|
+
MJNotificationService.Instance.CreateSimpleNotification('No artifact to save', 'error');
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
try {
|
|
815
|
+
this.isSavingToLibrary = true;
|
|
816
|
+
// Check if artifact already exists in this collection
|
|
817
|
+
const rv = new RunView();
|
|
818
|
+
const existingResult = await rv.RunView({
|
|
819
|
+
EntityName: 'MJ: Collection Artifacts',
|
|
820
|
+
ExtraFilter: `CollectionID='${this.selectedCollectionId}' AND ArtifactID='${this.artifactId}'`,
|
|
821
|
+
ResultType: 'entity_object'
|
|
822
|
+
}, this.currentUser);
|
|
823
|
+
if (existingResult.Success && existingResult.Results && existingResult.Results.length > 0) {
|
|
824
|
+
MJNotificationService.Instance.CreateSimpleNotification('This artifact is already in the selected collection', 'info', 3000);
|
|
825
|
+
this.showLibraryDialog = false;
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
// Create junction record
|
|
829
|
+
const md = new Metadata();
|
|
830
|
+
const collectionArtifact = await md.GetEntityObject('MJ: Collection Artifacts', this.currentUser);
|
|
831
|
+
collectionArtifact.CollectionID = this.selectedCollectionId;
|
|
832
|
+
collectionArtifact.ArtifactID = this.artifactId;
|
|
833
|
+
collectionArtifact.Sequence = 0; // Could calculate max sequence + 1 if needed
|
|
834
|
+
const saved = await collectionArtifact.Save();
|
|
835
|
+
if (saved) {
|
|
836
|
+
const collectionName = this.collections.find(c => c.ID === this.selectedCollectionId)?.Name || 'collection';
|
|
837
|
+
console.log(`✅ Saved artifact to ${collectionName}`);
|
|
838
|
+
MJNotificationService.Instance.CreateSimpleNotification(`Artifact saved to ${collectionName} successfully!`, 'success', 3000);
|
|
839
|
+
this.showLibraryDialog = false;
|
|
840
|
+
this.selectedCollectionId = null;
|
|
841
|
+
// Reload collection associations to update the bookmark icon state
|
|
842
|
+
await this.loadCollectionAssociations();
|
|
843
|
+
}
|
|
844
|
+
else {
|
|
845
|
+
MJNotificationService.Instance.CreateSimpleNotification('Failed to save artifact to collection. Please try again.', 'error');
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
catch (err) {
|
|
849
|
+
console.error('Error saving to collection:', err);
|
|
850
|
+
LogError(err);
|
|
851
|
+
MJNotificationService.Instance.CreateSimpleNotification('Error saving artifact to collection. Please try again.', 'error');
|
|
852
|
+
}
|
|
853
|
+
finally {
|
|
854
|
+
this.isSavingToLibrary = false;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
cancelLibraryDialog() {
|
|
858
|
+
this.showLibraryDialog = false;
|
|
859
|
+
this.selectedCollectionId = null;
|
|
860
|
+
this.newCollectionName = '';
|
|
861
|
+
}
|
|
862
|
+
onClose() {
|
|
863
|
+
this.closed.emit();
|
|
864
|
+
}
|
|
865
|
+
static ɵfac = function ArtifactViewerPanelComponent_Factory(t) { return new (t || ArtifactViewerPanelComponent)(); };
|
|
866
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArtifactViewerPanelComponent, selectors: [["mj-artifact-viewer-panel"]], viewQuery: function ArtifactViewerPanelComponent_Query(rf, ctx) { if (rf & 1) {
|
|
867
|
+
i0.ɵɵviewQuery(ArtifactTypePluginViewerComponent, 5);
|
|
868
|
+
} if (rf & 2) {
|
|
869
|
+
let _t;
|
|
870
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.pluginViewer = _t.first);
|
|
871
|
+
} }, inputs: { artifactId: "artifactId", currentUser: "currentUser", environmentId: "environmentId", versionNumber: "versionNumber", showSaveToCollection: "showSaveToCollection", refreshTrigger: "refreshTrigger" }, outputs: { closed: "closed" }, features: [i0.ɵɵNgOnChangesFeature], decls: 22, vars: 12, consts: [[1, "artifact-viewer-panel"], [1, "panel-header"], [1, "panel-header-left"], [1, "fas", "fa-cube"], [1, "header-description"], [1, "panel-header-right"], [1, "version-selector", 3, "click"], [1, "fas", "fa-history"], [1, "version-label"], [1, "fas", "fa-chevron-down", "dropdown-icon", 3, "open"], [1, "version-dropdown"], [1, "save-to-collection-btn", 3, "in-collection", "title"], ["title", "Close", 1, "close-btn", 3, "click"], [1, "fas", "fa-times"], [1, "panel-content"], [1, "loading-state"], [1, "error-state"], [1, "artifact-content-wrapper"], [1, "modal-overlay"], [1, "fas", "fa-chevron-down", "dropdown-icon"], [1, "version-dropdown", 3, "click"], [1, "version-option", 3, "selected"], [1, "version-option", 3, "click"], [1, "version-number"], [1, "version-date"], [1, "fas", "fa-check"], [1, "save-to-collection-btn", 3, "click", "title"], [3, "ngClass"], [1, "fas", "fa-spinner", "fa-spin"], [1, "fas", "fa-exclamation-triangle"], [1, "tab-navigation"], [1, "tab-btn", 3, "active"], [1, "tab-btn", 3, "click"], [1, "fas", "fa-info-circle"], [1, "tab-content"], [1, "display-content"], [1, "json-viewer"], [1, "details-content"], [1, "fas", "fa-eye"], [1, "fas", "fa-code"], [3, "artifactVersion", "artifactTypeName", "contentType", "readonly"], [1, "display-toolbar"], ["title", "Copy Content", 1, "btn-icon", 3, "click"], [1, "fas", "fa-copy"], [1, "markdown-content"], [1, "html-content", 3, "innerHTML"], [3, "data"], [1, "json-toolbar"], ["title", "Copy JSON", 1, "btn-icon", 3, "click"], [1, "json-editor-container"], [2, "width", "100%", "height", "100%", 3, "ngModelChange", "ngModel", "language", "readonly"], [1, "artifact-meta"], [1, "meta-item"], [1, "meta-item", "full-width"], [1, "attributes-section"], [1, "attributes-list"], [1, "attribute-item"], [1, "attribute-empty-pill"], [1, "modal-overlay", 3, "click"], [1, "modal-content", "library-modal", 3, "click"], [1, "modal-header"], [1, "fas", "fa-bookmark"], [1, "close-btn", 3, "click"], [1, "modal-body"], [1, "form-section"], [1, "form-select", 3, "ngModelChange", "ngModel"], [3, "ngValue"], [1, "divider"], [1, "create-collection-row"], ["type", "text", "placeholder", "Enter collection name", 1, "form-input", 3, "ngModelChange", "keyup.enter", "ngModel"], [1, "btn", "btn-secondary", 3, "click", "disabled"], [1, "fas", "fa-plus"], [1, "modal-footer"], [1, "btn", "btn-secondary", 3, "click"], [1, "btn", "btn-primary", 3, "click", "disabled"], [1, "fas", "fa-save"]], template: function ArtifactViewerPanelComponent_Template(rf, ctx) { if (rf & 1) {
|
|
872
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "h3");
|
|
873
|
+
i0.ɵɵelement(4, "i", 3);
|
|
874
|
+
i0.ɵɵtext(5);
|
|
875
|
+
i0.ɵɵelementEnd();
|
|
876
|
+
i0.ɵɵtemplate(6, ArtifactViewerPanelComponent_Conditional_6_Template, 2, 1, "p", 4);
|
|
877
|
+
i0.ɵɵelementEnd();
|
|
878
|
+
i0.ɵɵelementStart(7, "div", 5)(8, "div", 6);
|
|
879
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Template_div_click_8_listener() { return ctx.toggleVersionDropdown(); });
|
|
880
|
+
i0.ɵɵelement(9, "i", 7);
|
|
881
|
+
i0.ɵɵelementStart(10, "span", 8);
|
|
882
|
+
i0.ɵɵtext(11);
|
|
883
|
+
i0.ɵɵelementEnd();
|
|
884
|
+
i0.ɵɵtemplate(12, ArtifactViewerPanelComponent_Conditional_12_Template, 1, 2, "i", 9)(13, ArtifactViewerPanelComponent_Conditional_13_Template, 3, 0, "div", 10);
|
|
885
|
+
i0.ɵɵelementEnd();
|
|
886
|
+
i0.ɵɵtemplate(14, ArtifactViewerPanelComponent_Conditional_14_Template, 2, 4, "button", 11);
|
|
887
|
+
i0.ɵɵelementStart(15, "button", 12);
|
|
888
|
+
i0.ɵɵlistener("click", function ArtifactViewerPanelComponent_Template_button_click_15_listener() { return ctx.onClose(); });
|
|
889
|
+
i0.ɵɵelement(16, "i", 13);
|
|
890
|
+
i0.ɵɵelementEnd()()();
|
|
891
|
+
i0.ɵɵelementStart(17, "div", 14);
|
|
892
|
+
i0.ɵɵtemplate(18, ArtifactViewerPanelComponent_Conditional_18_Template, 4, 0, "div", 15)(19, ArtifactViewerPanelComponent_Conditional_19_Template, 4, 1, "div", 16)(20, ArtifactViewerPanelComponent_Conditional_20_Template, 11, 7, "div", 17);
|
|
893
|
+
i0.ɵɵelementEnd()();
|
|
894
|
+
i0.ɵɵtemplate(21, ArtifactViewerPanelComponent_Conditional_21_Template, 35, 7, "div", 18);
|
|
895
|
+
} if (rf & 2) {
|
|
896
|
+
i0.ɵɵadvance(5);
|
|
897
|
+
i0.ɵɵtextInterpolate1(" ", ctx.displayName, " ");
|
|
898
|
+
i0.ɵɵadvance();
|
|
899
|
+
i0.ɵɵconditional(ctx.displayDescription ? 6 : -1);
|
|
900
|
+
i0.ɵɵadvance(2);
|
|
901
|
+
i0.ɵɵclassProp("clickable", ctx.allVersions.length > 1);
|
|
902
|
+
i0.ɵɵadvance(3);
|
|
903
|
+
i0.ɵɵtextInterpolate1("v", ctx.selectedVersionNumber, "");
|
|
904
|
+
i0.ɵɵadvance();
|
|
905
|
+
i0.ɵɵconditional(ctx.allVersions.length > 1 ? 12 : -1);
|
|
906
|
+
i0.ɵɵadvance();
|
|
907
|
+
i0.ɵɵconditional(ctx.showVersionDropdown ? 13 : -1);
|
|
908
|
+
i0.ɵɵadvance();
|
|
909
|
+
i0.ɵɵconditional(ctx.showSaveToCollection ? 14 : -1);
|
|
910
|
+
i0.ɵɵadvance(4);
|
|
911
|
+
i0.ɵɵconditional(ctx.isLoading ? 18 : -1);
|
|
912
|
+
i0.ɵɵadvance();
|
|
913
|
+
i0.ɵɵconditional(ctx.error ? 19 : -1);
|
|
914
|
+
i0.ɵɵadvance();
|
|
915
|
+
i0.ɵɵconditional(!ctx.isLoading && !ctx.error && ctx.artifact ? 20 : -1);
|
|
916
|
+
i0.ɵɵadvance();
|
|
917
|
+
i0.ɵɵconditional(ctx.showLibraryDialog ? 21 : -1);
|
|
918
|
+
} }, dependencies: [i1.NgClass, i2.NgSelectOption, i2.ɵNgSelectMultipleOption, i2.DefaultValueAccessor, i2.SelectControlValueAccessor, i2.NgControlStatus, i2.NgModel, i3.MarkdownComponent, i4.CodeEditorComponent, i5.ArtifactTypePluginViewerComponent, i1.DatePipe], styles: [".artifact-viewer-panel[_ngcontent-%COMP%] {\n height: 100%;\n background: white;\n border-left: 1px solid #E5E7EB;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.panel-header[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 16px;\n border-bottom: 1px solid #E5E7EB;\n background: white;\n flex-shrink: 0;\n}\n\n.panel-header-left[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n}\n\n.panel-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 8px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.panel-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: #6366F1;\n flex-shrink: 0;\n}\n\n.header-description[_ngcontent-%COMP%] {\n margin: 4px 0 0 0;\n font-size: 12px;\n color: #6B7280;\n font-weight: normal;\n}\n\n.panel-header-right[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-shrink: 0;\n}\n\n.version-selector[_ngcontent-%COMP%] {\n position: relative;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n background: #F3F4F6;\n border-radius: 12px;\n font-size: 12px;\n color: #6B7280;\n font-weight: 500;\n transition: all 0.2s;\n}\n\n.version-selector.clickable[_ngcontent-%COMP%] {\n cursor: pointer;\n}\n\n.version-selector.clickable[_ngcontent-%COMP%]:hover {\n background: #E5E7EB;\n}\n\n.version-selector[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 11px;\n}\n\n.version-selector[_ngcontent-%COMP%] .dropdown-icon[_ngcontent-%COMP%] {\n margin-left: 2px;\n transition: transform 0.2s;\n}\n\n.version-selector[_ngcontent-%COMP%] .dropdown-icon.open[_ngcontent-%COMP%] {\n transform: rotate(180deg);\n}\n\n.version-label[_ngcontent-%COMP%] {\n font-family: monospace;\n}\n\n.version-dropdown[_ngcontent-%COMP%] {\n position: absolute;\n top: calc(100% + 4px);\n right: 0;\n min-width: 200px;\n background: white;\n border: 1px solid #E5E7EB;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n overflow: hidden;\n}\n\n.version-option[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 12px;\n cursor: pointer;\n transition: background 0.15s;\n font-size: 13px;\n}\n\n.version-option[_ngcontent-%COMP%]:hover {\n background: #F9FAFB;\n}\n\n.version-option.selected[_ngcontent-%COMP%] {\n background: #EEF2FF;\n color: #4F46E5;\n}\n\n.version-option[_ngcontent-%COMP%] .version-number[_ngcontent-%COMP%] {\n font-family: monospace;\n font-weight: 600;\n min-width: 35px;\n}\n\n.version-option[_ngcontent-%COMP%] .version-date[_ngcontent-%COMP%] {\n flex: 1;\n color: #6B7280;\n font-size: 12px;\n}\n\n.version-option[_ngcontent-%COMP%] i.fa-check[_ngcontent-%COMP%] {\n color: #10B981;\n margin-left: auto;\n}\n\n.save-to-collection-btn[_ngcontent-%COMP%] {\n background: none;\n border: none;\n cursor: pointer;\n color: #9CA3AF;\n padding: 6px;\n border-radius: 4px;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n}\n\n.save-to-collection-btn[_ngcontent-%COMP%]:hover {\n background: #F3F4F6;\n color: #6B7280;\n}\n\n.save-to-collection-btn.in-collection[_ngcontent-%COMP%] {\n color: #F59E0B;\n}\n\n.save-to-collection-btn.in-collection[_ngcontent-%COMP%]:hover {\n background: #FEF3C7;\n color: #D97706;\n}\n\n.save-to-collection-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 14px;\n}\n\n.close-btn[_ngcontent-%COMP%] {\n background: none;\n border: none;\n cursor: pointer;\n color: #6B7280;\n padding: 6px;\n border-radius: 4px;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n}\n\n.close-btn[_ngcontent-%COMP%]:hover {\n background: #F3F4F6;\n color: #111827;\n}\n\n.close-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 14px;\n}\n\n.panel-content[_ngcontent-%COMP%] {\n flex: 1;\n overflow: hidden;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.artifact-content-wrapper[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n min-height: 0;\n}\n\n.loading-state[_ngcontent-%COMP%], \n.error-state[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n padding: 40px 20px;\n color: #6B7280;\n}\n\n.error-state[_ngcontent-%COMP%] {\n color: #DC2626;\n}\n\n.loading-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 24px;\n}\n\n.artifact-meta[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n gap: 16px;\n margin-bottom: 16px;\n padding: 16px;\n background: #F9FAFB;\n border-radius: 8px;\n flex-shrink: 0;\n}\n\n.meta-item[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.meta-item[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n font-size: 12px;\n font-weight: 500;\n color: #6B7280;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.meta-item[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n font-size: 14px;\n color: #111827;\n}\n\n.artifact-description[_ngcontent-%COMP%] {\n padding: 12px;\n margin-bottom: 16px;\n background: #EFF6FF;\n border-left: 3px solid #3B82F6;\n border-radius: 4px;\n color: #1E40AF;\n font-size: 14px;\n flex-shrink: 0;\n}\n\n.json-viewer[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n flex-direction: column;\n border: 1px solid #E5E7EB;\n border-radius: 8px;\n overflow: hidden;\n min-height: 0;\n}\n\n.json-editor-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow: hidden;\n min-height: 0;\n}\n\n.json-toolbar[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n padding: 8px 12px;\n background: #F9FAFB;\n border-bottom: 1px solid #E5E7EB;\n flex-shrink: 0;\n}\n\n.btn-icon[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n background: white;\n border: 1px solid #D1D5DB;\n border-radius: 4px;\n padding: 6px 12px;\n cursor: pointer;\n color: #374151;\n font-size: 14px;\n transition: all 0.2s;\n}\n\n.btn-icon[_ngcontent-%COMP%]:hover {\n background: #F3F4F6;\n border-color: #9CA3AF;\n}\n\n.btn-icon.btn-primary[_ngcontent-%COMP%] {\n background: #4F46E5;\n border-color: #4F46E5;\n color: white;\n}\n\n.btn-icon.btn-primary[_ngcontent-%COMP%]:hover {\n background: #4338CA;\n border-color: #4338CA;\n}\n\n.btn-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 14px;\n}\n\n\n\n.modal-overlay[_ngcontent-%COMP%] {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n}\n\n.modal-content[_ngcontent-%COMP%] {\n background: white;\n border-radius: 12px;\n box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);\n max-width: 500px;\n width: 90%;\n max-height: 90vh;\n display: flex;\n flex-direction: column;\n}\n\n.modal-header[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px 20px;\n border-bottom: 1px solid #E5E7EB;\n}\n\n.modal-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.modal-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: #F59E0B;\n}\n\n.modal-body[_ngcontent-%COMP%] {\n padding: 20px;\n overflow-y: auto;\n}\n\n.modal-footer[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n gap: 12px;\n padding: 16px 20px;\n border-top: 1px solid #E5E7EB;\n}\n\n.form-section[_ngcontent-%COMP%] {\n margin-bottom: 20px;\n}\n\n.form-section[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n display: block;\n margin-bottom: 8px;\n font-size: 14px;\n font-weight: 500;\n color: #374151;\n}\n\n.form-select[_ngcontent-%COMP%], \n.form-input[_ngcontent-%COMP%] {\n width: 100%;\n padding: 10px 12px;\n border: 1px solid #D1D5DB;\n border-radius: 6px;\n font-size: 14px;\n color: #111827;\n background: white;\n transition: border-color 0.2s;\n}\n\n.form-select[_ngcontent-%COMP%]:focus, \n.form-input[_ngcontent-%COMP%]:focus {\n outline: none;\n border-color: #4F46E5;\n box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);\n}\n\n.divider[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n margin: 24px 0;\n color: #9CA3AF;\n font-size: 12px;\n font-weight: 500;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.divider[_ngcontent-%COMP%]::before, \n.divider[_ngcontent-%COMP%]::after {\n content: '';\n flex: 1;\n height: 1px;\n background: #E5E7EB;\n}\n\n.divider[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n padding: 0 12px;\n}\n\n.create-collection-row[_ngcontent-%COMP%] {\n display: flex;\n gap: 8px;\n}\n\n.create-collection-row[_ngcontent-%COMP%] .form-input[_ngcontent-%COMP%] {\n flex: 1;\n}\n\n.btn[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n white-space: nowrap;\n}\n\n.btn[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.btn-primary[_ngcontent-%COMP%] {\n background: #4F46E5;\n color: white;\n}\n\n.btn-primary[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: #4338CA;\n}\n\n.btn-secondary[_ngcontent-%COMP%] {\n background: white;\n border: 1px solid #D1D5DB;\n color: #374151;\n}\n\n.btn-secondary[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: #F3F4F6;\n}\n\n\n\n.tab-navigation[_ngcontent-%COMP%] {\n display: flex;\n gap: 0;\n border-bottom: 2px solid #E5E7EB;\n padding: 0 16px;\n background: white;\n}\n\n.tab-btn[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 12px 20px;\n background: transparent;\n border: none;\n border-bottom: 2px solid transparent;\n margin-bottom: -2px;\n color: #6B7280;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: all 150ms ease;\n}\n\n.tab-btn[_ngcontent-%COMP%]:hover {\n color: #1e40af;\n background: #F9FAFB;\n}\n\n.tab-btn.active[_ngcontent-%COMP%] {\n color: #1e40af;\n border-bottom-color: #1e40af;\n}\n\n.tab-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 14px;\n}\n\n\n\n.tab-content[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n width: 100%;\n}\n\n.display-content[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n flex-direction: column;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n overflow: hidden;\n min-height: 0;\n}\n\n.display-toolbar[_ngcontent-%COMP%] {\n position: absolute;\n top: 12px;\n right: 12px;\n display: flex;\n gap: 8px;\n z-index: 10;\n}\n\n.markdown-content[_ngcontent-%COMP%], \n.html-content[_ngcontent-%COMP%] {\n flex: 1;\n font-size: 14px;\n line-height: 1.6;\n width: 100%;\n padding: 20px;\n box-sizing: border-box;\n overflow: auto;\n min-height: 0;\n}\n\n.details-content[_ngcontent-%COMP%] {\n padding: 20px;\n width: 100%;\n box-sizing: border-box;\n}\n\n.details-content[_ngcontent-%COMP%] .artifact-meta[_ngcontent-%COMP%] {\n margin-bottom: 0;\n padding: 20px;\n}\n\n.details-content[_ngcontent-%COMP%] .meta-item.full-width[_ngcontent-%COMP%] {\n grid-column: 1 / -1;\n}\n\n.attributes-section[_ngcontent-%COMP%] {\n margin-top: 24px;\n padding: 24px;\n background: #F9FAFB;\n border-radius: 8px;\n}\n\n.attributes-section[_ngcontent-%COMP%] h4[_ngcontent-%COMP%] {\n margin: 0 0 16px 0;\n font-size: 14px;\n font-weight: 600;\n color: #111827;\n}\n\n.attributes-list[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));\n gap: 16px;\n}\n\n.attribute-item[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 12px;\n background: white;\n border-radius: 6px;\n border: 1px solid #E5E7EB;\n}\n\n.attribute-item[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n font-size: 11px;\n font-weight: 600;\n color: #6B7280;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.attribute-item[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n font-size: 13px;\n color: #111827;\n word-break: break-word;\n}\n\n.attribute-empty-pill[_ngcontent-%COMP%] {\n display: inline-block;\n padding: 2px 8px;\n background: #F3F4F6;\n color: #9CA3AF;\n font-size: 11px;\n font-weight: 500;\n border-radius: 4px;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}"] });
|
|
919
|
+
}
|
|
920
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArtifactViewerPanelComponent, [{
|
|
921
|
+
type: Component,
|
|
922
|
+
args: [{ selector: 'mj-artifact-viewer-panel', template: "<div class=\"artifact-viewer-panel\">\n <div class=\"panel-header\">\n <div class=\"panel-header-left\">\n <h3>\n <i class=\"fas fa-cube\"></i>\n {{ displayName }}\n </h3>\n @if (displayDescription) {\n <p class=\"header-description\">{{ displayDescription }}</p>\n }\n </div>\n <div class=\"panel-header-right\">\n <div class=\"version-selector\" [class.clickable]=\"allVersions.length > 1\" (click)=\"toggleVersionDropdown()\">\n <i class=\"fas fa-history\"></i>\n <span class=\"version-label\">v{{ selectedVersionNumber }}</span>\n @if (allVersions.length > 1) {\n <i class=\"fas fa-chevron-down dropdown-icon\" [class.open]=\"showVersionDropdown\"></i>\n }\n @if (showVersionDropdown) {\n <div class=\"version-dropdown\" (click)=\"$event.stopPropagation()\">\n @for (version of allVersions; track version.ID) {\n <div class=\"version-option\"\n [class.selected]=\"version.VersionNumber === selectedVersionNumber\"\n (click)=\"selectVersion(version); $event.stopPropagation()\">\n <span class=\"version-number\">v{{ version.VersionNumber }}</span>\n <span class=\"version-date\">{{ version.__mj_CreatedAt | date:'short' }}</span>\n @if (version.VersionNumber === selectedVersionNumber) {\n <i class=\"fas fa-check\"></i>\n }\n </div>\n }\n </div>\n }\n </div>\n @if (showSaveToCollection) {\n <button class=\"save-to-collection-btn\"\n [class.in-collection]=\"isInCollection\"\n (click)=\"onSaveToLibrary()\"\n [title]=\"isInCollection ? 'View in Collection' : 'Save to Collection'\">\n <i [ngClass]=\"isInCollection ? 'fas fa-bookmark' : 'far fa-bookmark'\"></i>\n </button>\n }\n <button class=\"close-btn\" (click)=\"onClose()\" title=\"Close\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n </div>\n\n <div class=\"panel-content\">\n @if (isLoading) {\n <div class=\"loading-state\">\n <i class=\"fas fa-spinner fa-spin\"></i>\n <span>Loading artifact...</span>\n </div>\n }\n\n @if (error) {\n <div class=\"error-state\">\n <i class=\"fas fa-exclamation-triangle\"></i>\n <span>{{ error }}</span>\n </div>\n }\n\n @if (!isLoading && !error && artifact) {\n <div class=\"artifact-content-wrapper\">\n <!-- Tab Navigation -->\n <div class=\"tab-navigation\">\n @if (hasDisplayTab) {\n <button class=\"tab-btn\" [class.active]=\"activeTab === 'display'\" (click)=\"setActiveTab('display')\">\n <i class=\"fas fa-eye\"></i> Display\n </button>\n }\n @if (hasJsonTab) {\n <button class=\"tab-btn\" [class.active]=\"activeTab === 'json'\" (click)=\"setActiveTab('json')\">\n <i class=\"fas fa-code\"></i> JSON\n </button>\n }\n <button class=\"tab-btn\" [class.active]=\"activeTab === 'details'\" (click)=\"setActiveTab('details')\">\n <i class=\"fas fa-info-circle\"></i> Details\n </button>\n </div>\n\n <!-- Tab Content -->\n <div class=\"tab-content\">\n <!-- Display Tab (uses plugin system OR extracted attributes) -->\n @if (activeTab === 'display' && hasDisplayTab) {\n <div class=\"display-content\">\n @if (hasPlugin && artifactVersion && artifactTypeName) {\n <!-- Use plugin viewer if available -->\n <mj-artifact-type-plugin-viewer\n [artifactVersion]=\"artifactVersion\"\n [artifactTypeName]=\"artifactTypeName\"\n [contentType]=\"contentType\"\n [readonly]=\"true\">\n </mj-artifact-type-plugin-viewer>\n } @else if (displayMarkdown || displayHtml) {\n <!-- Fallback to extracted markdown/HTML attributes -->\n <div class=\"display-toolbar\">\n <button class=\"btn-icon\" title=\"Copy Content\" (click)=\"onCopyDisplayContent()\">\n <i class=\"fas fa-copy\"></i> Copy\n </button>\n </div>\n @if (displayMarkdown) {\n <div class=\"markdown-content\">\n <markdown [data]=\"displayMarkdown\"></markdown>\n </div>\n } @else if (displayHtml) {\n <div class=\"html-content\" [innerHTML]=\"displayHtml\"></div>\n }\n }\n </div>\n }\n\n <!-- JSON Tab (only shown for elevated displays with JSON content) -->\n @if (activeTab === 'json' && hasJsonTab) {\n <div class=\"json-viewer\">\n <div class=\"json-toolbar\">\n <button class=\"btn-icon\" title=\"Copy JSON\" (click)=\"onCopyToClipboard()\">\n <i class=\"fas fa-copy\"></i> Copy\n </button>\n </div>\n <div class=\"json-editor-container\">\n <mj-code-editor\n [(ngModel)]=\"jsonContent\"\n [language]=\"'json'\"\n [readonly]=\"true\"\n style=\"width: 100%; height: 100%;\">\n </mj-code-editor>\n </div>\n </div>\n }\n\n <!-- Details Tab -->\n @if (activeTab === 'details') {\n <div class=\"details-content\">\n <div class=\"artifact-meta\">\n <div class=\"meta-item\">\n <label>Type</label>\n <span>{{ artifact.Type }}</span>\n </div>\n <div class=\"meta-item\">\n <label>Version</label>\n <span>{{ artifactVersion?.VersionNumber || 1 }}</span>\n </div>\n <div class=\"meta-item\">\n <label>Created</label>\n <span>{{ artifact.__mj_CreatedAt | date:'short' }}</span>\n </div>\n <div class=\"meta-item\">\n <label>Updated</label>\n <span>{{ artifactVersion?.__mj_UpdatedAt | date:'short' }}</span>\n </div>\n @if (artifact.Description) {\n <div class=\"meta-item full-width\">\n <label>Artifact Description</label>\n <span>{{ artifact.Description }}</span>\n </div>\n }\n @if (artifactVersion?.Description && artifact.Description && artifactVersion?.Description !== artifact.Description) {\n <div class=\"meta-item full-width\">\n <label>Version Description</label>\n <span>{{ artifactVersion?.Description }}</span>\n </div>\n }\n </div>\n\n <!-- Version Attributes -->\n @if (filteredAttributes.length > 0) {\n <div class=\"attributes-section\">\n <h4>Version Attributes</h4>\n <div class=\"attributes-list\">\n @for (attr of filteredAttributes; track attr.ID) {\n <div class=\"attribute-item\">\n <label>{{ attr.Name }}</label>\n @if (attr.Value) {\n <span>{{ attr.Value }}</span>\n } @else {\n <span class=\"attribute-empty-pill\">Empty</span>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n</div>\n\n<!-- Save to Collection Dialog -->\n@if (showLibraryDialog) {\n <div class=\"modal-overlay\" (click)=\"cancelLibraryDialog()\">\n <div class=\"modal-content library-modal\" (click)=\"$event.stopPropagation()\">\n <div class=\"modal-header\">\n <h3>\n <i class=\"fas fa-bookmark\"></i>\n Save to Collection\n </h3>\n <button class=\"close-btn\" (click)=\"cancelLibraryDialog()\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"form-section\">\n <label>Select Collection</label>\n <select [(ngModel)]=\"selectedCollectionId\" class=\"form-select\">\n <option [ngValue]=\"null\">-- Choose a collection --</option>\n @for (collection of collections; track collection.ID) {\n <option [ngValue]=\"collection.ID\">{{ collection.Name }}</option>\n }\n </select>\n </div>\n\n <div class=\"divider\">\n <span>OR</span>\n </div>\n\n <div class=\"form-section\">\n <label>Create New Collection</label>\n <div class=\"create-collection-row\">\n <input\n type=\"text\"\n [(ngModel)]=\"newCollectionName\"\n placeholder=\"Enter collection name\"\n class=\"form-input\"\n (keyup.enter)=\"createNewCollection()\">\n <button\n class=\"btn btn-secondary\"\n (click)=\"createNewCollection()\"\n [disabled]=\"isCreatingCollection || !newCollectionName.trim()\">\n @if (isCreatingCollection) {\n <i class=\"fas fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fas fa-plus\"></i>\n }\n Create\n </button>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"cancelLibraryDialog()\">\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n (click)=\"saveToSelectedCollection()\"\n [disabled]=\"!selectedCollectionId || isSavingToLibrary\">\n @if (isSavingToLibrary) {\n <i class=\"fas fa-spinner fa-spin\"></i> Saving...\n } @else {\n <i class=\"fas fa-save\"></i> Save to Collection\n }\n </button>\n </div>\n </div>\n </div>\n}\n", styles: [".artifact-viewer-panel {\n height: 100%;\n background: white;\n border-left: 1px solid #E5E7EB;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.panel-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 16px;\n border-bottom: 1px solid #E5E7EB;\n background: white;\n flex-shrink: 0;\n}\n\n.panel-header-left {\n flex: 1;\n min-width: 0;\n}\n\n.panel-header h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 8px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.panel-header h3 i {\n color: #6366F1;\n flex-shrink: 0;\n}\n\n.header-description {\n margin: 4px 0 0 0;\n font-size: 12px;\n color: #6B7280;\n font-weight: normal;\n}\n\n.panel-header-right {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-shrink: 0;\n}\n\n.version-selector {\n position: relative;\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n background: #F3F4F6;\n border-radius: 12px;\n font-size: 12px;\n color: #6B7280;\n font-weight: 500;\n transition: all 0.2s;\n}\n\n.version-selector.clickable {\n cursor: pointer;\n}\n\n.version-selector.clickable:hover {\n background: #E5E7EB;\n}\n\n.version-selector i {\n font-size: 11px;\n}\n\n.version-selector .dropdown-icon {\n margin-left: 2px;\n transition: transform 0.2s;\n}\n\n.version-selector .dropdown-icon.open {\n transform: rotate(180deg);\n}\n\n.version-label {\n font-family: monospace;\n}\n\n.version-dropdown {\n position: absolute;\n top: calc(100% + 4px);\n right: 0;\n min-width: 200px;\n background: white;\n border: 1px solid #E5E7EB;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n overflow: hidden;\n}\n\n.version-option {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 12px;\n cursor: pointer;\n transition: background 0.15s;\n font-size: 13px;\n}\n\n.version-option:hover {\n background: #F9FAFB;\n}\n\n.version-option.selected {\n background: #EEF2FF;\n color: #4F46E5;\n}\n\n.version-option .version-number {\n font-family: monospace;\n font-weight: 600;\n min-width: 35px;\n}\n\n.version-option .version-date {\n flex: 1;\n color: #6B7280;\n font-size: 12px;\n}\n\n.version-option i.fa-check {\n color: #10B981;\n margin-left: auto;\n}\n\n.save-to-collection-btn {\n background: none;\n border: none;\n cursor: pointer;\n color: #9CA3AF;\n padding: 6px;\n border-radius: 4px;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n}\n\n.save-to-collection-btn:hover {\n background: #F3F4F6;\n color: #6B7280;\n}\n\n.save-to-collection-btn.in-collection {\n color: #F59E0B;\n}\n\n.save-to-collection-btn.in-collection:hover {\n background: #FEF3C7;\n color: #D97706;\n}\n\n.save-to-collection-btn i {\n font-size: 14px;\n}\n\n.close-btn {\n background: none;\n border: none;\n cursor: pointer;\n color: #6B7280;\n padding: 6px;\n border-radius: 4px;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n}\n\n.close-btn:hover {\n background: #F3F4F6;\n color: #111827;\n}\n\n.close-btn i {\n font-size: 14px;\n}\n\n.panel-content {\n flex: 1;\n overflow: hidden;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.artifact-content-wrapper {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n min-height: 0;\n}\n\n.loading-state,\n.error-state {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n padding: 40px 20px;\n color: #6B7280;\n}\n\n.error-state {\n color: #DC2626;\n}\n\n.loading-state i {\n font-size: 24px;\n}\n\n.artifact-meta {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n gap: 16px;\n margin-bottom: 16px;\n padding: 16px;\n background: #F9FAFB;\n border-radius: 8px;\n flex-shrink: 0;\n}\n\n.meta-item {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.meta-item label {\n font-size: 12px;\n font-weight: 500;\n color: #6B7280;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.meta-item span {\n font-size: 14px;\n color: #111827;\n}\n\n.artifact-description {\n padding: 12px;\n margin-bottom: 16px;\n background: #EFF6FF;\n border-left: 3px solid #3B82F6;\n border-radius: 4px;\n color: #1E40AF;\n font-size: 14px;\n flex-shrink: 0;\n}\n\n.json-viewer {\n flex: 1;\n display: flex;\n flex-direction: column;\n border: 1px solid #E5E7EB;\n border-radius: 8px;\n overflow: hidden;\n min-height: 0;\n}\n\n.json-editor-container {\n flex: 1;\n overflow: hidden;\n min-height: 0;\n}\n\n.json-toolbar {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n padding: 8px 12px;\n background: #F9FAFB;\n border-bottom: 1px solid #E5E7EB;\n flex-shrink: 0;\n}\n\n.btn-icon {\n display: flex;\n align-items: center;\n gap: 6px;\n background: white;\n border: 1px solid #D1D5DB;\n border-radius: 4px;\n padding: 6px 12px;\n cursor: pointer;\n color: #374151;\n font-size: 14px;\n transition: all 0.2s;\n}\n\n.btn-icon:hover {\n background: #F3F4F6;\n border-color: #9CA3AF;\n}\n\n.btn-icon.btn-primary {\n background: #4F46E5;\n border-color: #4F46E5;\n color: white;\n}\n\n.btn-icon.btn-primary:hover {\n background: #4338CA;\n border-color: #4338CA;\n}\n\n.btn-icon i {\n font-size: 14px;\n}\n\n/* Library Dialog Styles */\n.modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n}\n\n.modal-content {\n background: white;\n border-radius: 12px;\n box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);\n max-width: 500px;\n width: 90%;\n max-height: 90vh;\n display: flex;\n flex-direction: column;\n}\n\n.modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px 20px;\n border-bottom: 1px solid #E5E7EB;\n}\n\n.modal-header h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.modal-header h3 i {\n color: #F59E0B;\n}\n\n.modal-body {\n padding: 20px;\n overflow-y: auto;\n}\n\n.modal-footer {\n display: flex;\n justify-content: flex-end;\n gap: 12px;\n padding: 16px 20px;\n border-top: 1px solid #E5E7EB;\n}\n\n.form-section {\n margin-bottom: 20px;\n}\n\n.form-section label {\n display: block;\n margin-bottom: 8px;\n font-size: 14px;\n font-weight: 500;\n color: #374151;\n}\n\n.form-select,\n.form-input {\n width: 100%;\n padding: 10px 12px;\n border: 1px solid #D1D5DB;\n border-radius: 6px;\n font-size: 14px;\n color: #111827;\n background: white;\n transition: border-color 0.2s;\n}\n\n.form-select:focus,\n.form-input:focus {\n outline: none;\n border-color: #4F46E5;\n box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);\n}\n\n.divider {\n display: flex;\n align-items: center;\n margin: 24px 0;\n color: #9CA3AF;\n font-size: 12px;\n font-weight: 500;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.divider::before,\n.divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: #E5E7EB;\n}\n\n.divider span {\n padding: 0 12px;\n}\n\n.create-collection-row {\n display: flex;\n gap: 8px;\n}\n\n.create-collection-row .form-input {\n flex: 1;\n}\n\n.btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n white-space: nowrap;\n}\n\n.btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.btn-primary {\n background: #4F46E5;\n color: white;\n}\n\n.btn-primary:hover:not(:disabled) {\n background: #4338CA;\n}\n\n.btn-secondary {\n background: white;\n border: 1px solid #D1D5DB;\n color: #374151;\n}\n\n.btn-secondary:hover:not(:disabled) {\n background: #F3F4F6;\n}\n\n/* Tab Navigation */\n.tab-navigation {\n display: flex;\n gap: 0;\n border-bottom: 2px solid #E5E7EB;\n padding: 0 16px;\n background: white;\n}\n\n.tab-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 12px 20px;\n background: transparent;\n border: none;\n border-bottom: 2px solid transparent;\n margin-bottom: -2px;\n color: #6B7280;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: all 150ms ease;\n}\n\n.tab-btn:hover {\n color: #1e40af;\n background: #F9FAFB;\n}\n\n.tab-btn.active {\n color: #1e40af;\n border-bottom-color: #1e40af;\n}\n\n.tab-btn i {\n font-size: 14px;\n}\n\n/* Tab Content */\n.tab-content {\n flex: 1;\n overflow: auto;\n width: 100%;\n}\n\n.display-content {\n flex: 1;\n display: flex;\n flex-direction: column;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n overflow: hidden;\n min-height: 0;\n}\n\n.display-toolbar {\n position: absolute;\n top: 12px;\n right: 12px;\n display: flex;\n gap: 8px;\n z-index: 10;\n}\n\n.markdown-content,\n.html-content {\n flex: 1;\n font-size: 14px;\n line-height: 1.6;\n width: 100%;\n padding: 20px;\n box-sizing: border-box;\n overflow: auto;\n min-height: 0;\n}\n\n.details-content {\n padding: 20px;\n width: 100%;\n box-sizing: border-box;\n}\n\n.details-content .artifact-meta {\n margin-bottom: 0;\n padding: 20px;\n}\n\n.details-content .meta-item.full-width {\n grid-column: 1 / -1;\n}\n\n.attributes-section {\n margin-top: 24px;\n padding: 24px;\n background: #F9FAFB;\n border-radius: 8px;\n}\n\n.attributes-section h4 {\n margin: 0 0 16px 0;\n font-size: 14px;\n font-weight: 600;\n color: #111827;\n}\n\n.attributes-list {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));\n gap: 16px;\n}\n\n.attribute-item {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 12px;\n background: white;\n border-radius: 6px;\n border: 1px solid #E5E7EB;\n}\n\n.attribute-item label {\n font-size: 11px;\n font-weight: 600;\n color: #6B7280;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.attribute-item span {\n font-size: 13px;\n color: #111827;\n word-break: break-word;\n}\n\n.attribute-empty-pill {\n display: inline-block;\n padding: 2px 8px;\n background: #F3F4F6;\n color: #9CA3AF;\n font-size: 11px;\n font-weight: 500;\n border-radius: 4px;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n"] }]
|
|
923
|
+
}], null, { artifactId: [{
|
|
924
|
+
type: Input
|
|
925
|
+
}], currentUser: [{
|
|
926
|
+
type: Input
|
|
927
|
+
}], environmentId: [{
|
|
928
|
+
type: Input
|
|
929
|
+
}], versionNumber: [{
|
|
930
|
+
type: Input
|
|
931
|
+
}], showSaveToCollection: [{
|
|
932
|
+
type: Input
|
|
933
|
+
}], refreshTrigger: [{
|
|
934
|
+
type: Input
|
|
935
|
+
}], closed: [{
|
|
936
|
+
type: Output
|
|
937
|
+
}], pluginViewer: [{
|
|
938
|
+
type: ViewChild,
|
|
939
|
+
args: [ArtifactTypePluginViewerComponent]
|
|
940
|
+
}] }); })();
|
|
941
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactViewerPanelComponent, { className: "ArtifactViewerPanelComponent", filePath: "src/lib/components/artifact-viewer-panel.component.ts", lineNumber: 14 }); })();
|
|
942
|
+
//# sourceMappingURL=artifact-viewer-panel.component.js.map
|