@memberjunction/ng-artifacts 2.107.0 → 2.109.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 +2 -1
- package/dist/lib/artifacts.module.d.ts.map +1 -1
- package/dist/lib/artifacts.module.js +7 -3
- package/dist/lib/artifacts.module.js.map +1 -1
- package/dist/lib/components/artifact-type-plugin-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/artifact-type-plugin-viewer.component.js +3 -3
- package/dist/lib/components/artifact-type-plugin-viewer.component.js.map +1 -1
- package/dist/lib/components/artifact-viewer-panel.component.d.ts +81 -13
- package/dist/lib/components/artifact-viewer-panel.component.d.ts.map +1 -1
- package/dist/lib/components/artifact-viewer-panel.component.js +609 -314
- package/dist/lib/components/artifact-viewer-panel.component.js.map +1 -1
- package/dist/lib/components/base-artifact-viewer.component.d.ts +17 -0
- package/dist/lib/components/base-artifact-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/base-artifact-viewer.component.js +1 -1
- package/dist/lib/components/base-artifact-viewer.component.js.map +1 -1
- package/dist/lib/components/plugins/component-artifact-viewer.component.d.ts +15 -18
- package/dist/lib/components/plugins/component-artifact-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/plugins/component-artifact-viewer.component.js +112 -182
- package/dist/lib/components/plugins/component-artifact-viewer.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
|
@@ -4,25 +4,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Component, ViewChild } from '@angular/core';
|
|
7
|
+
import { Component, ViewChild, Output, EventEmitter } from '@angular/core';
|
|
8
8
|
import { RegisterClass, SafeJSONParse } from '@memberjunction/global';
|
|
9
9
|
import { BaseArtifactViewerPluginComponent } from '../base-artifact-viewer.component';
|
|
10
10
|
import { BuildComponentCompleteCode } from '@memberjunction/interactive-component-types';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
12
|
import * as i1 from "@memberjunction/ng-react";
|
|
13
13
|
import * as i2 from "@angular/common";
|
|
14
|
-
import * as i3 from "@angular/forms";
|
|
15
|
-
import * as i4 from "@memberjunction/ng-code-editor";
|
|
16
14
|
const _c0 = ["reactComponent"];
|
|
17
|
-
function
|
|
18
|
-
const _r1 = i0.ɵɵgetCurrentView();
|
|
19
|
-
i0.ɵɵelementStart(0, "button", 10);
|
|
20
|
-
i0.ɵɵlistener("click", function ComponentArtifactViewerComponent_Conditional_8_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onCopy()); });
|
|
21
|
-
i0.ɵɵelement(1, "i", 11);
|
|
22
|
-
i0.ɵɵtext(2, " Copy ");
|
|
23
|
-
i0.ɵɵelementEnd();
|
|
24
|
-
} }
|
|
25
|
-
function ComponentArtifactViewerComponent_Conditional_10_Conditional_1_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
15
|
+
function ComponentArtifactViewerComponent_Conditional_2_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
26
16
|
i0.ɵɵelementStart(0, "details")(1, "summary");
|
|
27
17
|
i0.ɵɵtext(2, "Technical Details");
|
|
28
18
|
i0.ɵɵelementEnd();
|
|
@@ -30,40 +20,40 @@ function ComponentArtifactViewerComponent_Conditional_10_Conditional_1_Condition
|
|
|
30
20
|
i0.ɵɵtext(4);
|
|
31
21
|
i0.ɵɵelementEnd()();
|
|
32
22
|
} if (rf & 2) {
|
|
33
|
-
const
|
|
23
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
34
24
|
i0.ɵɵadvance(4);
|
|
35
|
-
i0.ɵɵtextInterpolate(
|
|
25
|
+
i0.ɵɵtextInterpolate(ctx_r0.errorDetails);
|
|
36
26
|
} }
|
|
37
|
-
function
|
|
38
|
-
i0.ɵɵelementStart(0, "div",
|
|
39
|
-
i0.ɵɵelement(1, "i",
|
|
27
|
+
function ComponentArtifactViewerComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
28
|
+
i0.ɵɵelementStart(0, "div", 3);
|
|
29
|
+
i0.ɵɵelement(1, "i", 4);
|
|
40
30
|
i0.ɵɵelementStart(2, "h3");
|
|
41
31
|
i0.ɵɵtext(3, "Component Error");
|
|
42
32
|
i0.ɵɵelementEnd();
|
|
43
33
|
i0.ɵɵelementStart(4, "p");
|
|
44
34
|
i0.ɵɵtext(5);
|
|
45
35
|
i0.ɵɵelementEnd();
|
|
46
|
-
i0.ɵɵtemplate(6,
|
|
36
|
+
i0.ɵɵtemplate(6, ComponentArtifactViewerComponent_Conditional_2_Conditional_6_Template, 5, 1, "details");
|
|
47
37
|
i0.ɵɵelementEnd();
|
|
48
38
|
} if (rf & 2) {
|
|
49
|
-
const
|
|
39
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
50
40
|
i0.ɵɵadvance(5);
|
|
51
|
-
i0.ɵɵtextInterpolate(
|
|
41
|
+
i0.ɵɵtextInterpolate(ctx_r0.errorMessage);
|
|
52
42
|
i0.ɵɵadvance();
|
|
53
|
-
i0.ɵɵconditional(
|
|
43
|
+
i0.ɵɵconditional(ctx_r0.errorDetails ? 6 : -1);
|
|
54
44
|
} }
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
i0.ɵɵelementStart(0, "mj-react-component",
|
|
58
|
-
i0.ɵɵlistener("componentEvent", function
|
|
45
|
+
function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
46
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
47
|
+
i0.ɵɵelementStart(0, "mj-react-component", 6, 0);
|
|
48
|
+
i0.ɵɵlistener("componentEvent", function ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template_mj_react_component_componentEvent_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onComponentEvent($event)); });
|
|
59
49
|
i0.ɵɵelementEnd();
|
|
60
50
|
} if (rf & 2) {
|
|
61
|
-
const
|
|
62
|
-
i0.ɵɵproperty("component",
|
|
51
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
52
|
+
i0.ɵɵproperty("component", ctx_r0.component);
|
|
63
53
|
} }
|
|
64
|
-
function
|
|
65
|
-
i0.ɵɵelementStart(0, "div",
|
|
66
|
-
i0.ɵɵelement(1, "i",
|
|
54
|
+
function ComponentArtifactViewerComponent_Conditional_3_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
55
|
+
i0.ɵɵelementStart(0, "div", 3);
|
|
56
|
+
i0.ɵɵelement(1, "i", 7);
|
|
67
57
|
i0.ɵɵelementStart(2, "h3");
|
|
68
58
|
i0.ɵɵtext(3, "No Component Loaded");
|
|
69
59
|
i0.ɵɵelementEnd();
|
|
@@ -71,41 +61,29 @@ function ComponentArtifactViewerComponent_Conditional_10_Conditional_2_Condition
|
|
|
71
61
|
i0.ɵɵtext(5, "The component data is missing or invalid.");
|
|
72
62
|
i0.ɵɵelementEnd()();
|
|
73
63
|
} }
|
|
74
|
-
function
|
|
75
|
-
i0.ɵɵtemplate(0,
|
|
76
|
-
} if (rf & 2) {
|
|
77
|
-
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
78
|
-
i0.ɵɵconditional(ctx_r1.component ? 0 : 1);
|
|
79
|
-
} }
|
|
80
|
-
function ComponentArtifactViewerComponent_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
81
|
-
i0.ɵɵelementStart(0, "div", 8);
|
|
82
|
-
i0.ɵɵtemplate(1, ComponentArtifactViewerComponent_Conditional_10_Conditional_1_Template, 7, 2, "div", 12)(2, ComponentArtifactViewerComponent_Conditional_10_Conditional_2_Template, 2, 1);
|
|
83
|
-
i0.ɵɵelementEnd();
|
|
64
|
+
function ComponentArtifactViewerComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
65
|
+
i0.ɵɵtemplate(0, ComponentArtifactViewerComponent_Conditional_3_Conditional_0_Template, 2, 1, "mj-react-component", 5)(1, ComponentArtifactViewerComponent_Conditional_3_Conditional_1_Template, 6, 0, "div", 3);
|
|
84
66
|
} if (rf & 2) {
|
|
85
|
-
const
|
|
86
|
-
i0.ɵɵ
|
|
87
|
-
i0.ɵɵconditional(ctx_r1.hasError ? 1 : 2);
|
|
88
|
-
} }
|
|
89
|
-
function ComponentArtifactViewerComponent_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
90
|
-
const _r4 = i0.ɵɵgetCurrentView();
|
|
91
|
-
i0.ɵɵelementStart(0, "mj-code-editor", 17);
|
|
92
|
-
i0.ɵɵtwoWayListener("ngModelChange", function ComponentArtifactViewerComponent_Conditional_11_Template_mj_code_editor_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.componentCode, $event) || (ctx_r1.componentCode = $event); return i0.ɵɵresetView($event); });
|
|
93
|
-
i0.ɵɵelementEnd();
|
|
94
|
-
} if (rf & 2) {
|
|
95
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
96
|
-
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.componentCode);
|
|
97
|
-
i0.ɵɵproperty("language", "typescript")("readonly", ctx_r1.readonly);
|
|
67
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
68
|
+
i0.ɵɵconditional(ctx_r0.component ? 0 : 1);
|
|
98
69
|
} }
|
|
99
70
|
/**
|
|
100
71
|
* Viewer component for interactive Component artifacts (React-based UI components)
|
|
72
|
+
*
|
|
73
|
+
* Features:
|
|
74
|
+
* - Live component preview with React rendering
|
|
75
|
+
* - Dynamic tabs for component metadata (via GetAdditionalTabs)
|
|
76
|
+
* - Provides tabs for: Code, Functional Requirements, Technical Design, Data Requirements
|
|
101
77
|
*/
|
|
102
78
|
let ComponentArtifactViewerComponent = class ComponentArtifactViewerComponent extends BaseArtifactViewerPluginComponent {
|
|
103
79
|
adapter;
|
|
104
80
|
reactComponent;
|
|
81
|
+
tabsChanged = new EventEmitter();
|
|
82
|
+
// Component data
|
|
105
83
|
component = null;
|
|
106
84
|
componentCode = "";
|
|
107
85
|
componentName = '';
|
|
108
|
-
|
|
86
|
+
// Error state
|
|
109
87
|
hasError = false;
|
|
110
88
|
errorMessage = '';
|
|
111
89
|
errorDetails = '';
|
|
@@ -113,15 +91,34 @@ let ComponentArtifactViewerComponent = class ComponentArtifactViewerComponent ex
|
|
|
113
91
|
super();
|
|
114
92
|
this.adapter = adapter;
|
|
115
93
|
}
|
|
116
|
-
async
|
|
117
|
-
//
|
|
118
|
-
if (
|
|
119
|
-
this.
|
|
94
|
+
async ngOnChanges(changes) {
|
|
95
|
+
// When artifactVersion input changes, reload the component spec
|
|
96
|
+
if (changes['artifactVersion'] && !changes['artifactVersion'].firstChange) {
|
|
97
|
+
await this.loadComponentSpec();
|
|
98
|
+
// Notify parent that tabs may have changed
|
|
99
|
+
this.tabsChanged.emit();
|
|
120
100
|
}
|
|
121
|
-
|
|
122
|
-
|
|
101
|
+
}
|
|
102
|
+
async loadComponentSpec() {
|
|
103
|
+
try {
|
|
104
|
+
if (this.artifactVersion.Content) {
|
|
105
|
+
this.component = SafeJSONParse(this.artifactVersion.Content);
|
|
106
|
+
this.extractComponentParts();
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
throw new Error('Artifact content is empty');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
console.error('Failed to load component spec:', error);
|
|
114
|
+
this.hasError = true;
|
|
115
|
+
this.errorMessage = 'Failed to load component';
|
|
116
|
+
this.errorDetails = error instanceof Error ? error.message : String(error);
|
|
123
117
|
}
|
|
124
|
-
|
|
118
|
+
}
|
|
119
|
+
async ngOnInit() {
|
|
120
|
+
// Load initial component spec
|
|
121
|
+
await this.loadComponentSpec();
|
|
125
122
|
// Initialize Angular adapter for React components
|
|
126
123
|
try {
|
|
127
124
|
await this.adapter.initialize();
|
|
@@ -137,53 +134,61 @@ let ComponentArtifactViewerComponent = class ComponentArtifactViewerComponent ex
|
|
|
137
134
|
// Component initialization happens automatically via mj-react-component
|
|
138
135
|
}
|
|
139
136
|
/**
|
|
140
|
-
*
|
|
137
|
+
* Provide additional tabs for viewing component metadata
|
|
141
138
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
139
|
+
GetAdditionalTabs() {
|
|
140
|
+
const tabs = [];
|
|
141
|
+
if (!this.component) {
|
|
142
|
+
return tabs;
|
|
143
|
+
}
|
|
144
|
+
// Functional Requirements tab
|
|
145
|
+
if (this.component.functionalRequirements) {
|
|
146
|
+
tabs.push({
|
|
147
|
+
label: 'Functional',
|
|
148
|
+
icon: 'fa-clipboard-list',
|
|
149
|
+
contentType: 'markdown',
|
|
150
|
+
content: this.component.functionalRequirements
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
// Technical Design tab
|
|
154
|
+
if (this.component.technicalDesign) {
|
|
155
|
+
tabs.push({
|
|
156
|
+
label: 'Technical',
|
|
157
|
+
icon: 'fa-wrench',
|
|
158
|
+
contentType: 'markdown',
|
|
159
|
+
content: this.component.technicalDesign
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
// Data Requirements tab
|
|
163
|
+
if (this.component.dataRequirements) {
|
|
164
|
+
tabs.push({
|
|
165
|
+
label: 'Data',
|
|
166
|
+
icon: 'fa-database',
|
|
167
|
+
contentType: 'json',
|
|
168
|
+
content: JSON.stringify(this.component.dataRequirements, null, 2),
|
|
169
|
+
language: 'json'
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
// Code tab (lazy-loaded)
|
|
173
|
+
tabs.push({
|
|
174
|
+
label: 'Code',
|
|
175
|
+
icon: 'fa-code',
|
|
176
|
+
contentType: 'code',
|
|
177
|
+
language: 'typescript',
|
|
178
|
+
content: () => BuildComponentCompleteCode(this.component)
|
|
179
|
+
});
|
|
180
|
+
return tabs;
|
|
150
181
|
}
|
|
151
182
|
extractComponentParts() {
|
|
152
183
|
if (this.component?.name) {
|
|
153
|
-
this.componentName = this.component
|
|
184
|
+
this.componentName = this.component.name;
|
|
154
185
|
}
|
|
155
186
|
if (this.component?.code) {
|
|
156
187
|
this.componentCode = BuildComponentCompleteCode(this.component);
|
|
157
188
|
}
|
|
158
189
|
}
|
|
159
|
-
onCopy() {
|
|
160
|
-
if (this.componentCode) {
|
|
161
|
-
navigator.clipboard.writeText(this.componentCode).then(() => {
|
|
162
|
-
console.log('✅ Copied component code to clipboard');
|
|
163
|
-
}).catch(err => {
|
|
164
|
-
console.error('Failed to copy to clipboard:', err);
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
190
|
onComponentEvent(event) {
|
|
169
|
-
|
|
170
|
-
this.hasError = true;
|
|
171
|
-
this.errorMessage = event.payload?.error || 'An unknown error occurred';
|
|
172
|
-
this.errorDetails = event.payload?.errorInfo || event.payload?.stackTrace || '';
|
|
173
|
-
console.error('Component error:', event.payload);
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
console.log('Component event:', event.type, event.payload);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
onStateChange(event) {
|
|
180
|
-
console.log('Component state change:', event);
|
|
181
|
-
// Could update componentContext here if needed for persistence
|
|
182
|
-
}
|
|
183
|
-
onOpenEntityRecord(event) {
|
|
184
|
-
console.log('Open entity record requested:', event);
|
|
185
|
-
// This would typically be handled by a parent component to open entity forms
|
|
186
|
-
// For now just log it
|
|
191
|
+
console.log('Component event:', event);
|
|
187
192
|
}
|
|
188
193
|
static ɵfac = function ComponentArtifactViewerComponent_Factory(t) { return new (t || ComponentArtifactViewerComponent)(i0.ɵɵdirectiveInject(i1.AngularAdapterService)); };
|
|
189
194
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ComponentArtifactViewerComponent, selectors: [["mj-component-artifact-viewer"]], viewQuery: function ComponentArtifactViewerComponent_Query(rf, ctx) { if (rf & 1) {
|
|
@@ -191,32 +196,15 @@ let ComponentArtifactViewerComponent = class ComponentArtifactViewerComponent ex
|
|
|
191
196
|
} if (rf & 2) {
|
|
192
197
|
let _t;
|
|
193
198
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.reactComponent = _t.first);
|
|
194
|
-
} }, features: [i0.ɵɵInheritDefinitionFeature], decls:
|
|
195
|
-
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)
|
|
196
|
-
i0.ɵɵ
|
|
197
|
-
i0.ɵɵtext(4, " Interactive Component ");
|
|
198
|
-
i0.ɵɵelementEnd();
|
|
199
|
-
i0.ɵɵelementStart(5, "button", 5);
|
|
200
|
-
i0.ɵɵlistener("click", function ComponentArtifactViewerComponent_Template_button_click_5_listener() { return ctx.viewMode = ctx.viewMode === "preview" ? "source" : "preview"; });
|
|
201
|
-
i0.ɵɵelement(6, "i");
|
|
202
|
-
i0.ɵɵtext(7);
|
|
203
|
-
i0.ɵɵelementEnd();
|
|
204
|
-
i0.ɵɵtemplate(8, ComponentArtifactViewerComponent_Conditional_8_Template, 3, 0, "button", 6);
|
|
205
|
-
i0.ɵɵelementEnd();
|
|
206
|
-
i0.ɵɵelementStart(9, "div", 7);
|
|
207
|
-
i0.ɵɵtemplate(10, ComponentArtifactViewerComponent_Conditional_10_Template, 3, 1, "div", 8)(11, ComponentArtifactViewerComponent_Conditional_11_Template, 1, 3, "mj-code-editor", 9);
|
|
199
|
+
} }, outputs: { tabsChanged: "tabsChanged" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 4, vars: 2, consts: [["reactComponent", ""], [1, "component-artifact-viewer", 3, "ngClass"], [1, "component-preview"], [1, "error-state"], [1, "fa-solid", "fa-exclamation-triangle"], [3, "component"], [3, "componentEvent", "component"], [1, "fa-solid", "fa-exclamation-circle"]], template: function ComponentArtifactViewerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
200
|
+
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2);
|
|
201
|
+
i0.ɵɵtemplate(2, ComponentArtifactViewerComponent_Conditional_2_Template, 7, 2, "div", 3)(3, ComponentArtifactViewerComponent_Conditional_3_Template, 2, 1);
|
|
208
202
|
i0.ɵɵelementEnd()();
|
|
209
203
|
} if (rf & 2) {
|
|
210
204
|
i0.ɵɵproperty("ngClass", ctx.cssClass);
|
|
211
|
-
i0.ɵɵadvance(6);
|
|
212
|
-
i0.ɵɵclassMap(ctx.viewMode === "preview" ? "fas fa-code" : "fas fa-eye");
|
|
213
|
-
i0.ɵɵadvance();
|
|
214
|
-
i0.ɵɵtextInterpolate1(" ", ctx.viewMode === "preview" ? "Source" : "Preview", " ");
|
|
215
|
-
i0.ɵɵadvance();
|
|
216
|
-
i0.ɵɵconditional(ctx.viewMode === "source" ? 8 : -1);
|
|
217
205
|
i0.ɵɵadvance(2);
|
|
218
|
-
i0.ɵɵconditional(ctx.
|
|
219
|
-
} }, dependencies: [i2.NgClass,
|
|
206
|
+
i0.ɵɵconditional(ctx.hasError ? 2 : 3);
|
|
207
|
+
} }, dependencies: [i2.NgClass, i1.MJReactComponent], styles: [".component-artifact-viewer[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n background: white;\n}\n\n.component-preview[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n\n.error-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: #dc3545;\n\n i {\n font-size: 48px;\n margin-bottom: 16px;\n }\n\n h3 {\n margin: 0 0 8px 0;\n font-size: 20px;\n }\n\n p {\n margin: 0 0 12px 0;\n color: #6c757d;\n }\n\n details {\n margin-top: 16px;\n text-align: left;\n max-width: 600px;\n\n summary {\n cursor: pointer;\n color: #495057;\n font-weight: 500;\n margin-bottom: 8px;\n\n &:hover {\n color: #212529;\n }\n }\n\n pre {\n background: #f8f9fa;\n padding: 12px;\n border-radius: 4px;\n overflow-x: auto;\n font-size: 12px;\n color: #495057;\n margin: 0;\n }\n }\n}"] });
|
|
220
208
|
};
|
|
221
209
|
ComponentArtifactViewerComponent = __decorate([
|
|
222
210
|
RegisterClass(BaseArtifactViewerPluginComponent, 'ComponentArtifactViewerPlugin')
|
|
@@ -224,70 +212,12 @@ ComponentArtifactViewerComponent = __decorate([
|
|
|
224
212
|
export { ComponentArtifactViewerComponent };
|
|
225
213
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ComponentArtifactViewerComponent, [{
|
|
226
214
|
type: Component,
|
|
227
|
-
args: [{ selector: 'mj-component-artifact-viewer', template:
|
|
228
|
-
<div class="component-artifact-viewer" [ngClass]="cssClass">
|
|
229
|
-
<div class="component-toolbar">
|
|
230
|
-
<div class="component-badge">
|
|
231
|
-
<i class="fas fa-cube"></i> Interactive Component
|
|
232
|
-
</div>
|
|
233
|
-
<button class="btn-icon" title="View Source Code" (click)="viewMode = viewMode === 'preview' ? 'source' : 'preview'">
|
|
234
|
-
<i [class]="viewMode === 'preview' ? 'fas fa-code' : 'fas fa-eye'"></i>
|
|
235
|
-
{{ viewMode === 'preview' ? 'Source' : 'Preview' }}
|
|
236
|
-
</button>
|
|
237
|
-
@if (viewMode === 'source') {
|
|
238
|
-
<button class="btn-icon" title="Copy Code" (click)="onCopy()">
|
|
239
|
-
<i class="fas fa-copy"></i> Copy
|
|
240
|
-
</button>
|
|
241
|
-
}
|
|
242
|
-
</div>
|
|
243
|
-
<div class="component-content-container">
|
|
244
|
-
@if (viewMode === 'preview') {
|
|
245
|
-
<div class="component-preview">
|
|
246
|
-
@if (hasError) {
|
|
247
|
-
<div class="error-state">
|
|
248
|
-
<i class="fas fa-exclamation-triangle"></i>
|
|
249
|
-
<h3>Component Error</h3>
|
|
250
|
-
<p>{{ errorMessage }}</p>
|
|
251
|
-
@if (errorDetails) {
|
|
252
|
-
<details>
|
|
253
|
-
<summary>Technical Details</summary>
|
|
254
|
-
<pre>{{ errorDetails }}</pre>
|
|
255
|
-
</details>
|
|
256
|
-
}
|
|
257
|
-
</div>
|
|
258
|
-
} @else {
|
|
259
|
-
@if (component) {
|
|
260
|
-
<mj-react-component
|
|
261
|
-
#reactComponent
|
|
262
|
-
[component]="component"
|
|
263
|
-
(componentEvent)="onComponentEvent($event)"
|
|
264
|
-
(stateChange)="onStateChange($event)"
|
|
265
|
-
(openEntityRecord)="onOpenEntityRecord($event)">
|
|
266
|
-
</mj-react-component>
|
|
267
|
-
}
|
|
268
|
-
@else {
|
|
269
|
-
<div class="error-state">
|
|
270
|
-
<i class="fas fa-exclamation-circle"></i>
|
|
271
|
-
<h3>No Component Loaded</h3>
|
|
272
|
-
<p>The component data is missing or invalid.</p>
|
|
273
|
-
</div>
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
</div>
|
|
277
|
-
} @else {
|
|
278
|
-
<mj-code-editor
|
|
279
|
-
[(ngModel)]="componentCode"
|
|
280
|
-
[language]="'typescript'"
|
|
281
|
-
[readonly]="readonly"
|
|
282
|
-
style="width: 100%; height: 100%;">
|
|
283
|
-
</mj-code-editor>
|
|
284
|
-
}
|
|
285
|
-
</div>
|
|
286
|
-
</div>
|
|
287
|
-
`, styles: ["\n .component-artifact-viewer {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .component-toolbar {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px;\n background: #f5f5f5;\n border-bottom: 1px solid #ddd;\n gap: 8px;\n }\n\n .component-badge {\n padding: 6px 12px;\n background: #28a745;\n color: white;\n border-radius: 12px;\n font-size: 11px;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 6px;\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 .component-content-container {\n flex: 1;\n overflow: auto;\n }\n\n .component-preview {\n padding: 20px;\n background: white;\n height: 100%;\n overflow: auto;\n }\n\n .error-state {\n padding: 20px;\n text-align: center;\n color: #dc3545;\n }\n\n .error-state i {\n font-size: 48px;\n margin-bottom: 16px;\n }\n\n .error-state h3 {\n margin: 0 0 12px;\n font-size: 20px;\n font-weight: 600;\n }\n\n .error-state p {\n margin: 0 0 12px;\n color: #6c757d;\n }\n\n .error-state details {\n margin-top: 16px;\n text-align: left;\n background: #f8f9fa;\n padding: 12px;\n border-radius: 4px;\n }\n\n .error-state summary {\n cursor: pointer;\n font-weight: 600;\n color: #495057;\n }\n\n .error-state pre {\n margin-top: 8px;\n white-space: pre-wrap;\n word-wrap: break-word;\n font-size: 12px;\n color: #212529;\n }\n "] }]
|
|
215
|
+
args: [{ selector: 'mj-component-artifact-viewer', template: "<div class=\"component-artifact-viewer\" [ngClass]=\"cssClass\">\n <!-- Component Preview (full screen) -->\n <div class=\"component-preview\">\n @if (hasError) {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <h3>Component Error</h3>\n <p>{{ errorMessage }}</p>\n @if (errorDetails) {\n <details>\n <summary>Technical Details</summary>\n <pre>{{ errorDetails }}</pre>\n </details>\n }\n </div>\n } @else {\n @if (component) {\n <mj-react-component\n #reactComponent\n [component]=\"component\"\n (componentEvent)=\"onComponentEvent($event)\">\n </mj-react-component>\n } @else {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-circle\"></i>\n <h3>No Component Loaded</h3>\n <p>The component data is missing or invalid.</p>\n </div>\n }\n }\n </div>\n</div>\n\n", styles: [".component-artifact-viewer {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n background: white;\n}\n\n.component-preview {\n flex: 1;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n\n.error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px;\n text-align: center;\n color: #dc3545;\n\n i {\n font-size: 48px;\n margin-bottom: 16px;\n }\n\n h3 {\n margin: 0 0 8px 0;\n font-size: 20px;\n }\n\n p {\n margin: 0 0 12px 0;\n color: #6c757d;\n }\n\n details {\n margin-top: 16px;\n text-align: left;\n max-width: 600px;\n\n summary {\n cursor: pointer;\n color: #495057;\n font-weight: 500;\n margin-bottom: 8px;\n\n &:hover {\n color: #212529;\n }\n }\n\n pre {\n background: #f8f9fa;\n padding: 12px;\n border-radius: 4px;\n overflow-x: auto;\n font-size: 12px;\n color: #495057;\n margin: 0;\n }\n }\n}\n"] }]
|
|
288
216
|
}], () => [{ type: i1.AngularAdapterService }], { reactComponent: [{
|
|
289
217
|
type: ViewChild,
|
|
290
218
|
args: ['reactComponent']
|
|
219
|
+
}], tabsChanged: [{
|
|
220
|
+
type: Output
|
|
291
221
|
}] }); })();
|
|
292
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ComponentArtifactViewerComponent, { className: "ComponentArtifactViewerComponent", filePath: "src/lib/components/plugins/component-artifact-viewer.component.ts", lineNumber:
|
|
222
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ComponentArtifactViewerComponent, { className: "ComponentArtifactViewerComponent", filePath: "src/lib/components/plugins/component-artifact-viewer.component.ts", lineNumber: 21 }); })();
|
|
293
223
|
//# sourceMappingURL=component-artifact-viewer.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/plugins/component-artifact-viewer.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"component-artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/plugins/component-artifact-viewer.component.ts","../../../../src/lib/components/plugins/component-artifact-viewer.component.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAmD,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,iCAAiC,EAAqB,MAAM,mCAAmC,CAAC;AAEzG,OAAO,EAAE,0BAA0B,EAAiB,MAAM,6CAA6C,CAAC;;;;;;ICM5F,AADF,+BAAS,cACE;IAAA,iCAAiB;IAAA,iBAAU;IACpC,2BAAK;IAAA,YAAkB;IACzB,AADyB,iBAAM,EACrB;;;IADH,eAAkB;IAAlB,yCAAkB;;;IAP7B,8BAAyB;IACvB,uBAAgD;IAChD,0BAAI;IAAA,+BAAe;IAAA,iBAAK;IACxB,yBAAG;IAAA,YAAkB;IAAA,iBAAI;IACzB,wGAAoB;IAMtB,iBAAM;;;IAPD,eAAkB;IAAlB,yCAAkB;IACrB,cAKC;IALD,8CAKC;;;;IAID,gDAG8C;IAA5C,uPAAkB,+BAAwB,KAAC;IAC7C,iBAAqB;;;IAFnB,4CAAuB;;;IAIzB,8BAAyB;IACvB,uBAA8C;IAC9C,0BAAI;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,GAAG,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;0FA9HU,gCAAgC;6DAAhC,gCAAgC;;;;;;YClB3C,AAFF,8BAA4D,aAE3B;YAa3B,AAZF,yFAAgB,kEAYP;YAgBb,AADE,iBAAM,EACF;;YA/BiC,sCAAoB;YAGvD,eA0BC;YA1BD,sCA0BC;;;ADTQ,gCAAgC;IAD5C,aAAa,CAAC,iCAAiC,EAAE,+BAA+B,CAAC;GACrE,gCAAgC,CA+H5C;;iFA/HY,gCAAgC;cAN5C,SAAS;2BACE,8BAA8B;sDAMX,cAAc;kBAA1C,SAAS;mBAAC,gBAAgB;YACjB,WAAW;kBAApB,MAAM;;kFAFI,gCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-artifact-viewer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/plugins/html-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,qBAuFa,2BAA4B,SAAQ,iCAAiC;IAKpE,OAAO,CAAC,SAAS;IAJtB,WAAW,SAAM;IACjB,eAAe,EAAE,QAAQ,CAAM;IAC/B,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAa;gBAE9B,SAAS,EAAE,YAAY;IAI3C,QAAQ,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"html-artifact-viewer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/plugins/html-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,qBAuFa,2BAA4B,SAAQ,iCAAiC;IAKpE,OAAO,CAAC,SAAS;IAJtB,WAAW,SAAM;IACjB,eAAe,EAAE,QAAQ,CAAM;IAC/B,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAa;gBAE9B,SAAS,EAAE,YAAY;IAI3C,QAAQ,IAAI,IAAI;IAqBhB,MAAM,IAAI,IAAI;yCA9BH,2BAA2B;2CAA3B,2BAA2B;CAuCvC"}
|
|
@@ -44,7 +44,19 @@ let HtmlArtifactViewerComponent = class HtmlArtifactViewerComponent extends Base
|
|
|
44
44
|
this.sanitizer = sanitizer;
|
|
45
45
|
}
|
|
46
46
|
ngOnInit() {
|
|
47
|
-
|
|
47
|
+
// Get content and clean up double-escaped characters that can appear in LLM-generated HTML
|
|
48
|
+
// These appear as literal "\\n", "\\t", "\\\"" in the string and cause rendering issues
|
|
49
|
+
let content = this.getContent();
|
|
50
|
+
// Remove escaped quotes (\" becomes ")
|
|
51
|
+
content = content.replace(/\\"/g, '"');
|
|
52
|
+
// Remove double-escaped newlines (\\n becomes nothing)
|
|
53
|
+
// HTML doesn't need whitespace for formatting, and these cause display issues
|
|
54
|
+
content = content.replace(/\\n/g, '');
|
|
55
|
+
content = content.replace(/\\\\n/g, '');
|
|
56
|
+
// Also remove double-escaped tabs if present
|
|
57
|
+
content = content.replace(/\\t/g, '');
|
|
58
|
+
content = content.replace(/\\\\t/g, '');
|
|
59
|
+
this.htmlContent = content;
|
|
48
60
|
this.safeHtmlContent = this.sanitizer.sanitize(1, this.htmlContent) || '';
|
|
49
61
|
}
|
|
50
62
|
onCopy() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/plugins/html-artifact-viewer.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;;;;;;;IAwB5E,8BAA0B;IACxB,0BAAyC;IAC3C,iBAAM;;;IADC,cAA6B;IAA7B,qEAA6B;;;;IAGpC,0CAIqC;IAHnC,mUAAyB;IAI3B,iBAAiB;;;IAJf,kDAAyB;IAEzB,AADA,iCAAmB,6BACE;;AA7BjC;;GAEG;AAwFI,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,iCAAiC;IAK5D;IAJb,WAAW,GAAG,EAAE,CAAC;IACjB,eAAe,GAAa,EAAE,CAAC;IAC/B,QAAQ,GAAyB,SAAS,CAAC;IAElD,YAAoB,SAAuB;QACzC,KAAK,EAAE,CAAC;QADU,cAAS,GAAT,SAAS,CAAc;IAE3C,CAAC;IAED,QAAQ;QACN,IAAI,
|
|
1
|
+
{"version":3,"file":"html-artifact-viewer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/plugins/html-artifact-viewer.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;;;;;;;IAwB5E,8BAA0B;IACxB,0BAAyC;IAC3C,iBAAM;;;IADC,cAA6B;IAA7B,qEAA6B;;;;IAGpC,0CAIqC;IAHnC,mUAAyB;IAI3B,iBAAiB;;;IAJf,kDAAyB;IAEzB,AADA,iCAAmB,6BACE;;AA7BjC;;GAEG;AAwFI,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,iCAAiC;IAK5D;IAJb,WAAW,GAAG,EAAE,CAAC;IACjB,eAAe,GAAa,EAAE,CAAC;IAC/B,QAAQ,GAAyB,SAAS,CAAC;IAElD,YAAoB,SAAuB;QACzC,KAAK,EAAE,CAAC;QADU,cAAS,GAAT,SAAS,CAAc;IAE3C,CAAC;IAED,QAAQ;QACN,2FAA2F;QAC3F,wFAAwF;QACxF,IAAI,OAAO,GAAG,IAAI,C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;YAAnB,wGAAS,YAAQ,IAAC;YAC3D,uBAA2B;YAAC,uBAC9B;YACF,AADE,iBAAS,EACL;YACN,+BAAoC;YAKhC,AAJF,sFAA8B,qFAIrB;YASb,AADE,iBAAM,EACF;;YA5B4B,sCAAoB;YAEzB,eAAuC;YAAvC,oDAAuC;YAIvC,eAAsC;YAAtC,mDAAsC;YAS/D,eAWC;YAXD,sDAWC;;;AA0DI,2BAA2B;IADvC,aAAa,CAAC,iCAAiC,EAAE,0BAA0B,CAAC;GAChE,2BAA2B,CAuCvC;;iFAvCY,2BAA2B;cAvFvC,SAAS;2BACE,yBAAyB,YACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BT;;kFAuDU,2BAA2B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OnInit, ChangeDetectorRef } from '@angular/core';
|
|
2
|
-
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
1
|
+
import { OnInit, OnDestroy, ChangeDetectorRef, ElementRef } from '@angular/core';
|
|
2
|
+
import { DomSanitizer, SafeHtml, SafeResourceUrl } from '@angular/platform-browser';
|
|
3
3
|
import { BaseArtifactViewerPluginComponent } from '../base-artifact-viewer.component';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
@@ -7,18 +7,22 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
* Supports extract rules - shows displayMarkdown, displayHtml, or raw JSON editor (in that priority order).
|
|
8
8
|
* All content is displayed in the parent's Display tab.
|
|
9
9
|
*/
|
|
10
|
-
export declare class JsonArtifactViewerComponent extends BaseArtifactViewerPluginComponent implements OnInit {
|
|
10
|
+
export declare class JsonArtifactViewerComponent extends BaseArtifactViewerPluginComponent implements OnInit, OnDestroy {
|
|
11
11
|
private cdr;
|
|
12
12
|
private sanitizer;
|
|
13
|
+
htmlFrame?: ElementRef<HTMLIFrameElement>;
|
|
13
14
|
jsonContent: string;
|
|
14
15
|
displayMarkdown: string | null;
|
|
15
16
|
displayHtml: string | null;
|
|
17
|
+
htmlBlobUrl: SafeResourceUrl | null;
|
|
16
18
|
renderedMarkdown: SafeHtml | null;
|
|
17
19
|
private versionAttributes;
|
|
20
|
+
private unsafeBlobUrl;
|
|
18
21
|
constructor(cdr: ChangeDetectorRef, sanitizer: DomSanitizer);
|
|
22
|
+
ngOnDestroy(): void;
|
|
19
23
|
ngOnInit(): Promise<void>;
|
|
20
24
|
/**
|
|
21
|
-
* Override to return true when showing extracted
|
|
25
|
+
* Override to return true when showing extracted displayHtml or displayMarkdown.
|
|
22
26
|
* Returns false when showing raw JSON editor (no extract rules available).
|
|
23
27
|
*/
|
|
24
28
|
get isShowingElevatedDisplay(): boolean;
|
|
@@ -30,7 +34,16 @@ export declare class JsonArtifactViewerComponent extends BaseArtifactViewerPlugi
|
|
|
30
34
|
get parentShouldShowRawContent(): boolean;
|
|
31
35
|
private loadVersionAttributes;
|
|
32
36
|
private parseAttributeValue;
|
|
37
|
+
onIframeLoad(): void;
|
|
38
|
+
private resizeIframeToContent;
|
|
39
|
+
openInNewWindow(): void;
|
|
40
|
+
printHtml(): void;
|
|
33
41
|
onCopy(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Clean up double-escaped characters that appear in LLM-generated HTML
|
|
44
|
+
* Removes literal "\\n", "\\t", and "\\\"" which cause rendering issues
|
|
45
|
+
*/
|
|
46
|
+
private cleanEscapedCharacters;
|
|
34
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<JsonArtifactViewerComponent, never>;
|
|
35
48
|
static ɵcmp: i0.ɵɵComponentDeclaration<JsonArtifactViewerComponent, "mj-json-artifact-viewer", never, {}, {}, never, never, false, never>;
|
|
36
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-artifact-viewer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/plugins/json-artifact-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"json-artifact-viewer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/plugins/json-artifact-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAa,UAAU,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEpF,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;;AAKtF;;;;GAIG;AACH,qBA8Ga,2BAA4B,SAAQ,iCAAkC,YAAW,MAAM,EAAE,SAAS;IAY3G,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,SAAS;IAZK,SAAS,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAE3D,WAAW,SAAM;IACjB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAClC,WAAW,EAAE,eAAe,GAAG,IAAI,CAAQ;IAC3C,gBAAgB,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAChD,OAAO,CAAC,iBAAiB,CAAwC;IACjE,OAAO,CAAC,aAAa,CAAuB;gBAGlC,GAAG,EAAE,iBAAiB,EACtB,SAAS,EAAE,YAAY;IAKjC,WAAW,IAAI,IAAI;IASb,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAU/B;;;OAGG;IACH,IAAoB,wBAAwB,IAAI,OAAO,CAEtD;IAED;;;;OAIG;IACH,IAAoB,0BAA0B,IAAI,OAAO,CAExD;YAEa,qBAAqB;IAuEnC,OAAO,CAAC,mBAAmB;IAyB3B,YAAY,IAAI,IAAI;IAsDpB,OAAO,CAAC,qBAAqB;IAqC7B,eAAe,IAAI,IAAI;IAUvB,SAAS,IAAI,IAAI;IAWjB,MAAM,IAAI,IAAI;IAYd;;;OAGG;IACH,OAAO,CAAC,sBAAsB;yCAtRnB,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