@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,208 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Component } from '@angular/core';
|
|
8
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
9
|
+
import { BaseArtifactViewerPluginComponent } from '../base-artifact-viewer.component';
|
|
10
|
+
import { RunView } from '@memberjunction/core';
|
|
11
|
+
import { marked } from 'marked';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "@angular/platform-browser";
|
|
14
|
+
import * as i2 from "@angular/common";
|
|
15
|
+
import * as i3 from "@angular/forms";
|
|
16
|
+
import * as i4 from "@memberjunction/ng-code-editor";
|
|
17
|
+
function JsonArtifactViewerComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
18
|
+
i0.ɵɵelement(0, "div", 5);
|
|
19
|
+
} if (rf & 2) {
|
|
20
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
21
|
+
i0.ɵɵproperty("innerHTML", ctx_r0.renderedMarkdown, i0.ɵɵsanitizeHtml);
|
|
22
|
+
} }
|
|
23
|
+
function JsonArtifactViewerComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
24
|
+
i0.ɵɵelement(0, "div", 6);
|
|
25
|
+
} if (rf & 2) {
|
|
26
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
27
|
+
i0.ɵɵproperty("innerHTML", ctx_r0.displayHtml, i0.ɵɵsanitizeHtml);
|
|
28
|
+
} }
|
|
29
|
+
function JsonArtifactViewerComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
30
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
31
|
+
i0.ɵɵelementStart(0, "div", 7)(1, "mj-code-editor", 8);
|
|
32
|
+
i0.ɵɵtwoWayListener("ngModelChange", function JsonArtifactViewerComponent_Conditional_8_Template_mj_code_editor_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.jsonContent, $event) || (ctx_r0.jsonContent = $event); return i0.ɵɵresetView($event); });
|
|
33
|
+
i0.ɵɵelementEnd()();
|
|
34
|
+
} if (rf & 2) {
|
|
35
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
36
|
+
i0.ɵɵadvance();
|
|
37
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.jsonContent);
|
|
38
|
+
i0.ɵɵproperty("language", "json")("readonly", true);
|
|
39
|
+
} }
|
|
40
|
+
/**
|
|
41
|
+
* Viewer component for JSON artifacts.
|
|
42
|
+
* Supports extract rules - shows displayMarkdown, displayHtml, or raw JSON editor (in that priority order).
|
|
43
|
+
* All content is displayed in the parent's Display tab.
|
|
44
|
+
*/
|
|
45
|
+
let JsonArtifactViewerComponent = class JsonArtifactViewerComponent extends BaseArtifactViewerPluginComponent {
|
|
46
|
+
cdr;
|
|
47
|
+
sanitizer;
|
|
48
|
+
jsonContent = '';
|
|
49
|
+
displayMarkdown = null;
|
|
50
|
+
displayHtml = null;
|
|
51
|
+
renderedMarkdown = null;
|
|
52
|
+
versionAttributes = [];
|
|
53
|
+
constructor(cdr, sanitizer) {
|
|
54
|
+
super();
|
|
55
|
+
this.cdr = cdr;
|
|
56
|
+
this.sanitizer = sanitizer;
|
|
57
|
+
}
|
|
58
|
+
async ngOnInit() {
|
|
59
|
+
this.jsonContent = this.getContent();
|
|
60
|
+
// Load version attributes to check for extract rules
|
|
61
|
+
await this.loadVersionAttributes();
|
|
62
|
+
// Trigger change detection after async load
|
|
63
|
+
this.cdr.detectChanges();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Override to return true when showing extracted displayMarkdown or displayHtml.
|
|
67
|
+
* Returns false when showing raw JSON editor (no extract rules available).
|
|
68
|
+
*/
|
|
69
|
+
get isShowingElevatedDisplay() {
|
|
70
|
+
return !!(this.displayMarkdown || this.displayHtml);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Override to tell parent whether to show raw JSON tab.
|
|
74
|
+
* When showing elevated display (markdown/HTML), return true so parent shows JSON tab.
|
|
75
|
+
* When showing raw JSON editor, return false (no need for duplicate JSON tab).
|
|
76
|
+
*/
|
|
77
|
+
get parentShouldShowRawContent() {
|
|
78
|
+
return this.isShowingElevatedDisplay;
|
|
79
|
+
}
|
|
80
|
+
async loadVersionAttributes() {
|
|
81
|
+
if (!this.artifactVersion?.ID) {
|
|
82
|
+
console.log('📦 JSON Plugin: No artifactVersion.ID, skipping attribute load');
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
console.log(`📦 JSON Plugin: Loading attributes for version ID: ${this.artifactVersion.ID}`);
|
|
86
|
+
try {
|
|
87
|
+
const rv = new RunView();
|
|
88
|
+
const result = await rv.RunView({
|
|
89
|
+
EntityName: 'MJ: Artifact Version Attributes',
|
|
90
|
+
ExtraFilter: `ArtifactVersionID='${this.artifactVersion.ID}'`,
|
|
91
|
+
ResultType: 'entity_object'
|
|
92
|
+
});
|
|
93
|
+
console.log(`📦 JSON Plugin: RunView completed. Success=${result.Success}, Results count=${result.Results?.length || 0}`);
|
|
94
|
+
if (result.Success && result.Results) {
|
|
95
|
+
this.versionAttributes = result.Results;
|
|
96
|
+
console.log(`📦 JSON Plugin: Loaded ${this.versionAttributes.length} attributes for version ${this.artifactVersion.ID}`);
|
|
97
|
+
console.log(`📦 Attributes:`, this.versionAttributes.map(a => ({ name: a.Name, hasValue: !!a.Value })));
|
|
98
|
+
// Check for displayMarkdown or displayHtml attributes (from extract rules)
|
|
99
|
+
const displayMarkdownAttr = this.versionAttributes.find(a => a.Name?.toLowerCase() === 'displaymarkdown');
|
|
100
|
+
const displayHtmlAttr = this.versionAttributes.find(a => a.Name?.toLowerCase() === 'displayhtml');
|
|
101
|
+
console.log(`📦 displayMarkdownAttr:`, displayMarkdownAttr ? { name: displayMarkdownAttr.Name, valueLength: displayMarkdownAttr.Value?.length } : 'not found');
|
|
102
|
+
console.log(`📦 displayHtmlAttr:`, displayHtmlAttr ? { name: displayHtmlAttr.Name, valueLength: displayHtmlAttr.Value?.length } : 'not found');
|
|
103
|
+
// Parse attribute values
|
|
104
|
+
this.displayMarkdown = this.parseAttributeValue(displayMarkdownAttr?.Value);
|
|
105
|
+
this.displayHtml = this.parseAttributeValue(displayHtmlAttr?.Value);
|
|
106
|
+
// Convert markdown to HTML if we have markdown content
|
|
107
|
+
if (this.displayMarkdown) {
|
|
108
|
+
try {
|
|
109
|
+
const html = marked.parse(this.displayMarkdown);
|
|
110
|
+
this.renderedMarkdown = this.sanitizer.sanitize(1, html); // 1 = SecurityContext.HTML
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
console.error('📦 Error converting markdown to HTML:', err);
|
|
114
|
+
// Fallback to plain text
|
|
115
|
+
this.renderedMarkdown = this.displayMarkdown;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
console.log(`📦 JSON Plugin: displayMarkdown=${!!this.displayMarkdown} (${this.displayMarkdown?.length} chars), displayHtml=${!!this.displayHtml} (${this.displayHtml?.length} chars)`);
|
|
119
|
+
console.log(`📦 isShowingElevatedDisplay=${this.isShowingElevatedDisplay}`);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
console.log(`📦 JSON Plugin: No attributes found or query failed. Success=${result.Success}, ResultsLength=${result.Results?.length}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
console.error('📦 JSON Plugin: Error loading version attributes:', err);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
parseAttributeValue(value) {
|
|
130
|
+
if (!value)
|
|
131
|
+
return null;
|
|
132
|
+
try {
|
|
133
|
+
// Try to parse as JSON first
|
|
134
|
+
const parsed = JSON.parse(value);
|
|
135
|
+
if (typeof parsed === 'string') {
|
|
136
|
+
return parsed;
|
|
137
|
+
}
|
|
138
|
+
return JSON.stringify(parsed, null, 2);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// If not valid JSON, return as-is
|
|
142
|
+
return value;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
onCopy() {
|
|
146
|
+
// Copy based on what's being displayed
|
|
147
|
+
const content = this.displayMarkdown || this.displayHtml || this.jsonContent;
|
|
148
|
+
if (content) {
|
|
149
|
+
navigator.clipboard.writeText(content).then(() => {
|
|
150
|
+
console.log('✅ Copied content to clipboard');
|
|
151
|
+
}).catch(err => {
|
|
152
|
+
console.error('Failed to copy to clipboard:', err);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
static ɵfac = function JsonArtifactViewerComponent_Factory(t) { return new (t || JsonArtifactViewerComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.DomSanitizer)); };
|
|
157
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: JsonArtifactViewerComponent, selectors: [["mj-json-artifact-viewer"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 9, vars: 2, consts: [[1, "json-artifact-viewer", 3, "ngClass"], [1, "display-toolbar"], ["title", "Copy Content", 1, "btn-icon", 3, "click"], [1, "fas", "fa-copy"], [1, "display-content"], [1, "markdown-content", 3, "innerHTML"], [1, "html-content", 3, "innerHTML"], [1, "json-editor-container"], [2, "width", "100%", "height", "100%", 3, "ngModelChange", "ngModel", "language", "readonly"]], template: function JsonArtifactViewerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
158
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "button", 2);
|
|
159
|
+
i0.ɵɵlistener("click", function JsonArtifactViewerComponent_Template_button_click_2_listener() { return ctx.onCopy(); });
|
|
160
|
+
i0.ɵɵelement(3, "i", 3);
|
|
161
|
+
i0.ɵɵtext(4, " Copy ");
|
|
162
|
+
i0.ɵɵelementEnd()();
|
|
163
|
+
i0.ɵɵelementStart(5, "div", 4);
|
|
164
|
+
i0.ɵɵtemplate(6, JsonArtifactViewerComponent_Conditional_6_Template, 1, 1, "div", 5)(7, JsonArtifactViewerComponent_Conditional_7_Template, 1, 1, "div", 6)(8, JsonArtifactViewerComponent_Conditional_8_Template, 2, 3, "div", 7);
|
|
165
|
+
i0.ɵɵelementEnd()();
|
|
166
|
+
} if (rf & 2) {
|
|
167
|
+
i0.ɵɵproperty("ngClass", ctx.cssClass);
|
|
168
|
+
i0.ɵɵadvance(6);
|
|
169
|
+
i0.ɵɵconditional(ctx.displayMarkdown ? 6 : ctx.displayHtml ? 7 : 8);
|
|
170
|
+
} }, dependencies: [i2.NgClass, i3.NgControlStatus, i3.NgModel, i4.CodeEditorComponent], styles: [".json-artifact-viewer[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .display-toolbar[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n padding: 8px;\n background: #f8f9fa;\n border-bottom: 1px solid #dee2e6;\n }\n\n .btn-icon[_ngcontent-%COMP%] {\n padding: 6px 12px;\n background: white;\n border: 1px solid #ccc;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .btn-icon[_ngcontent-%COMP%]:hover {\n background: #e9ecef;\n border-color: #999;\n }\n\n .display-content[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n min-height: 0;\n }\n\n .markdown-content[_ngcontent-%COMP%], \n .html-content[_ngcontent-%COMP%] {\n flex: 1;\n padding: 20px;\n overflow: auto;\n min-height: 0;\n background: white;\n }\n\n .json-editor-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n min-height: 0;\n }"] });
|
|
171
|
+
};
|
|
172
|
+
JsonArtifactViewerComponent = __decorate([
|
|
173
|
+
RegisterClass(BaseArtifactViewerPluginComponent, 'JsonArtifactViewerPlugin')
|
|
174
|
+
], JsonArtifactViewerComponent);
|
|
175
|
+
export { JsonArtifactViewerComponent };
|
|
176
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JsonArtifactViewerComponent, [{
|
|
177
|
+
type: Component,
|
|
178
|
+
args: [{ selector: 'mj-json-artifact-viewer', template: `
|
|
179
|
+
<div class="json-artifact-viewer" [ngClass]="cssClass">
|
|
180
|
+
<!-- Display toolbar -->
|
|
181
|
+
<div class="display-toolbar">
|
|
182
|
+
<button class="btn-icon" title="Copy Content" (click)="onCopy()">
|
|
183
|
+
<i class="fas fa-copy"></i> Copy
|
|
184
|
+
</button>
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
<!-- Display content: priority order = displayMarkdown > displayHtml > JSON editor -->
|
|
188
|
+
<div class="display-content">
|
|
189
|
+
@if (displayMarkdown) {
|
|
190
|
+
<div class="markdown-content" [innerHTML]="renderedMarkdown"></div>
|
|
191
|
+
} @else if (displayHtml) {
|
|
192
|
+
<div class="html-content" [innerHTML]="displayHtml"></div>
|
|
193
|
+
} @else {
|
|
194
|
+
<div class="json-editor-container">
|
|
195
|
+
<mj-code-editor
|
|
196
|
+
[(ngModel)]="jsonContent"
|
|
197
|
+
[language]="'json'"
|
|
198
|
+
[readonly]="true"
|
|
199
|
+
style="width: 100%; height: 100%;">
|
|
200
|
+
</mj-code-editor>
|
|
201
|
+
</div>
|
|
202
|
+
}
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
`, styles: ["\n .json-artifact-viewer {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .display-toolbar {\n display: flex;\n justify-content: flex-end;\n padding: 8px;\n background: #f8f9fa;\n border-bottom: 1px solid #dee2e6;\n }\n\n .btn-icon {\n padding: 6px 12px;\n background: white;\n border: 1px solid #ccc;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .btn-icon:hover {\n background: #e9ecef;\n border-color: #999;\n }\n\n .display-content {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n min-height: 0;\n }\n\n .markdown-content,\n .html-content {\n flex: 1;\n padding: 20px;\n overflow: auto;\n min-height: 0;\n background: white;\n }\n\n .json-editor-container {\n flex: 1;\n overflow: auto;\n min-height: 0;\n }\n "] }]
|
|
206
|
+
}], () => [{ type: i0.ChangeDetectorRef }, { type: i1.DomSanitizer }], null); })();
|
|
207
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(JsonArtifactViewerComponent, { className: "JsonArtifactViewerComponent", filePath: "src/lib/components/plugins/json-artifact-viewer.component.ts", lineNumber: 101 }); })();
|
|
208
|
+
//# sourceMappingURL=json-artifact-viewer.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/plugins/json-artifact-viewer.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAA6B,MAAM,eAAe,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;;;IAqBtB,yBAAmE;;;IAArC,sEAA8B;;;IAE5D,yBAA0D;;;IAAhC,iEAAyB;;;;IAGjD,AADF,8BAAmC,wBAKI;IAHnC,kUAAyB;IAK7B,AADE,iBAAiB,EACb;;;IALF,cAAyB;IAAzB,kDAA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BAC9B;YACF,AADE,iBAAS,EACL;YAGN,8BAA6B;YAKzB,AAFA,AAFF,oFAAuB,uEAEG,uEAEjB;YAWb,AADE,iBAAM,EACF;;YAzB4B,sCAAoB;YAUlD,eAaC;YAbD,mEAaC;;;AA6DI,2BAA2B;IADvC,aAAa,CAAC,iCAAiC,EAAE,0BAA0B,CAAC;GAChE,2BAA2B,CA6HvC;;iFA7HY,2BAA2B;cAvFvC,SAAS;2BACE,yBAAyB,YACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT;;kFA0DU,2BAA2B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseArtifactViewerPluginComponent } from '../base-artifact-viewer.component';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Viewer component for Markdown artifacts
|
|
5
|
+
*/
|
|
6
|
+
export declare class MarkdownArtifactViewerComponent extends BaseArtifactViewerPluginComponent {
|
|
7
|
+
markdownContent: string;
|
|
8
|
+
viewMode: 'preview' | 'source';
|
|
9
|
+
ngOnInit(): void;
|
|
10
|
+
onCopy(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MarkdownArtifactViewerComponent, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MarkdownArtifactViewerComponent, "mj-markdown-artifact-viewer", never, {}, {}, never, never, false, never>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=markdown-artifact-viewer.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-artifact-viewer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/plugins/markdown-artifact-viewer.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;;AAEtF;;GAEG;AACH,qBA6Ia,+BAAgC,SAAQ,iCAAiC;IAC7E,eAAe,SAAM;IACrB,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAa;IAElD,QAAQ,IAAI,IAAI;IAIhB,MAAM,IAAI,IAAI;yCARH,+BAA+B;2CAA/B,+BAA+B;CAiB3C"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Component } from '@angular/core';
|
|
8
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
9
|
+
import { BaseArtifactViewerPluginComponent } from '../base-artifact-viewer.component';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@angular/common";
|
|
12
|
+
import * as i2 from "@angular/forms";
|
|
13
|
+
import * as i3 from "ngx-markdown";
|
|
14
|
+
import * as i4 from "@memberjunction/ng-code-editor";
|
|
15
|
+
function MarkdownArtifactViewerComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
16
|
+
i0.ɵɵelementStart(0, "div", 9);
|
|
17
|
+
i0.ɵɵelement(1, "markdown", 11);
|
|
18
|
+
i0.ɵɵelementEnd();
|
|
19
|
+
} if (rf & 2) {
|
|
20
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
21
|
+
i0.ɵɵadvance();
|
|
22
|
+
i0.ɵɵproperty("data", ctx_r0.markdownContent);
|
|
23
|
+
} }
|
|
24
|
+
function MarkdownArtifactViewerComponent_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
25
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
26
|
+
i0.ɵɵelementStart(0, "mj-code-editor", 12);
|
|
27
|
+
i0.ɵɵtwoWayListener("ngModelChange", function MarkdownArtifactViewerComponent_Conditional_13_Template_mj_code_editor_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.markdownContent, $event) || (ctx_r0.markdownContent = $event); return i0.ɵɵresetView($event); });
|
|
28
|
+
i0.ɵɵelementEnd();
|
|
29
|
+
} if (rf & 2) {
|
|
30
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
31
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.markdownContent);
|
|
32
|
+
i0.ɵɵproperty("language", "markdown")("readonly", ctx_r0.readonly);
|
|
33
|
+
} }
|
|
34
|
+
/**
|
|
35
|
+
* Viewer component for Markdown artifacts
|
|
36
|
+
*/
|
|
37
|
+
let MarkdownArtifactViewerComponent = class MarkdownArtifactViewerComponent extends BaseArtifactViewerPluginComponent {
|
|
38
|
+
markdownContent = '';
|
|
39
|
+
viewMode = 'preview';
|
|
40
|
+
ngOnInit() {
|
|
41
|
+
this.markdownContent = this.getContent();
|
|
42
|
+
}
|
|
43
|
+
onCopy() {
|
|
44
|
+
if (this.markdownContent) {
|
|
45
|
+
navigator.clipboard.writeText(this.markdownContent).then(() => {
|
|
46
|
+
console.log('✅ Copied markdown to clipboard');
|
|
47
|
+
}).catch(err => {
|
|
48
|
+
console.error('Failed to copy to clipboard:', err);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
static ɵfac = /*@__PURE__*/ (() => { let ɵMarkdownArtifactViewerComponent_BaseFactory; return function MarkdownArtifactViewerComponent_Factory(t) { return (ɵMarkdownArtifactViewerComponent_BaseFactory || (ɵMarkdownArtifactViewerComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MarkdownArtifactViewerComponent)))(t || MarkdownArtifactViewerComponent); }; })();
|
|
53
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MarkdownArtifactViewerComponent, selectors: [["mj-markdown-artifact-viewer"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 14, vars: 6, consts: [[1, "markdown-artifact-viewer", 3, "ngClass"], [1, "markdown-toolbar"], ["title", "Preview", 1, "btn-icon", 3, "click"], [1, "fas", "fa-eye"], ["title", "Source", 1, "btn-icon", 3, "click"], [1, "fas", "fa-code"], ["title", "Copy Markdown", 1, "btn-icon", 3, "click"], [1, "fas", "fa-copy"], [1, "markdown-content-container"], [1, "markdown-preview"], [2, "width", "100%", "height", "100%", 3, "ngModel", "language", "readonly"], [3, "data"], [2, "width", "100%", "height", "100%", 3, "ngModelChange", "ngModel", "language", "readonly"]], template: function MarkdownArtifactViewerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
54
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "button", 2);
|
|
55
|
+
i0.ɵɵlistener("click", function MarkdownArtifactViewerComponent_Template_button_click_2_listener() { return ctx.viewMode = "preview"; });
|
|
56
|
+
i0.ɵɵelement(3, "i", 3);
|
|
57
|
+
i0.ɵɵtext(4, " Preview ");
|
|
58
|
+
i0.ɵɵelementEnd();
|
|
59
|
+
i0.ɵɵelementStart(5, "button", 4);
|
|
60
|
+
i0.ɵɵlistener("click", function MarkdownArtifactViewerComponent_Template_button_click_5_listener() { return ctx.viewMode = "source"; });
|
|
61
|
+
i0.ɵɵelement(6, "i", 5);
|
|
62
|
+
i0.ɵɵtext(7, " Source ");
|
|
63
|
+
i0.ɵɵelementEnd();
|
|
64
|
+
i0.ɵɵelementStart(8, "button", 6);
|
|
65
|
+
i0.ɵɵlistener("click", function MarkdownArtifactViewerComponent_Template_button_click_8_listener() { return ctx.onCopy(); });
|
|
66
|
+
i0.ɵɵelement(9, "i", 7);
|
|
67
|
+
i0.ɵɵtext(10, " Copy ");
|
|
68
|
+
i0.ɵɵelementEnd()();
|
|
69
|
+
i0.ɵɵelementStart(11, "div", 8);
|
|
70
|
+
i0.ɵɵtemplate(12, MarkdownArtifactViewerComponent_Conditional_12_Template, 2, 1, "div", 9)(13, MarkdownArtifactViewerComponent_Conditional_13_Template, 1, 3, "mj-code-editor", 10);
|
|
71
|
+
i0.ɵɵelementEnd()();
|
|
72
|
+
} if (rf & 2) {
|
|
73
|
+
i0.ɵɵproperty("ngClass", ctx.cssClass);
|
|
74
|
+
i0.ɵɵadvance(2);
|
|
75
|
+
i0.ɵɵclassProp("active", ctx.viewMode === "preview");
|
|
76
|
+
i0.ɵɵadvance(3);
|
|
77
|
+
i0.ɵɵclassProp("active", ctx.viewMode === "source");
|
|
78
|
+
i0.ɵɵadvance(7);
|
|
79
|
+
i0.ɵɵconditional(ctx.viewMode === "preview" ? 12 : 13);
|
|
80
|
+
} }, dependencies: [i1.NgClass, i2.NgControlStatus, i2.NgModel, i3.MarkdownComponent, i4.CodeEditorComponent], styles: [".markdown-artifact-viewer[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .markdown-toolbar[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 8px;\n padding: 8px;\n background: #f5f5f5;\n border-bottom: 1px solid #ddd;\n }\n\n .btn-icon[_ngcontent-%COMP%] {\n padding: 6px 12px;\n background: white;\n border: 1px solid #ccc;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .btn-icon[_ngcontent-%COMP%]:hover {\n background: #e9ecef;\n border-color: #999;\n }\n\n .btn-icon.active[_ngcontent-%COMP%] {\n background: #007acc;\n color: white;\n border-color: #007acc;\n }\n\n .markdown-content-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n }\n\n .markdown-preview[_ngcontent-%COMP%] {\n padding: 20px;\n background: white;\n height: 100%;\n overflow: auto;\n }\n\n .markdown-preview[_ngcontent-%COMP%] h1 {\n font-size: 2em;\n margin-top: 0.67em;\n margin-bottom: 0.67em;\n border-bottom: 1px solid #eaecef;\n padding-bottom: 0.3em;\n }\n\n .markdown-preview[_ngcontent-%COMP%] h2 {\n font-size: 1.5em;\n margin-top: 0.83em;\n margin-bottom: 0.83em;\n border-bottom: 1px solid #eaecef;\n padding-bottom: 0.3em;\n }\n\n .markdown-preview[_ngcontent-%COMP%] code {\n background: #f6f8fa;\n padding: 2px 6px;\n border-radius: 3px;\n font-family: monospace;\n }\n\n .markdown-preview[_ngcontent-%COMP%] pre {\n background: #f6f8fa;\n padding: 16px;\n border-radius: 6px;\n overflow: auto;\n }\n\n .markdown-preview[_ngcontent-%COMP%] blockquote {\n border-left: 4px solid #dfe2e5;\n padding-left: 16px;\n color: #6a737d;\n margin: 0;\n }\n\n .markdown-preview[_ngcontent-%COMP%] table {\n border-collapse: collapse;\n width: 100%;\n margin: 16px 0;\n }\n\n .markdown-preview[_ngcontent-%COMP%] th, \n .markdown-preview[_ngcontent-%COMP%] td {\n border: 1px solid #dfe2e5;\n padding: 8px 16px;\n }\n\n .markdown-preview[_ngcontent-%COMP%] th {\n background: #f6f8fa;\n font-weight: 600;\n }"] });
|
|
81
|
+
};
|
|
82
|
+
MarkdownArtifactViewerComponent = __decorate([
|
|
83
|
+
RegisterClass(BaseArtifactViewerPluginComponent, 'MarkdownArtifactViewerPlugin')
|
|
84
|
+
], MarkdownArtifactViewerComponent);
|
|
85
|
+
export { MarkdownArtifactViewerComponent };
|
|
86
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MarkdownArtifactViewerComponent, [{
|
|
87
|
+
type: Component,
|
|
88
|
+
args: [{ selector: 'mj-markdown-artifact-viewer', template: `
|
|
89
|
+
<div class="markdown-artifact-viewer" [ngClass]="cssClass">
|
|
90
|
+
<div class="markdown-toolbar">
|
|
91
|
+
<button class="btn-icon" [class.active]="viewMode === 'preview'"
|
|
92
|
+
title="Preview" (click)="viewMode = 'preview'">
|
|
93
|
+
<i class="fas fa-eye"></i> Preview
|
|
94
|
+
</button>
|
|
95
|
+
<button class="btn-icon" [class.active]="viewMode === 'source'"
|
|
96
|
+
title="Source" (click)="viewMode = 'source'">
|
|
97
|
+
<i class="fas fa-code"></i> Source
|
|
98
|
+
</button>
|
|
99
|
+
<button class="btn-icon" title="Copy Markdown" (click)="onCopy()">
|
|
100
|
+
<i class="fas fa-copy"></i> Copy
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
<div class="markdown-content-container">
|
|
104
|
+
@if (viewMode === 'preview') {
|
|
105
|
+
<div class="markdown-preview">
|
|
106
|
+
<markdown [data]="markdownContent"></markdown>
|
|
107
|
+
</div>
|
|
108
|
+
} @else {
|
|
109
|
+
<mj-code-editor
|
|
110
|
+
[(ngModel)]="markdownContent"
|
|
111
|
+
[language]="'markdown'"
|
|
112
|
+
[readonly]="readonly"
|
|
113
|
+
style="width: 100%; height: 100%;">
|
|
114
|
+
</mj-code-editor>
|
|
115
|
+
}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
`, styles: ["\n .markdown-artifact-viewer {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .markdown-toolbar {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 8px;\n padding: 8px;\n background: #f5f5f5;\n border-bottom: 1px solid #ddd;\n }\n\n .btn-icon {\n padding: 6px 12px;\n background: white;\n border: 1px solid #ccc;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .btn-icon:hover {\n background: #e9ecef;\n border-color: #999;\n }\n\n .btn-icon.active {\n background: #007acc;\n color: white;\n border-color: #007acc;\n }\n\n .markdown-content-container {\n flex: 1;\n overflow: auto;\n }\n\n .markdown-preview {\n padding: 20px;\n background: white;\n height: 100%;\n overflow: auto;\n }\n\n .markdown-preview ::ng-deep h1 {\n font-size: 2em;\n margin-top: 0.67em;\n margin-bottom: 0.67em;\n border-bottom: 1px solid #eaecef;\n padding-bottom: 0.3em;\n }\n\n .markdown-preview ::ng-deep h2 {\n font-size: 1.5em;\n margin-top: 0.83em;\n margin-bottom: 0.83em;\n border-bottom: 1px solid #eaecef;\n padding-bottom: 0.3em;\n }\n\n .markdown-preview ::ng-deep code {\n background: #f6f8fa;\n padding: 2px 6px;\n border-radius: 3px;\n font-family: monospace;\n }\n\n .markdown-preview ::ng-deep pre {\n background: #f6f8fa;\n padding: 16px;\n border-radius: 6px;\n overflow: auto;\n }\n\n .markdown-preview ::ng-deep blockquote {\n border-left: 4px solid #dfe2e5;\n padding-left: 16px;\n color: #6a737d;\n margin: 0;\n }\n\n .markdown-preview ::ng-deep table {\n border-collapse: collapse;\n width: 100%;\n margin: 16px 0;\n }\n\n .markdown-preview ::ng-deep th,\n .markdown-preview ::ng-deep td {\n border: 1px solid #dfe2e5;\n padding: 8px 16px;\n }\n\n .markdown-preview ::ng-deep th {\n background: #f6f8fa;\n font-weight: 600;\n }\n "] }]
|
|
119
|
+
}], null, null); })();
|
|
120
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MarkdownArtifactViewerComponent, { className: "MarkdownArtifactViewerComponent", filePath: "src/lib/components/plugins/markdown-artifact-viewer.component.ts", lineNumber: 149 }); })();
|
|
121
|
+
//# sourceMappingURL=markdown-artifact-viewer.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/plugins/markdown-artifact-viewer.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;;;;;;;IAwB5E,8BAA8B;IAC5B,+BAA8C;IAChD,iBAAM;;;IADM,cAAwB;IAAxB,6CAAwB;;;;IAGpC,0CAIqC;IAHnC,+UAA6B;IAI/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B3C;;iFAjBY,+BAA+B;cA7I3C,SAAS;2BACE,6BAA6B,YAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BT;;kFA6GU,+BAA+B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
2
|
+
import { BaseArtifactViewerPluginComponent } from '../base-artifact-viewer.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Viewer component for SVG artifacts
|
|
6
|
+
*/
|
|
7
|
+
export declare class SvgArtifactViewerComponent extends BaseArtifactViewerPluginComponent {
|
|
8
|
+
private sanitizer;
|
|
9
|
+
svgContent: string;
|
|
10
|
+
safeSvgContent: SafeHtml;
|
|
11
|
+
viewMode: 'preview' | 'source';
|
|
12
|
+
constructor(sanitizer: DomSanitizer);
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
onCopy(): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SvgArtifactViewerComponent, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SvgArtifactViewerComponent, "mj-svg-artifact-viewer", never, {}, {}, never, never, false, never>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=svg-artifact-viewer.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-artifact-viewer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/plugins/svg-artifact-viewer.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;;AAEtF;;GAEG;AACH,qBAqGa,0BAA2B,SAAQ,iCAAiC;IAKnE,OAAO,CAAC,SAAS;IAJtB,UAAU,SAAM;IAChB,cAAc,EAAE,QAAQ,CAAM;IAC9B,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAa;gBAE9B,SAAS,EAAE,YAAY;IAI3C,QAAQ,IAAI,IAAI;IAMhB,MAAM,IAAI,IAAI;yCAfH,0BAA0B;2CAA1B,0BAA0B;CAwBtC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Component } from '@angular/core';
|
|
8
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
9
|
+
import { BaseArtifactViewerPluginComponent } from '../base-artifact-viewer.component';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@angular/platform-browser";
|
|
12
|
+
import * as i2 from "@angular/common";
|
|
13
|
+
import * as i3 from "@angular/forms";
|
|
14
|
+
import * as i4 from "@memberjunction/ng-code-editor";
|
|
15
|
+
function SvgArtifactViewerComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
16
|
+
i0.ɵɵelementStart(0, "div", 9);
|
|
17
|
+
i0.ɵɵelement(1, "div", 11);
|
|
18
|
+
i0.ɵɵelementEnd();
|
|
19
|
+
} if (rf & 2) {
|
|
20
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
21
|
+
i0.ɵɵadvance();
|
|
22
|
+
i0.ɵɵproperty("innerHTML", ctx_r0.safeSvgContent, i0.ɵɵsanitizeHtml);
|
|
23
|
+
} }
|
|
24
|
+
function SvgArtifactViewerComponent_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
25
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
26
|
+
i0.ɵɵelementStart(0, "mj-code-editor", 12);
|
|
27
|
+
i0.ɵɵtwoWayListener("ngModelChange", function SvgArtifactViewerComponent_Conditional_13_Template_mj_code_editor_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.svgContent, $event) || (ctx_r0.svgContent = $event); return i0.ɵɵresetView($event); });
|
|
28
|
+
i0.ɵɵelementEnd();
|
|
29
|
+
} if (rf & 2) {
|
|
30
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
31
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.svgContent);
|
|
32
|
+
i0.ɵɵproperty("language", "xml")("readonly", ctx_r0.readonly);
|
|
33
|
+
} }
|
|
34
|
+
/**
|
|
35
|
+
* Viewer component for SVG artifacts
|
|
36
|
+
*/
|
|
37
|
+
let SvgArtifactViewerComponent = class SvgArtifactViewerComponent extends BaseArtifactViewerPluginComponent {
|
|
38
|
+
sanitizer;
|
|
39
|
+
svgContent = '';
|
|
40
|
+
safeSvgContent = '';
|
|
41
|
+
viewMode = 'preview';
|
|
42
|
+
constructor(sanitizer) {
|
|
43
|
+
super();
|
|
44
|
+
this.sanitizer = sanitizer;
|
|
45
|
+
}
|
|
46
|
+
ngOnInit() {
|
|
47
|
+
this.svgContent = this.getContent();
|
|
48
|
+
// For SVG, we use sanitize with SecurityContext.HTML (1) to allow safe rendering
|
|
49
|
+
this.safeSvgContent = this.sanitizer.sanitize(1, this.svgContent) || '';
|
|
50
|
+
}
|
|
51
|
+
onCopy() {
|
|
52
|
+
if (this.svgContent) {
|
|
53
|
+
navigator.clipboard.writeText(this.svgContent).then(() => {
|
|
54
|
+
console.log('✅ Copied SVG to clipboard');
|
|
55
|
+
}).catch(err => {
|
|
56
|
+
console.error('Failed to copy to clipboard:', err);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
static ɵfac = function SvgArtifactViewerComponent_Factory(t) { return new (t || SvgArtifactViewerComponent)(i0.ɵɵdirectiveInject(i1.DomSanitizer)); };
|
|
61
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SvgArtifactViewerComponent, selectors: [["mj-svg-artifact-viewer"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 14, vars: 6, consts: [[1, "svg-artifact-viewer", 3, "ngClass"], [1, "svg-toolbar"], ["title", "Preview", 1, "btn-icon", 3, "click"], [1, "fas", "fa-eye"], ["title", "Source", 1, "btn-icon", 3, "click"], [1, "fas", "fa-code"], ["title", "Copy SVG", 1, "btn-icon", 3, "click"], [1, "fas", "fa-copy"], [1, "svg-content-container"], [1, "svg-preview"], [2, "width", "100%", "height", "100%", 3, "ngModel", "language", "readonly"], [1, "svg-wrapper", 3, "innerHTML"], [2, "width", "100%", "height", "100%", 3, "ngModelChange", "ngModel", "language", "readonly"]], template: function SvgArtifactViewerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
62
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "button", 2);
|
|
63
|
+
i0.ɵɵlistener("click", function SvgArtifactViewerComponent_Template_button_click_2_listener() { return ctx.viewMode = "preview"; });
|
|
64
|
+
i0.ɵɵelement(3, "i", 3);
|
|
65
|
+
i0.ɵɵtext(4, " Preview ");
|
|
66
|
+
i0.ɵɵelementEnd();
|
|
67
|
+
i0.ɵɵelementStart(5, "button", 4);
|
|
68
|
+
i0.ɵɵlistener("click", function SvgArtifactViewerComponent_Template_button_click_5_listener() { return ctx.viewMode = "source"; });
|
|
69
|
+
i0.ɵɵelement(6, "i", 5);
|
|
70
|
+
i0.ɵɵtext(7, " Source ");
|
|
71
|
+
i0.ɵɵelementEnd();
|
|
72
|
+
i0.ɵɵelementStart(8, "button", 6);
|
|
73
|
+
i0.ɵɵlistener("click", function SvgArtifactViewerComponent_Template_button_click_8_listener() { return ctx.onCopy(); });
|
|
74
|
+
i0.ɵɵelement(9, "i", 7);
|
|
75
|
+
i0.ɵɵtext(10, " Copy ");
|
|
76
|
+
i0.ɵɵelementEnd()();
|
|
77
|
+
i0.ɵɵelementStart(11, "div", 8);
|
|
78
|
+
i0.ɵɵtemplate(12, SvgArtifactViewerComponent_Conditional_12_Template, 2, 1, "div", 9)(13, SvgArtifactViewerComponent_Conditional_13_Template, 1, 3, "mj-code-editor", 10);
|
|
79
|
+
i0.ɵɵelementEnd()();
|
|
80
|
+
} if (rf & 2) {
|
|
81
|
+
i0.ɵɵproperty("ngClass", ctx.cssClass);
|
|
82
|
+
i0.ɵɵadvance(2);
|
|
83
|
+
i0.ɵɵclassProp("active", ctx.viewMode === "preview");
|
|
84
|
+
i0.ɵɵadvance(3);
|
|
85
|
+
i0.ɵɵclassProp("active", ctx.viewMode === "source");
|
|
86
|
+
i0.ɵɵadvance(7);
|
|
87
|
+
i0.ɵɵconditional(ctx.viewMode === "preview" ? 12 : 13);
|
|
88
|
+
} }, dependencies: [i2.NgClass, i3.NgControlStatus, i3.NgModel, i4.CodeEditorComponent], styles: [".svg-artifact-viewer[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .svg-toolbar[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 8px;\n padding: 8px;\n background: #f5f5f5;\n border-bottom: 1px solid #ddd;\n }\n\n .btn-icon[_ngcontent-%COMP%] {\n padding: 6px 12px;\n background: white;\n border: 1px solid #ccc;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .btn-icon[_ngcontent-%COMP%]:hover {\n background: #e9ecef;\n border-color: #999;\n }\n\n .btn-icon.active[_ngcontent-%COMP%] {\n background: #007acc;\n color: white;\n border-color: #007acc;\n }\n\n .svg-content-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n }\n\n .svg-preview[_ngcontent-%COMP%] {\n padding: 20px;\n background: white;\n height: 100%;\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .svg-wrapper[_ngcontent-%COMP%] {\n max-width: 100%;\n max-height: 100%;\n }\n\n .svg-wrapper[_ngcontent-%COMP%] svg {\n max-width: 100%;\n max-height: 100%;\n height: auto;\n }"] });
|
|
89
|
+
};
|
|
90
|
+
SvgArtifactViewerComponent = __decorate([
|
|
91
|
+
RegisterClass(BaseArtifactViewerPluginComponent, 'SvgArtifactViewerPlugin')
|
|
92
|
+
], SvgArtifactViewerComponent);
|
|
93
|
+
export { SvgArtifactViewerComponent };
|
|
94
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SvgArtifactViewerComponent, [{
|
|
95
|
+
type: Component,
|
|
96
|
+
args: [{ selector: 'mj-svg-artifact-viewer', template: `
|
|
97
|
+
<div class="svg-artifact-viewer" [ngClass]="cssClass">
|
|
98
|
+
<div class="svg-toolbar">
|
|
99
|
+
<button class="btn-icon" [class.active]="viewMode === 'preview'"
|
|
100
|
+
title="Preview" (click)="viewMode = 'preview'">
|
|
101
|
+
<i class="fas fa-eye"></i> Preview
|
|
102
|
+
</button>
|
|
103
|
+
<button class="btn-icon" [class.active]="viewMode === 'source'"
|
|
104
|
+
title="Source" (click)="viewMode = 'source'">
|
|
105
|
+
<i class="fas fa-code"></i> Source
|
|
106
|
+
</button>
|
|
107
|
+
<button class="btn-icon" title="Copy SVG" (click)="onCopy()">
|
|
108
|
+
<i class="fas fa-copy"></i> Copy
|
|
109
|
+
</button>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="svg-content-container">
|
|
112
|
+
@if (viewMode === 'preview') {
|
|
113
|
+
<div class="svg-preview">
|
|
114
|
+
<div class="svg-wrapper" [innerHTML]="safeSvgContent"></div>
|
|
115
|
+
</div>
|
|
116
|
+
} @else {
|
|
117
|
+
<mj-code-editor
|
|
118
|
+
[(ngModel)]="svgContent"
|
|
119
|
+
[language]="'xml'"
|
|
120
|
+
[readonly]="readonly"
|
|
121
|
+
style="width: 100%; height: 100%;">
|
|
122
|
+
</mj-code-editor>
|
|
123
|
+
}
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
`, styles: ["\n .svg-artifact-viewer {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .svg-toolbar {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 8px;\n padding: 8px;\n background: #f5f5f5;\n border-bottom: 1px solid #ddd;\n }\n\n .btn-icon {\n padding: 6px 12px;\n background: white;\n border: 1px solid #ccc;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .btn-icon:hover {\n background: #e9ecef;\n border-color: #999;\n }\n\n .btn-icon.active {\n background: #007acc;\n color: white;\n border-color: #007acc;\n }\n\n .svg-content-container {\n flex: 1;\n overflow: auto;\n }\n\n .svg-preview {\n padding: 20px;\n background: white;\n height: 100%;\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .svg-wrapper {\n max-width: 100%;\n max-height: 100%;\n }\n\n .svg-wrapper ::ng-deep svg {\n max-width: 100%;\n max-height: 100%;\n height: auto;\n }\n "] }]
|
|
127
|
+
}], () => [{ type: i1.DomSanitizer }], null); })();
|
|
128
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SvgArtifactViewerComponent, { className: "SvgArtifactViewerComponent", filePath: "src/lib/components/plugins/svg-artifact-viewer.component.ts", lineNumber: 110 }); })();
|
|
129
|
+
//# sourceMappingURL=svg-artifact-viewer.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/plugins/svg-artifact-viewer.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,aAAa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AC7B;YAAA,iBAAS;YACT,iCACqD;YAA9B,sHAAoB,QAAQ,IAAC;YAClD,uBAA2B;YAAC,wBAC9B;YAAA,iBAAS;YACT,iCAA6D;YAAnB,uGAAS,YAAQ,IAAC;YAC1D,uBAA2B;YAAC,uBAC9B;YACF,AADE,iBAAS,EACL;YACN,+BAAmC;YAK/B,AAJF,qFAA8B,oFAIrB;YASb,AADE,iBAAM,EACF;;YA5B2B,sCAAoB;YAExB,eAAuC;YAAvC,oDAAuC;YAIvC,eAAsC;YAAtC,mDAAsC;YAS/D,eAWC;YAXD,sDAWC;;;AAwEI,0BAA0B;IADtC,aAAa,CAAC,iCAAiC,EAAE,yBAAyB,CAAC;GAC/D,0BAA0B,CAwBtC;;iFAxBY,0BAA0B;cArGtC,SAAS;2BACE,wBAAwB,YACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BT;;kFAqEU,0BAA0B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { ArtifactVersionEntity } from '@memberjunction/core-entities';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for artifact viewer plugins.
|
|
5
|
+
* All artifact viewer plugins must implement this interface and be registered
|
|
6
|
+
* with @RegisterClass decorator from @memberjunction/global.
|
|
7
|
+
*/
|
|
8
|
+
export interface IArtifactViewerPlugin {
|
|
9
|
+
/**
|
|
10
|
+
* The Angular component class that will be dynamically loaded to render the artifact.
|
|
11
|
+
* Must be a component type that accepts artifact input.
|
|
12
|
+
*/
|
|
13
|
+
readonly componentType: Type<any>;
|
|
14
|
+
/**
|
|
15
|
+
* Determines if this plugin can handle the given artifact type and content type.
|
|
16
|
+
* @param artifactTypeName The artifact type name (e.g., 'JSON', 'Code', etc.)
|
|
17
|
+
* @param contentType The content type (e.g., 'application/json', 'text/x-python', etc.)
|
|
18
|
+
* @returns true if this plugin can render the artifact
|
|
19
|
+
*/
|
|
20
|
+
canHandle(artifactTypeName: string, contentType?: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Optional: Get display metadata for the artifact (title, icon, etc.)
|
|
23
|
+
* @param artifactVersion The artifact version to get metadata for
|
|
24
|
+
* @returns Display metadata object
|
|
25
|
+
*/
|
|
26
|
+
getMetadata?(artifactVersion: ArtifactVersionEntity): ArtifactMetadata;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Metadata about an artifact for display purposes
|
|
30
|
+
*/
|
|
31
|
+
export interface ArtifactMetadata {
|
|
32
|
+
title?: string;
|
|
33
|
+
icon?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
additionalInfo?: Record<string, any>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Base interface that all artifact viewer components must implement.
|
|
39
|
+
* The component receives the artifact version as an input.
|
|
40
|
+
*/
|
|
41
|
+
export interface IArtifactViewerComponent {
|
|
42
|
+
artifactVersion: ArtifactVersionEntity;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=artifact-viewer-plugin.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-viewer-plugin.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/artifact-viewer-plugin.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAElC;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAEnE;;;;OAIG;IACH,WAAW,CAAC,CAAC,eAAe,EAAE,qBAAqB,GAAG,gBAAgB,CAAC;CACxE;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,qBAAqB,CAAC;CACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-viewer-plugin.interface.js","sourceRoot":"","sources":["../../../src/lib/interfaces/artifact-viewer-plugin.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './lib/artifacts.module';
|
|
2
|
+
export * from './lib/interfaces/artifact-viewer-plugin.interface';
|
|
3
|
+
export * from './lib/components/base-artifact-viewer.component';
|
|
4
|
+
export * from './lib/components/artifact-type-plugin-viewer.component';
|
|
5
|
+
export * from './lib/components/artifact-viewer-panel.component';
|
|
6
|
+
export * from './lib/components/artifact-version-history.component';
|
|
7
|
+
export * from './lib/components/artifact-message-card.component';
|
|
8
|
+
export * from './lib/components/plugins/json-artifact-viewer.component';
|
|
9
|
+
export * from './lib/components/plugins/code-artifact-viewer.component';
|
|
10
|
+
export * from './lib/components/plugins/markdown-artifact-viewer.component';
|
|
11
|
+
export * from './lib/components/plugins/html-artifact-viewer.component';
|
|
12
|
+
export * from './lib/components/plugins/svg-artifact-viewer.component';
|
|
13
|
+
export * from './lib/components/plugins/component-artifact-viewer.component';
|
|
14
|
+
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,wBAAwB,CAAC;AAGvC,cAAc,mDAAmD,CAAC;AAGlE,cAAc,iDAAiD,CAAC;AAGhE,cAAc,wDAAwD,CAAC;AAGvE,cAAc,kDAAkD,CAAC;AACjE,cAAc,qDAAqD,CAAC;AACpE,cAAc,kDAAkD,CAAC;AAGjE,cAAc,yDAAyD,CAAC;AACxE,cAAc,yDAAyD,CAAC;AACxE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,yDAAyD,CAAC;AACxE,cAAc,wDAAwD,CAAC;AACvE,cAAc,8DAA8D,CAAC"}
|