@memberjunction/ng-conversations 2.104.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/README.md +197 -0
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +20 -0
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -0
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js +125 -0
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -0
- package/dist/lib/components/agent/active-agent-indicator.component.d.ts +48 -0
- package/dist/lib/components/agent/active-agent-indicator.component.d.ts.map +1 -0
- package/dist/lib/components/agent/active-agent-indicator.component.js +199 -0
- package/dist/lib/components/agent/active-agent-indicator.component.js.map +1 -0
- package/dist/lib/components/agent/agent-process-panel.component.d.ts +30 -0
- package/dist/lib/components/agent/agent-process-panel.component.d.ts.map +1 -0
- package/dist/lib/components/agent/agent-process-panel.component.js +333 -0
- package/dist/lib/components/agent/agent-process-panel.component.js.map +1 -0
- package/dist/lib/components/artifact/artifact-panel.component.d.ts +22 -0
- package/dist/lib/components/artifact/artifact-panel.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-panel.component.js +237 -0
- package/dist/lib/components/artifact/artifact-panel.component.js.map +1 -0
- package/dist/lib/components/artifact/artifact-upload-modal.component.d.ts +39 -0
- package/dist/lib/components/artifact/artifact-upload-modal.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-upload-modal.component.js +384 -0
- package/dist/lib/components/artifact/artifact-upload-modal.component.js.map +1 -0
- package/dist/lib/components/artifact/artifact-version-history.component.d.ts +28 -0
- package/dist/lib/components/artifact/artifact-version-history.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-version-history.component.js +280 -0
- package/dist/lib/components/artifact/artifact-version-history.component.js.map +1 -0
- package/dist/lib/components/artifact/artifact-viewer-panel.component.d.ts +22 -0
- package/dist/lib/components/artifact/artifact-viewer-panel.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-viewer-panel.component.js +182 -0
- package/dist/lib/components/artifact/artifact-viewer-panel.component.js.map +1 -0
- package/dist/lib/components/artifact/artifact-viewer.component.d.ts +27 -0
- package/dist/lib/components/artifact/artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-viewer.component.js +266 -0
- package/dist/lib/components/artifact/artifact-viewer.component.js.map +1 -0
- package/dist/lib/components/artifact/inline-artifact.component.d.ts +46 -0
- package/dist/lib/components/artifact/inline-artifact.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/inline-artifact.component.js +447 -0
- package/dist/lib/components/artifact/inline-artifact.component.js.map +1 -0
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts +18 -0
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -0
- package/dist/lib/components/collection/collection-artifact-card.component.js +147 -0
- package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -0
- package/dist/lib/components/collection/collection-form-modal.component.d.ts +33 -0
- package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -0
- package/dist/lib/components/collection/collection-form-modal.component.js +245 -0
- package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -0
- package/dist/lib/components/collection/collection-tree.component.d.ts +42 -0
- package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -0
- package/dist/lib/components/collection/collection-tree.component.js +482 -0
- package/dist/lib/components/collection/collection-tree.component.js.map +1 -0
- package/dist/lib/components/collection/collection-view.component.d.ts +31 -0
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -0
- package/dist/lib/components/collection/collection-view.component.js +254 -0
- package/dist/lib/components/collection/collection-view.component.js.map +1 -0
- package/dist/lib/components/collection/collections-full-view.component.d.ts +55 -0
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -0
- package/dist/lib/components/collection/collections-full-view.component.js +578 -0
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +160 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.js +891 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -0
- package/dist/lib/components/conversation/conversation-list.component.d.ts +29 -0
- package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -0
- package/dist/lib/components/conversation/conversation-list.component.js +255 -0
- package/dist/lib/components/conversation/conversation-list.component.js.map +1 -0
- package/dist/lib/components/dialogs/input-dialog.component.d.ts +17 -0
- package/dist/lib/components/dialogs/input-dialog.component.d.ts.map +1 -0
- package/dist/lib/components/dialogs/input-dialog.component.js +122 -0
- package/dist/lib/components/dialogs/input-dialog.component.js.map +1 -0
- package/dist/lib/components/export/export-modal.component.d.ts +37 -0
- package/dist/lib/components/export/export-modal.component.d.ts.map +1 -0
- package/dist/lib/components/export/export-modal.component.js +414 -0
- package/dist/lib/components/export/export-modal.component.js.map +1 -0
- package/dist/lib/components/library/library-full-view.component.d.ts +36 -0
- package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -0
- package/dist/lib/components/library/library-full-view.component.js +270 -0
- package/dist/lib/components/library/library-full-view.component.js.map +1 -0
- package/dist/lib/components/members/members-modal.component.d.ts +42 -0
- package/dist/lib/components/members/members-modal.component.d.ts.map +1 -0
- package/dist/lib/components/members/members-modal.component.js +352 -0
- package/dist/lib/components/members/members-modal.component.js.map +1 -0
- package/dist/lib/components/mention/mention-dropdown.component.d.ts +44 -0
- package/dist/lib/components/mention/mention-dropdown.component.d.ts.map +1 -0
- package/dist/lib/components/mention/mention-dropdown.component.js +194 -0
- package/dist/lib/components/mention/mention-dropdown.component.js.map +1 -0
- package/dist/lib/components/message/message-input.component.d.ts +137 -0
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -0
- package/dist/lib/components/message/message-input.component.js +1159 -0
- package/dist/lib/components/message/message-input.component.js.map +1 -0
- package/dist/lib/components/message/message-item.component.d.ts +140 -0
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -0
- package/dist/lib/components/message/message-item.component.js +817 -0
- package/dist/lib/components/message/message-item.component.js.map +1 -0
- package/dist/lib/components/message/message-list.component.d.ts +77 -0
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -0
- package/dist/lib/components/message/message-list.component.js +316 -0
- package/dist/lib/components/message/message-list.component.js.map +1 -0
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts +13 -0
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts.map +1 -0
- package/dist/lib/components/navigation/conversation-navigation.component.js +88 -0
- package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -0
- package/dist/lib/components/notification/activity-indicator.component.d.ts +11 -0
- package/dist/lib/components/notification/activity-indicator.component.d.ts.map +1 -0
- package/dist/lib/components/notification/activity-indicator.component.js +56 -0
- package/dist/lib/components/notification/activity-indicator.component.js.map +1 -0
- package/dist/lib/components/notification/notification-badge.component.d.ts +27 -0
- package/dist/lib/components/notification/notification-badge.component.d.ts.map +1 -0
- package/dist/lib/components/notification/notification-badge.component.js +160 -0
- package/dist/lib/components/notification/notification-badge.component.js.map +1 -0
- package/dist/lib/components/project/project-form-modal.component.d.ts +34 -0
- package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -0
- package/dist/lib/components/project/project-form-modal.component.js +357 -0
- package/dist/lib/components/project/project-form-modal.component.js.map +1 -0
- package/dist/lib/components/project/project-selector.component.d.ts +36 -0
- package/dist/lib/components/project/project-selector.component.d.ts.map +1 -0
- package/dist/lib/components/project/project-selector.component.js +317 -0
- package/dist/lib/components/project/project-selector.component.js.map +1 -0
- package/dist/lib/components/search/search-panel.component.d.ts +120 -0
- package/dist/lib/components/search/search-panel.component.d.ts.map +1 -0
- package/dist/lib/components/search/search-panel.component.js +714 -0
- package/dist/lib/components/search/search-panel.component.js.map +1 -0
- package/dist/lib/components/share/share-modal.component.d.ts +46 -0
- package/dist/lib/components/share/share-modal.component.d.ts.map +1 -0
- package/dist/lib/components/share/share-modal.component.js +431 -0
- package/dist/lib/components/share/share-modal.component.js.map +1 -0
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +18 -0
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -0
- package/dist/lib/components/sidebar/conversation-sidebar.component.js +81 -0
- package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -0
- package/dist/lib/components/task/task-form-modal.component.d.ts +42 -0
- package/dist/lib/components/task/task-form-modal.component.d.ts.map +1 -0
- package/dist/lib/components/task/task-form-modal.component.js +329 -0
- package/dist/lib/components/task/task-form-modal.component.js.map +1 -0
- package/dist/lib/components/task/task-item.component.d.ts +22 -0
- package/dist/lib/components/task/task-item.component.d.ts.map +1 -0
- package/dist/lib/components/task/task-item.component.js +234 -0
- package/dist/lib/components/task/task-item.component.js.map +1 -0
- package/dist/lib/components/task/task-list.component.d.ts +32 -0
- package/dist/lib/components/task/task-list.component.d.ts.map +1 -0
- package/dist/lib/components/task/task-list.component.js +290 -0
- package/dist/lib/components/task/task-list.component.js.map +1 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +27 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.js +254 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -0
- package/dist/lib/components/thread/thread-panel.component.d.ts +65 -0
- package/dist/lib/components/thread/thread-panel.component.d.ts.map +1 -0
- package/dist/lib/components/thread/thread-panel.component.js +325 -0
- package/dist/lib/components/thread/thread-panel.component.js.map +1 -0
- package/dist/lib/components/toast/toast.component.d.ts +26 -0
- package/dist/lib/components/toast/toast.component.d.ts.map +1 -0
- package/dist/lib/components/toast/toast.component.js +108 -0
- package/dist/lib/components/toast/toast.component.js.map +1 -0
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +75 -0
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -0
- package/dist/lib/components/workspace/conversation-workspace.component.js +299 -0
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -0
- package/dist/lib/conversations.module.d.ts +62 -0
- package/dist/lib/conversations.module.d.ts.map +1 -0
- package/dist/lib/conversations.module.js +248 -0
- package/dist/lib/conversations.module.js.map +1 -0
- package/dist/lib/directives/search-shortcut.directive.d.ts +17 -0
- package/dist/lib/directives/search-shortcut.directive.d.ts.map +1 -0
- package/dist/lib/directives/search-shortcut.directive.js +39 -0
- package/dist/lib/directives/search-shortcut.directive.js.map +1 -0
- package/dist/lib/models/conversation-state.model.d.ts +72 -0
- package/dist/lib/models/conversation-state.model.d.ts.map +1 -0
- package/dist/lib/models/conversation-state.model.js +2 -0
- package/dist/lib/models/conversation-state.model.js.map +1 -0
- package/dist/lib/models/notification.model.d.ts +89 -0
- package/dist/lib/models/notification.model.d.ts.map +1 -0
- package/dist/lib/models/notification.model.js +11 -0
- package/dist/lib/models/notification.model.js.map +1 -0
- package/dist/lib/services/active-tasks.service.d.ts +65 -0
- package/dist/lib/services/active-tasks.service.d.ts.map +1 -0
- package/dist/lib/services/active-tasks.service.js +95 -0
- package/dist/lib/services/active-tasks.service.js.map +1 -0
- package/dist/lib/services/agent-state.service.d.ts +78 -0
- package/dist/lib/services/agent-state.service.d.ts.map +1 -0
- package/dist/lib/services/agent-state.service.js +213 -0
- package/dist/lib/services/agent-state.service.js.map +1 -0
- package/dist/lib/services/artifact-state.service.d.ts +114 -0
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -0
- package/dist/lib/services/artifact-state.service.js +288 -0
- package/dist/lib/services/artifact-state.service.js.map +1 -0
- package/dist/lib/services/conversation-agent.service.d.ts +79 -0
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -0
- package/dist/lib/services/conversation-agent.service.js +259 -0
- package/dist/lib/services/conversation-agent.service.js.map +1 -0
- package/dist/lib/services/conversation-state.service.d.ts +122 -0
- package/dist/lib/services/conversation-state.service.d.ts.map +1 -0
- package/dist/lib/services/conversation-state.service.js +255 -0
- package/dist/lib/services/conversation-state.service.js.map +1 -0
- package/dist/lib/services/dialog.service.d.ts +54 -0
- package/dist/lib/services/dialog.service.d.ts.map +1 -0
- package/dist/lib/services/dialog.service.js +157 -0
- package/dist/lib/services/dialog.service.js.map +1 -0
- package/dist/lib/services/export.service.d.ts +25 -0
- package/dist/lib/services/export.service.d.ts.map +1 -0
- package/dist/lib/services/export.service.js +237 -0
- package/dist/lib/services/export.service.js.map +1 -0
- package/dist/lib/services/mention-autocomplete.service.d.ts +59 -0
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -0
- package/dist/lib/services/mention-autocomplete.service.js +160 -0
- package/dist/lib/services/mention-autocomplete.service.js.map +1 -0
- package/dist/lib/services/mention-parser.service.d.ts +46 -0
- package/dist/lib/services/mention-parser.service.d.ts.map +1 -0
- package/dist/lib/services/mention-parser.service.js +156 -0
- package/dist/lib/services/mention-parser.service.js.map +1 -0
- package/dist/lib/services/notification.service.d.ts +108 -0
- package/dist/lib/services/notification.service.d.ts.map +1 -0
- package/dist/lib/services/notification.service.js +431 -0
- package/dist/lib/services/notification.service.js.map +1 -0
- package/dist/lib/services/search.service.d.ts +144 -0
- package/dist/lib/services/search.service.d.ts.map +1 -0
- package/dist/lib/services/search.service.js +370 -0
- package/dist/lib/services/search.service.js.map +1 -0
- package/dist/lib/services/toast.service.d.ts +46 -0
- package/dist/lib/services/toast.service.d.ts.map +1 -0
- package/dist/lib/services/toast.service.js +76 -0
- package/dist/lib/services/toast.service.js.map +1 -0
- package/dist/public-api.d.ts +42 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +49 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { RunView } from '@memberjunction/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/platform-browser";
|
|
5
|
+
import * as i2 from "@angular/common";
|
|
6
|
+
import * as i3 from "@memberjunction/ng-code-editor";
|
|
7
|
+
import * as i4 from "ngx-markdown";
|
|
8
|
+
function ArtifactViewerComponent_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
9
|
+
i0.ɵɵelementStart(0, "div", 12);
|
|
10
|
+
i0.ɵɵelement(1, "mj-code-editor", 13);
|
|
11
|
+
i0.ɵɵelementEnd();
|
|
12
|
+
} if (rf & 2) {
|
|
13
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
14
|
+
i0.ɵɵadvance();
|
|
15
|
+
i0.ɵɵproperty("value", ctx_r0.content)("readonly", true)("language", ctx_r0.codeLanguage)("lineWrapping", true)("setup", "basic");
|
|
16
|
+
} }
|
|
17
|
+
function ArtifactViewerComponent_div_3_Template(rf, ctx) { if (rf & 1) {
|
|
18
|
+
i0.ɵɵelementStart(0, "div", 14);
|
|
19
|
+
i0.ɵɵelement(1, "div", 15);
|
|
20
|
+
i0.ɵɵelementEnd();
|
|
21
|
+
} if (rf & 2) {
|
|
22
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
23
|
+
i0.ɵɵadvance();
|
|
24
|
+
i0.ɵɵproperty("data", ctx_r0.content);
|
|
25
|
+
} }
|
|
26
|
+
function ArtifactViewerComponent_div_4_Template(rf, ctx) { if (rf & 1) {
|
|
27
|
+
i0.ɵɵelementStart(0, "div", 16);
|
|
28
|
+
i0.ɵɵelement(1, "iframe", 17);
|
|
29
|
+
i0.ɵɵelementEnd();
|
|
30
|
+
} if (rf & 2) {
|
|
31
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
32
|
+
i0.ɵɵadvance();
|
|
33
|
+
i0.ɵɵproperty("srcdoc", ctx_r0.content, i0.ɵɵsanitizeHtml);
|
|
34
|
+
} }
|
|
35
|
+
function ArtifactViewerComponent_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
36
|
+
i0.ɵɵelementStart(0, "div", 18);
|
|
37
|
+
i0.ɵɵelement(1, "mj-code-editor", 13);
|
|
38
|
+
i0.ɵɵelementEnd();
|
|
39
|
+
} if (rf & 2) {
|
|
40
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
41
|
+
i0.ɵɵadvance();
|
|
42
|
+
i0.ɵɵproperty("value", ctx_r0.formattedJson)("readonly", true)("language", "json")("lineWrapping", true)("setup", "basic");
|
|
43
|
+
} }
|
|
44
|
+
function ArtifactViewerComponent_div_6_Template(rf, ctx) { if (rf & 1) {
|
|
45
|
+
i0.ɵɵelementStart(0, "div", 19);
|
|
46
|
+
i0.ɵɵelement(1, "mj-code-editor", 20);
|
|
47
|
+
i0.ɵɵelementEnd();
|
|
48
|
+
} if (rf & 2) {
|
|
49
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
50
|
+
i0.ɵɵadvance();
|
|
51
|
+
i0.ɵɵproperty("value", ctx_r0.content)("readonly", true)("lineWrapping", true)("setup", "minimal");
|
|
52
|
+
} }
|
|
53
|
+
export class ArtifactViewerComponent {
|
|
54
|
+
sanitizer;
|
|
55
|
+
artifact;
|
|
56
|
+
versionNumber;
|
|
57
|
+
currentUser;
|
|
58
|
+
content = '';
|
|
59
|
+
artifactType = 'text';
|
|
60
|
+
codeLanguage = 'javascript';
|
|
61
|
+
sanitizedContent = '';
|
|
62
|
+
formattedJson = '';
|
|
63
|
+
constructor(sanitizer) {
|
|
64
|
+
this.sanitizer = sanitizer;
|
|
65
|
+
}
|
|
66
|
+
ngOnInit() {
|
|
67
|
+
this.loadContent();
|
|
68
|
+
}
|
|
69
|
+
ngOnChanges(changes) {
|
|
70
|
+
if (changes['artifact'] || changes['versionNumber']) {
|
|
71
|
+
this.loadContent();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async loadContent() {
|
|
75
|
+
if (!this.artifact)
|
|
76
|
+
return;
|
|
77
|
+
try {
|
|
78
|
+
// Determine artifact type from TypeID or name
|
|
79
|
+
this.artifactType = this.determineType();
|
|
80
|
+
// Load the content from the specified version or latest
|
|
81
|
+
const rv = new RunView();
|
|
82
|
+
const filter = this.versionNumber
|
|
83
|
+
? `ArtifactID='${this.artifact.ID}' AND VersionNumber=${this.versionNumber}`
|
|
84
|
+
: `ArtifactID='${this.artifact.ID}'`;
|
|
85
|
+
const result = await rv.RunView({
|
|
86
|
+
EntityName: 'MJ: Artifact Versions',
|
|
87
|
+
ExtraFilter: filter,
|
|
88
|
+
OrderBy: 'VersionNumber DESC',
|
|
89
|
+
MaxRows: 1,
|
|
90
|
+
ResultType: 'entity_object'
|
|
91
|
+
}, this.currentUser);
|
|
92
|
+
if (result.Success && result.Results && result.Results.length > 0) {
|
|
93
|
+
this.content = result.Results[0].Content || '';
|
|
94
|
+
this.processContent();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
console.error('Error loading artifact content:', error);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
determineType() {
|
|
102
|
+
const name = this.artifact.Name?.toLowerCase() || '';
|
|
103
|
+
if (name.endsWith('.json'))
|
|
104
|
+
return 'json';
|
|
105
|
+
if (name.endsWith('.html') || name.endsWith('.htm'))
|
|
106
|
+
return 'html';
|
|
107
|
+
if (name.endsWith('.md') || name.endsWith('.markdown'))
|
|
108
|
+
return 'markdown';
|
|
109
|
+
// Code files - also determine language
|
|
110
|
+
if (name.endsWith('.js') || name.endsWith('.jsx')) {
|
|
111
|
+
this.codeLanguage = 'javascript';
|
|
112
|
+
return 'code';
|
|
113
|
+
}
|
|
114
|
+
if (name.endsWith('.ts') || name.endsWith('.tsx')) {
|
|
115
|
+
this.codeLanguage = 'typescript';
|
|
116
|
+
return 'code';
|
|
117
|
+
}
|
|
118
|
+
if (name.endsWith('.py')) {
|
|
119
|
+
this.codeLanguage = 'python';
|
|
120
|
+
return 'code';
|
|
121
|
+
}
|
|
122
|
+
if (name.endsWith('.java')) {
|
|
123
|
+
this.codeLanguage = 'java';
|
|
124
|
+
return 'code';
|
|
125
|
+
}
|
|
126
|
+
if (name.endsWith('.sql')) {
|
|
127
|
+
this.codeLanguage = 'sql';
|
|
128
|
+
return 'code';
|
|
129
|
+
}
|
|
130
|
+
if (name.endsWith('.css')) {
|
|
131
|
+
this.codeLanguage = 'css';
|
|
132
|
+
return 'code';
|
|
133
|
+
}
|
|
134
|
+
return 'text';
|
|
135
|
+
}
|
|
136
|
+
processContent() {
|
|
137
|
+
switch (this.artifactType) {
|
|
138
|
+
case 'json':
|
|
139
|
+
try {
|
|
140
|
+
const obj = JSON.parse(this.content);
|
|
141
|
+
this.formattedJson = JSON.stringify(obj, null, 2);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
this.formattedJson = this.content;
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
case 'markdown':
|
|
148
|
+
case 'html':
|
|
149
|
+
case 'code':
|
|
150
|
+
this.sanitizedContent = this.sanitizer.sanitize(1, this.content) || '';
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
copyToClipboard() {
|
|
155
|
+
navigator.clipboard.writeText(this.content).then(() => {
|
|
156
|
+
alert('Copied to clipboard!');
|
|
157
|
+
}).catch(err => {
|
|
158
|
+
console.error('Failed to copy:', err);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
downloadArtifact() {
|
|
162
|
+
const blob = new Blob([this.content], { type: 'text/plain' });
|
|
163
|
+
const url = window.URL.createObjectURL(blob);
|
|
164
|
+
const a = document.createElement('a');
|
|
165
|
+
a.href = url;
|
|
166
|
+
a.download = this.artifact.Name || 'artifact.txt';
|
|
167
|
+
document.body.appendChild(a);
|
|
168
|
+
a.click();
|
|
169
|
+
document.body.removeChild(a);
|
|
170
|
+
window.URL.revokeObjectURL(url);
|
|
171
|
+
}
|
|
172
|
+
static ɵfac = function ArtifactViewerComponent_Factory(t) { return new (t || ArtifactViewerComponent)(i0.ɵɵdirectiveInject(i1.DomSanitizer)); };
|
|
173
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArtifactViewerComponent, selectors: [["mj-artifact-viewer"]], inputs: { artifact: "artifact", versionNumber: "versionNumber", currentUser: "currentUser" }, features: [i0.ɵɵNgOnChangesFeature], decls: 14, vars: 5, consts: [[1, "artifact-viewer"], [1, "viewer-content", 3, "ngSwitch"], ["class", "code-viewer", 4, "ngSwitchCase"], ["class", "markdown-viewer", 4, "ngSwitchCase"], ["class", "html-viewer", 4, "ngSwitchCase"], ["class", "json-viewer", 4, "ngSwitchCase"], ["class", "text-viewer", 4, "ngSwitchDefault"], [1, "viewer-actions"], ["title", "Copy to clipboard", 1, "action-btn", 3, "click"], [1, "fas", "fa-copy"], ["title", "Download", 1, "action-btn", 3, "click"], [1, "fas", "fa-download"], [1, "code-viewer"], [3, "value", "readonly", "language", "lineWrapping", "setup"], [1, "markdown-viewer"], ["markdown", "", 3, "data"], [1, "html-viewer"], ["sandbox", "allow-scripts", 3, "srcdoc"], [1, "json-viewer"], [1, "text-viewer"], [3, "value", "readonly", "lineWrapping", "setup"]], template: function ArtifactViewerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
174
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
|
|
175
|
+
i0.ɵɵtemplate(2, ArtifactViewerComponent_div_2_Template, 2, 5, "div", 2)(3, ArtifactViewerComponent_div_3_Template, 2, 1, "div", 3)(4, ArtifactViewerComponent_div_4_Template, 2, 1, "div", 4)(5, ArtifactViewerComponent_div_5_Template, 2, 5, "div", 5)(6, ArtifactViewerComponent_div_6_Template, 2, 4, "div", 6);
|
|
176
|
+
i0.ɵɵelementEnd();
|
|
177
|
+
i0.ɵɵelementStart(7, "div", 7)(8, "button", 8);
|
|
178
|
+
i0.ɵɵlistener("click", function ArtifactViewerComponent_Template_button_click_8_listener() { return ctx.copyToClipboard(); });
|
|
179
|
+
i0.ɵɵelement(9, "i", 9);
|
|
180
|
+
i0.ɵɵtext(10, " Copy ");
|
|
181
|
+
i0.ɵɵelementEnd();
|
|
182
|
+
i0.ɵɵelementStart(11, "button", 10);
|
|
183
|
+
i0.ɵɵlistener("click", function ArtifactViewerComponent_Template_button_click_11_listener() { return ctx.downloadArtifact(); });
|
|
184
|
+
i0.ɵɵelement(12, "i", 11);
|
|
185
|
+
i0.ɵɵtext(13, " Download ");
|
|
186
|
+
i0.ɵɵelementEnd()()();
|
|
187
|
+
} if (rf & 2) {
|
|
188
|
+
i0.ɵɵadvance();
|
|
189
|
+
i0.ɵɵproperty("ngSwitch", ctx.artifactType);
|
|
190
|
+
i0.ɵɵadvance();
|
|
191
|
+
i0.ɵɵproperty("ngSwitchCase", "code");
|
|
192
|
+
i0.ɵɵadvance();
|
|
193
|
+
i0.ɵɵproperty("ngSwitchCase", "markdown");
|
|
194
|
+
i0.ɵɵadvance();
|
|
195
|
+
i0.ɵɵproperty("ngSwitchCase", "html");
|
|
196
|
+
i0.ɵɵadvance();
|
|
197
|
+
i0.ɵɵproperty("ngSwitchCase", "json");
|
|
198
|
+
} }, dependencies: [i2.NgSwitch, i2.NgSwitchCase, i2.NgSwitchDefault, i3.CodeEditorComponent, i4.MarkdownComponent], styles: [".artifact-viewer[_ngcontent-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n .viewer-content[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n padding: 24px;\n background: #FAFAFA;\n }\n .code-viewer[_ngcontent-%COMP%], .json-viewer[_ngcontent-%COMP%], .text-viewer[_ngcontent-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n .code-viewer[_ngcontent-%COMP%] mj-code-editor[_ngcontent-%COMP%], .json-viewer[_ngcontent-%COMP%] mj-code-editor[_ngcontent-%COMP%], .text-viewer[_ngcontent-%COMP%] mj-code-editor[_ngcontent-%COMP%] {\n flex: 1;\n border: 1px solid #D9D9D9;\n border-radius: 6px;\n overflow: hidden;\n }\n .markdown-viewer[_ngcontent-%COMP%] {\n background: #FFF;\n padding: 24px;\n border: 1px solid #D9D9D9;\n border-radius: 6px;\n }\n .html-viewer[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%] {\n width: 100%;\n height: 600px;\n border: 1px solid #D9D9D9;\n border-radius: 6px;\n }\n .viewer-actions[_ngcontent-%COMP%] {\n padding: 16px 24px;\n border-top: 1px solid #D9D9D9;\n display: flex;\n gap: 12px;\n }\n .action-btn[_ngcontent-%COMP%] {\n padding: 8px 16px;\n background: #FFF;\n border: 1px solid #D9D9D9;\n border-radius: 6px;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 150ms ease;\n }\n .action-btn[_ngcontent-%COMP%]:hover {\n background: #F4F4F4;\n border-color: #0076B6;\n }"] });
|
|
199
|
+
}
|
|
200
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArtifactViewerComponent, [{
|
|
201
|
+
type: Component,
|
|
202
|
+
args: [{ selector: 'mj-artifact-viewer', template: `
|
|
203
|
+
<div class="artifact-viewer">
|
|
204
|
+
<div class="viewer-content" [ngSwitch]="artifactType">
|
|
205
|
+
<!-- Code Viewer -->
|
|
206
|
+
<div *ngSwitchCase="'code'" class="code-viewer">
|
|
207
|
+
<mj-code-editor
|
|
208
|
+
[value]="content"
|
|
209
|
+
[readonly]="true"
|
|
210
|
+
[language]="codeLanguage"
|
|
211
|
+
[lineWrapping]="true"
|
|
212
|
+
[setup]="'basic'">
|
|
213
|
+
</mj-code-editor>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<!-- Markdown Viewer -->
|
|
217
|
+
<div *ngSwitchCase="'markdown'" class="markdown-viewer">
|
|
218
|
+
<div markdown [data]="content"></div>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<!-- HTML Viewer -->
|
|
222
|
+
<div *ngSwitchCase="'html'" class="html-viewer">
|
|
223
|
+
<iframe [srcdoc]="content" sandbox="allow-scripts"></iframe>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<!-- JSON Viewer -->
|
|
227
|
+
<div *ngSwitchCase="'json'" class="json-viewer">
|
|
228
|
+
<mj-code-editor
|
|
229
|
+
[value]="formattedJson"
|
|
230
|
+
[readonly]="true"
|
|
231
|
+
[language]="'json'"
|
|
232
|
+
[lineWrapping]="true"
|
|
233
|
+
[setup]="'basic'">
|
|
234
|
+
</mj-code-editor>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<!-- Text Viewer (default) -->
|
|
238
|
+
<div *ngSwitchDefault class="text-viewer">
|
|
239
|
+
<mj-code-editor
|
|
240
|
+
[value]="content"
|
|
241
|
+
[readonly]="true"
|
|
242
|
+
[lineWrapping]="true"
|
|
243
|
+
[setup]="'minimal'">
|
|
244
|
+
</mj-code-editor>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
<div class="viewer-actions">
|
|
249
|
+
<button class="action-btn" (click)="copyToClipboard()" title="Copy to clipboard">
|
|
250
|
+
<i class="fas fa-copy"></i> Copy
|
|
251
|
+
</button>
|
|
252
|
+
<button class="action-btn" (click)="downloadArtifact()" title="Download">
|
|
253
|
+
<i class="fas fa-download"></i> Download
|
|
254
|
+
</button>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
`, styles: ["\n .artifact-viewer {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n .viewer-content {\n flex: 1;\n overflow: auto;\n padding: 24px;\n background: #FAFAFA;\n }\n .code-viewer, .json-viewer, .text-viewer {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n .code-viewer mj-code-editor, .json-viewer mj-code-editor, .text-viewer mj-code-editor {\n flex: 1;\n border: 1px solid #D9D9D9;\n border-radius: 6px;\n overflow: hidden;\n }\n .markdown-viewer {\n background: #FFF;\n padding: 24px;\n border: 1px solid #D9D9D9;\n border-radius: 6px;\n }\n .html-viewer iframe {\n width: 100%;\n height: 600px;\n border: 1px solid #D9D9D9;\n border-radius: 6px;\n }\n .viewer-actions {\n padding: 16px 24px;\n border-top: 1px solid #D9D9D9;\n display: flex;\n gap: 12px;\n }\n .action-btn {\n padding: 8px 16px;\n background: #FFF;\n border: 1px solid #D9D9D9;\n border-radius: 6px;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 150ms ease;\n }\n .action-btn:hover {\n background: #F4F4F4;\n border-color: #0076B6;\n }\n "] }]
|
|
258
|
+
}], () => [{ type: i1.DomSanitizer }], { artifact: [{
|
|
259
|
+
type: Input
|
|
260
|
+
}], versionNumber: [{
|
|
261
|
+
type: Input
|
|
262
|
+
}], currentUser: [{
|
|
263
|
+
type: Input
|
|
264
|
+
}] }); })();
|
|
265
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactViewerComponent, { className: "ArtifactViewerComponent", filePath: "src/lib/components/artifact/artifact-viewer.component.ts", lineNumber: 122 }); })();
|
|
266
|
+
//# sourceMappingURL=artifact-viewer.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/artifact/artifact-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAoC,MAAM,eAAe,CAAC;AAEnF,OAAO,EAAY,OAAO,EAAE,MAAM,sBAAsB,CAAC;;;;;;;IASjD,+BAAgD;IAC9C,qCAMiB;IACnB,iBAAM;;;IANF,cAAiB;IAIjB,AADA,AADA,AADA,AADA,sCAAiB,kBACA,iCACQ,sBACJ,kBACJ;;;IAKrB,+BAAwD;IACtD,0BAAqC;IACvC,iBAAM;;;IADU,cAAgB;IAAhB,qCAAgB;;;IAIhC,+BAAgD;IAC9C,6BAA4D;IAC9D,iBAAM;;;IADI,cAAkB;IAAlB,0DAAkB;;;IAI5B,+BAAgD;IAC9C,qCAMiB;IACnB,iBAAM;;;IANF,cAAuB;IAIvB,AADA,AADA,AADA,AADA,4CAAuB,kBACN,oBACE,sBACE,kBACJ;;;IAKrB,+BAA0C;IACxC,qCAKiB;IACnB,iBA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ApDwB,cAAyB;YAAzB,2CAAyB;YAE7C,cAAoB;YAApB,qCAAoB;YAWpB,cAAwB;YAAxB,yCAAwB;YAKxB,cAAoB;YAApB,qCAAoB;YAKpB,cAAoB;YAApB,qCAAoB;;;iFAyFrB,uBAAuB;cApHnC,SAAS;2BACE,oBAAoB,YACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDT;6CA4DQ,QAAQ;kBAAhB,KAAK;YACG,aAAa;kBAArB,KAAK;YACG,WAAW;kBAAnB,KAAK;;kFAHK,uBAAuB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { ArtifactEntity, ArtifactVersionEntity } from '@memberjunction/core-entities';
|
|
3
|
+
import { UserInfo } from '@memberjunction/core';
|
|
4
|
+
import { ArtifactStateService } from '../../services/artifact-state.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Inline artifact display component that embeds rich artifact cards in conversation messages
|
|
8
|
+
* Shows artifact preview, type badge, quick actions, and metadata
|
|
9
|
+
*/
|
|
10
|
+
export declare class InlineArtifactComponent implements OnInit, OnDestroy {
|
|
11
|
+
private artifactState;
|
|
12
|
+
artifactId: string;
|
|
13
|
+
versionNumber?: number;
|
|
14
|
+
currentUser: UserInfo;
|
|
15
|
+
actionPerformed: EventEmitter<{
|
|
16
|
+
action: string;
|
|
17
|
+
artifact: ArtifactEntity;
|
|
18
|
+
}>;
|
|
19
|
+
artifact: ArtifactEntity | null;
|
|
20
|
+
currentVersion: ArtifactVersionEntity | null;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
error: boolean;
|
|
23
|
+
previewLines: string[];
|
|
24
|
+
hasMoreContent: boolean;
|
|
25
|
+
remainingLines: number;
|
|
26
|
+
private readonly PREVIEW_LINES;
|
|
27
|
+
private destroy$;
|
|
28
|
+
constructor(artifactState: ArtifactStateService);
|
|
29
|
+
ngOnInit(): Promise<void>;
|
|
30
|
+
ngOnDestroy(): void;
|
|
31
|
+
private loadArtifact;
|
|
32
|
+
private loadVersionContent;
|
|
33
|
+
private generatePreview;
|
|
34
|
+
get isNew(): boolean;
|
|
35
|
+
get isCodeArtifact(): boolean;
|
|
36
|
+
getArtifactIcon(): string;
|
|
37
|
+
getTypeBadgeColor(): string;
|
|
38
|
+
openFullView(event?: Event): void;
|
|
39
|
+
saveToLibrary(event: Event): void;
|
|
40
|
+
forkArtifact(event: Event): void;
|
|
41
|
+
viewHistory(event: Event): void;
|
|
42
|
+
shareArtifact(event: Event): void;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InlineArtifactComponent, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InlineArtifactComponent, "mj-inline-artifact", never, { "artifactId": { "alias": "artifactId"; "required": false; }; "versionNumber": { "alias": "versionNumber"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; }, { "actionPerformed": "actionPerformed"; }, never, never, false, never>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=inline-artifact.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-artifact.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/artifact/inline-artifact.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;;AAI7E;;;GAGG;AACH,qBA6Wa,uBAAwB,YAAW,MAAM,EAAE,SAAS;IAiBnD,OAAO,CAAC,aAAa;IAhBxB,UAAU,EAAG,MAAM,CAAC;IACpB,aAAa,CAAC,EA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