@memberjunction/ng-artifacts 2.106.0 → 2.108.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/components/artifact-type-plugin-viewer.component.d.ts +16 -0
- package/dist/lib/components/artifact-type-plugin-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/artifact-type-plugin-viewer.component.js +73 -6
- package/dist/lib/components/artifact-type-plugin-viewer.component.js.map +1 -1
- package/dist/lib/components/artifact-viewer-panel.component.d.ts +58 -13
- package/dist/lib/components/artifact-viewer-panel.component.d.ts.map +1 -1
- package/dist/lib/components/artifact-viewer-panel.component.js +459 -285
- package/dist/lib/components/artifact-viewer-panel.component.js.map +1 -1
- package/dist/lib/components/plugins/html-artifact-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/plugins/html-artifact-viewer.component.js +13 -1
- package/dist/lib/components/plugins/html-artifact-viewer.component.js.map +1 -1
- package/dist/lib/components/plugins/json-artifact-viewer.component.d.ts +17 -4
- package/dist/lib/components/plugins/json-artifact-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/plugins/json-artifact-viewer.component.js +229 -44
- package/dist/lib/components/plugins/json-artifact-viewer.component.js.map +1 -1
- package/package.json +6 -6
|
@@ -32,6 +32,22 @@ export declare class ArtifactTypePluginViewerComponent implements OnInit, OnChan
|
|
|
32
32
|
* Get the artifact type entity for the current artifact
|
|
33
33
|
*/
|
|
34
34
|
private getArtifactType;
|
|
35
|
+
/**
|
|
36
|
+
* Resolves the DriverClass for an artifact type by traversing up the parent hierarchy.
|
|
37
|
+
* Falls back to JSON viewer if content is valid JSON and no DriverClass is found.
|
|
38
|
+
*
|
|
39
|
+
* @param artifactType The artifact type to resolve the DriverClass for
|
|
40
|
+
* @returns The DriverClass string, or null if none found and no JSON fallback available
|
|
41
|
+
*/
|
|
42
|
+
private resolveDriverClass;
|
|
43
|
+
/**
|
|
44
|
+
* Loads an artifact type by ID
|
|
45
|
+
*/
|
|
46
|
+
private getArtifactTypeById;
|
|
47
|
+
/**
|
|
48
|
+
* Checks if the artifact content is valid JSON and returns the JSON viewer plugin if so
|
|
49
|
+
*/
|
|
50
|
+
private checkJsonFallback;
|
|
35
51
|
/**
|
|
36
52
|
* Destroy the current viewer component
|
|
37
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-type-plugin-viewer.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/artifact-type-plugin-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACN,SAAS,EACT,aAAa,EAEb,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAsB,MAAM,+BAA+B,CAAC;AAI1F,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;;AAErF;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"artifact-type-plugin-viewer.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/artifact-type-plugin-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACN,SAAS,EACT,aAAa,EAEb,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAsB,MAAM,+BAA+B,CAAC;AAI1F,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;;AAErF;;;GAGG;AACH,qBAwDa,iCAAkC,YAAW,MAAM,EAAE,SAAS;IAChE,eAAe,EAAG,qBAAqB,CAAC;IACxC,gBAAgB,EAAG,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAQ;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAG3B,eAAe,EAAG,gBAAgB,CAAC;IAE5B,SAAS,UAAQ;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEnC,OAAO,CAAC,YAAY,CAAkC;IAEtD;;OAEG;IACH,IAAW,cAAc,IAAI,iCAAiC,GAAG,IAAI,CAEpE;IAEK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxD,WAAW,IAAI,IAAI;IAInB;;OAEG;YACW,UAAU;IAmFxB;;OAEG;YACW,eAAe;IAoB7B;;;;;;OAMG;YACW,kBAAkB;IAyBhC;;OAEG;YACW,mBAAmB;IAiBjC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAiBzB;;OAEG;IACH,OAAO,CAAC,oBAAoB;yCA9NjB,iCAAiC;2CAAjC,iCAAiC;CAqO7C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, Input, ViewChild, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { LogError, RunView } from '@memberjunction/core';
|
|
2
|
+
import { Metadata, LogError, RunView } from '@memberjunction/core';
|
|
3
3
|
import { MJGlobal } from '@memberjunction/global';
|
|
4
4
|
import { BaseArtifactViewerPluginComponent } from './base-artifact-viewer.component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
@@ -79,9 +79,10 @@ export class ArtifactTypePluginViewerComponent {
|
|
|
79
79
|
this.isLoading = false;
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
// Resolve DriverClass by traversing parent hierarchy if needed
|
|
83
|
+
const driverClass = await this.resolveDriverClass(artifactType);
|
|
83
84
|
if (!driverClass) {
|
|
84
|
-
this.error = `No DriverClass
|
|
85
|
+
this.error = `No DriverClass found in artifact type hierarchy for "${this.artifactTypeName}" and no valid JSON content for fallback`;
|
|
85
86
|
this.isLoading = false;
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
@@ -146,6 +147,72 @@ export class ArtifactTypePluginViewerComponent {
|
|
|
146
147
|
return null;
|
|
147
148
|
}
|
|
148
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Resolves the DriverClass for an artifact type by traversing up the parent hierarchy.
|
|
152
|
+
* Falls back to JSON viewer if content is valid JSON and no DriverClass is found.
|
|
153
|
+
*
|
|
154
|
+
* @param artifactType The artifact type to resolve the DriverClass for
|
|
155
|
+
* @returns The DriverClass string, or null if none found and no JSON fallback available
|
|
156
|
+
*/
|
|
157
|
+
async resolveDriverClass(artifactType) {
|
|
158
|
+
// Check if current artifact type has a DriverClass
|
|
159
|
+
if (artifactType.DriverClass) {
|
|
160
|
+
console.log(`✅ Found DriverClass '${artifactType.DriverClass}' on artifact type '${artifactType.Name}'`);
|
|
161
|
+
return artifactType.DriverClass;
|
|
162
|
+
}
|
|
163
|
+
// No DriverClass on current type - check if it has a parent
|
|
164
|
+
if (artifactType.ParentID) {
|
|
165
|
+
console.log(`🔍 No DriverClass on '${artifactType.Name}', checking parent...`);
|
|
166
|
+
const parentType = await this.getArtifactTypeById(artifactType.ParentID);
|
|
167
|
+
if (parentType) {
|
|
168
|
+
// Recursively check parent
|
|
169
|
+
return await this.resolveDriverClass(parentType);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
console.warn(`⚠️ Parent artifact type '${artifactType.ParentID}' not found`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// Reached root with no DriverClass - check for JSON fallback
|
|
176
|
+
console.log(`📄 No DriverClass found in hierarchy for '${artifactType.Name}', checking JSON fallback...`);
|
|
177
|
+
return this.checkJsonFallback();
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Loads an artifact type by ID
|
|
181
|
+
*/
|
|
182
|
+
async getArtifactTypeById(id) {
|
|
183
|
+
try {
|
|
184
|
+
const md = new Metadata();
|
|
185
|
+
const artifactType = await md.GetEntityObject('MJ: Artifact Types');
|
|
186
|
+
const loaded = await artifactType.Load(id);
|
|
187
|
+
if (loaded) {
|
|
188
|
+
return artifactType;
|
|
189
|
+
}
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
catch (err) {
|
|
193
|
+
console.error('Error loading artifact type by ID:', err);
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Checks if the artifact content is valid JSON and returns the JSON viewer plugin if so
|
|
199
|
+
*/
|
|
200
|
+
checkJsonFallback() {
|
|
201
|
+
if (!this.artifactVersion || !this.artifactVersion.Content) {
|
|
202
|
+
console.log('❌ No content available for JSON fallback');
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
try {
|
|
206
|
+
// Try to parse the content as JSON
|
|
207
|
+
JSON.parse(this.artifactVersion.Content);
|
|
208
|
+
console.log('✅ Content is valid JSON, using JsonArtifactViewerPlugin as fallback');
|
|
209
|
+
return 'JsonArtifactViewerPlugin';
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
console.log('❌ Content is not valid JSON, no fallback available');
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
149
216
|
/**
|
|
150
217
|
* Destroy the current viewer component
|
|
151
218
|
*/
|
|
@@ -172,7 +239,7 @@ export class ArtifactTypePluginViewerComponent {
|
|
|
172
239
|
i0.ɵɵconditional(ctx.isLoading ? 1 : -1);
|
|
173
240
|
i0.ɵɵadvance();
|
|
174
241
|
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 }"] });
|
|
242
|
+
} }, styles: [".artifact-type-plugin-viewer[_ngcontent-%COMP%] {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .artifact-type-plugin-viewer[_ngcontent-%COMP%] > * {\n flex: 1;\n min-height: 0;\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
243
|
}
|
|
177
244
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArtifactTypePluginViewerComponent, [{
|
|
178
245
|
type: Component,
|
|
@@ -192,7 +259,7 @@ export class ArtifactTypePluginViewerComponent {
|
|
|
192
259
|
}
|
|
193
260
|
<ng-container #viewerContainer></ng-container>
|
|
194
261
|
</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 "] }]
|
|
262
|
+
`, styles: ["\n .artifact-type-plugin-viewer {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .artifact-type-plugin-viewer ::ng-deep > * {\n flex: 1;\n min-height: 0;\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
263
|
}], null, { artifactVersion: [{
|
|
197
264
|
type: Input
|
|
198
265
|
}], artifactTypeName: [{
|
|
@@ -209,5 +276,5 @@ export class ArtifactTypePluginViewerComponent {
|
|
|
209
276
|
type: ViewChild,
|
|
210
277
|
args: ['viewerContainer', { read: ViewContainerRef, static: true }]
|
|
211
278
|
}] }); })();
|
|
212
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactTypePluginViewerComponent, { className: "ArtifactTypePluginViewerComponent", filePath: "src/lib/components/artifact-type-plugin-viewer.component.ts", lineNumber:
|
|
279
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactTypePluginViewerComponent, { className: "ArtifactTypePluginViewerComponent", filePath: "src/lib/components/artifact-type-plugin-viewer.component.ts", lineNumber: 78 }); })();
|
|
213
280
|
//# sourceMappingURL=artifact-type-plugin-viewer.component.js.map
|
|
@@ -1 +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,EACT,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAEvB,OAAO,
|
|
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,EACT,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EA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;OAEG;IACK,oBAAoB;QAC1B,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;2FApOU,iCAAiC;6DAAjC,iCAAiC;mCAQN,gBAAgB;;;;;YA7DpD,8BAAyC;YAOvC,AANA,0FAAiB,6EAMJ;YAMb,iCAA8C;YAChD,iBAAM;;YAbJ,cAKC;YALD,wCAKC;YACD,cAKC;YALD,oCAKC;;;iFAyCM,iCAAiC;cAxD7C,SAAS;2BACE,gCAAgC,YAChC;;;;;;;;;;;;;;;;GAgBT;gBAuCQ,eAAe;kBAAvB,KAAK;YACG,gBAAgB;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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { UserInfo } from '@memberjunction/core';
|
|
3
|
-
import { ArtifactEntity, ArtifactVersionEntity, ArtifactVersionAttributeEntity, CollectionEntity, CollectionArtifactEntity } from '@memberjunction/core-entities';
|
|
3
|
+
import { ArtifactEntity, ArtifactVersionEntity, ArtifactVersionAttributeEntity, CollectionEntity, CollectionArtifactEntity, ConversationEntity } from '@memberjunction/core-entities';
|
|
4
4
|
import { Subject } from 'rxjs';
|
|
5
5
|
import { ArtifactTypePluginViewerComponent } from './artifact-type-plugin-viewer.component';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
@@ -14,7 +14,17 @@ export declare class ArtifactViewerPanelComponent implements OnInit, OnChanges,
|
|
|
14
14
|
artifactId: string;
|
|
15
15
|
versionNumber: number;
|
|
16
16
|
}>;
|
|
17
|
+
viewContext: 'conversation' | 'collection' | null;
|
|
18
|
+
contextCollectionId?: string;
|
|
17
19
|
closed: EventEmitter<void>;
|
|
20
|
+
saveToCollectionRequested: EventEmitter<{
|
|
21
|
+
artifactId: string;
|
|
22
|
+
excludedCollectionIds: string[];
|
|
23
|
+
}>;
|
|
24
|
+
navigateToLink: EventEmitter<{
|
|
25
|
+
type: 'conversation' | 'collection';
|
|
26
|
+
id: string;
|
|
27
|
+
}>;
|
|
18
28
|
pluginViewer?: ArtifactTypePluginViewerComponent;
|
|
19
29
|
private destroy$;
|
|
20
30
|
artifact: ArtifactEntity | null;
|
|
@@ -25,19 +35,16 @@ export declare class ArtifactViewerPanelComponent implements OnInit, OnChanges,
|
|
|
25
35
|
error: string | null;
|
|
26
36
|
jsonContent: string;
|
|
27
37
|
showVersionDropdown: boolean;
|
|
28
|
-
showLibraryDialog: boolean;
|
|
29
|
-
collections: CollectionEntity[];
|
|
30
|
-
selectedCollectionId: string | null;
|
|
31
|
-
newCollectionName: string;
|
|
32
|
-
isCreatingCollection: boolean;
|
|
33
|
-
isSavingToLibrary: boolean;
|
|
34
38
|
artifactCollections: CollectionArtifactEntity[];
|
|
35
39
|
primaryCollection: CollectionEntity | null;
|
|
36
|
-
activeTab: 'display' | 'json' | 'details';
|
|
40
|
+
activeTab: 'display' | 'json' | 'details' | 'links';
|
|
37
41
|
displayMarkdown: string | null;
|
|
38
42
|
displayHtml: string | null;
|
|
39
43
|
versionAttributes: ArtifactVersionAttributeEntity[];
|
|
40
44
|
private artifactTypeDriverClass;
|
|
45
|
+
originConversation: ConversationEntity | null;
|
|
46
|
+
allCollections: CollectionEntity[];
|
|
47
|
+
hasAccessToOriginConversation: boolean;
|
|
41
48
|
private cachedPluginShouldShowRaw;
|
|
42
49
|
private cachedPluginIsElevated;
|
|
43
50
|
ngOnInit(): Promise<void>;
|
|
@@ -54,20 +61,58 @@ export declare class ArtifactViewerPanelComponent implements OnInit, OnChanges,
|
|
|
54
61
|
get artifactTypeName(): string;
|
|
55
62
|
get contentType(): string | undefined;
|
|
56
63
|
get filteredAttributes(): ArtifactVersionAttributeEntity[];
|
|
57
|
-
setActiveTab(tab: 'display' | 'json' | 'details'): void;
|
|
64
|
+
setActiveTab(tab: 'display' | 'json' | 'details' | 'links'): void;
|
|
58
65
|
private parseAttributeValue;
|
|
66
|
+
/**
|
|
67
|
+
* Clean up double-escaped characters that appear in LLM-generated HTML
|
|
68
|
+
* Removes literal "\\n" and "\\t" which cause rendering issues
|
|
69
|
+
*/
|
|
70
|
+
private cleanEscapedCharacters;
|
|
59
71
|
private loadCollectionAssociations;
|
|
60
72
|
get isInCollection(): boolean;
|
|
61
73
|
onCopyToClipboard(): void;
|
|
62
74
|
onCopyDisplayContent(): void;
|
|
75
|
+
onPrintDisplayContent(): void;
|
|
63
76
|
toggleVersionDropdown(): void;
|
|
64
77
|
selectVersion(version: ArtifactVersionEntity): Promise<void>;
|
|
65
78
|
onSaveToLibrary(): Promise<void>;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
get excludedCollectionIds(): string[];
|
|
80
|
+
/**
|
|
81
|
+
* Called by parent component after user selects collections in the picker.
|
|
82
|
+
* Saves the artifact to the selected collections.
|
|
83
|
+
*/
|
|
84
|
+
saveToCollections(collectionIds: string[]): Promise<boolean>;
|
|
85
|
+
/**
|
|
86
|
+
* Load links data: origin conversation and all collections containing this artifact
|
|
87
|
+
*/
|
|
88
|
+
private loadLinksData;
|
|
89
|
+
get hasLinksTab(): boolean;
|
|
90
|
+
get linksToShow(): Array<{
|
|
91
|
+
type: 'conversation' | 'collection';
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
hasAccess: boolean;
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* Navigate to a linked conversation or collection
|
|
98
|
+
*/
|
|
99
|
+
onNavigateToLink(link: {
|
|
100
|
+
type: 'conversation' | 'collection';
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
hasAccess: boolean;
|
|
104
|
+
}): void;
|
|
69
105
|
onClose(): void;
|
|
106
|
+
/**
|
|
107
|
+
* Resolves the DriverClass for an artifact type by traversing up the parent hierarchy.
|
|
108
|
+
* Returns the first DriverClass found, or null if none found in the hierarchy.
|
|
109
|
+
*/
|
|
110
|
+
private resolveDriverClassForType;
|
|
111
|
+
/**
|
|
112
|
+
* Loads an artifact type by ID
|
|
113
|
+
*/
|
|
114
|
+
private getArtifactTypeById;
|
|
70
115
|
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>;
|
|
116
|
+
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; }; "viewContext": { "alias": "viewContext"; "required": false; }; "contextCollectionId": { "alias": "contextCollectionId"; "required": false; }; }, { "closed": "closed"; "saveToCollectionRequested": "saveToCollectionRequested"; "navigateToLink": "navigateToLink"; }, never, never, false, never>;
|
|
72
117
|
}
|
|
73
118
|
//# sourceMappingURL=artifact-viewer-panel.component.d.ts.map
|
|
@@ -1 +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;
|
|
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,kBAAkB,EAA8D,MAAM,+BAA+B,CAAC;AAE9R,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,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC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